2 * \file LaTeXFeatures.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
10 * \author André Pönitz
12 * Full author contact details are available in file CREDITS.
17 #include "LaTeXFeatures.h"
19 #include "BufferParams.h"
24 #include "FloatList.h"
29 #include "support/docstream.h"
30 #include "support/filetools.h"
37 using std::ostringstream;
43 using support::isSGMLFilename;
44 using support::libFileSearch;
45 using support::makeRelPath;
46 using support::onlyPath;
48 /////////////////////////////////////////////////////////////////////
52 /////////////////////////////////////////////////////////////////////
54 //\NeedsTeXFormat{LaTeX2e}
55 //\ProvidesPackage{lyx}[1996/01/11 LLE v0.2 (LyX LaTeX Extensions)]
56 //\message{LyX LaTeX Extensions (LLE v0.2) of 11-Jan-1996.}
58 static string const lyx_def =
59 "\\providecommand{\\LyX}{L\\kern-.1667em\\lower.25em\\hbox{Y}\\kern-.125emX\\@}";
61 static string const lyxline_def =
62 "\\newcommand{\\lyxline}[1][1pt]{%\n"
64 " \\rule[.5ex]{\\linewidth}{#1}\\par}";
66 static string const noun_def = "\\newcommand{\\noun}[1]{\\textsc{#1}}";
68 static string const lyxarrow_def =
69 "\\newcommand{\\lyxarrow}{\\leavevmode\\,$\\triangleright$\\,\\allowbreak}";
71 // for quotes without babel. This does not give perfect results, but
72 // anybody serious about non-english quotes should use babel (JMarc).
74 static string const quotedblbase_def =
75 "\\ProvideTextCommandDefault{\\quotedblbase}{%\n"
76 " \\raisebox{-1.4ex}[1ex][.5ex]{\\textquotedblright}%\n"
77 " \\penalty10000\\hskip0em\\relax%\n"
80 static string const quotesinglbase_def =
81 "\\ProvideTextCommandDefault{\\quotesinglbase}{%\n"
82 " \\raisebox{-1.4ex}[1ex][.5ex]{\\textquoteright}%\n"
83 " \\penalty10000\\hskip0em\\relax%\n"
86 static string const guillemotleft_def =
87 "\\ProvideTextCommandDefault{\\guillemotleft}{%\n"
88 " {\\usefont{U}{lasy}{m}{n}\\char'50\\kern-.15em\\char'50}%\n"
89 "\\penalty10000\\hskip0pt\\relax%\n"
92 static string const guillemotright_def =
93 "\\ProvideTextCommandDefault{\\guillemotright}{%\n"
94 " \\penalty10000\\hskip0pt%\n"
95 " {\\usefont{U}{lasy}{m}{n}\\char'51\\kern-.15em\\char'51}%\n"
98 static string const guilsinglleft_def =
99 "\\ProvideTextCommandDefault{\\guilsinglleft}{%\n"
100 " {\\usefont{U}{lasy}{m}{n}\\char'50}%\n"
101 " \\penalty10000\\hskip0pt\\relax%\n"
104 static string const guilsinglright_def =
105 "\\ProvideTextCommandDefault{\\guilsinglright}{%\n"
106 " \\penalty10000\\hskip0pt%\n"
107 " {\\usefont{U}{lasy}{m}{n}\\char'51}%\n"
110 static string const paragraphleftindent_def =
111 "\\newenvironment{LyXParagraphLeftIndent}[1]%\n"
113 " \\begin{list}{}{%\n"
114 " \\setlength{\\topsep}{0pt}%\n"
115 " \\addtolength{\\leftmargin}{#1}\n"
116 // ho hum, yet more things commented out with no hint as to why they
117 // weren't just removed
118 // "%% \\addtolength{\\leftmargin}{#1\\textwidth}\n"
119 // "%% \\setlength{\\textwidth}{#2\\textwidth}\n"
120 // "%% \\setlength\\listparindent\\parindent%\n"
121 // "%% \\setlength\\itemindent\\parindent%\n"
122 " \\setlength{\\parsep}{0pt plus 1pt}%\n"
128 static string const floatingfootnote_def =
129 "%% Special footnote code from the package 'stblftnt.sty'\n"
130 "%% Author: Robin Fairbairns -- Last revised Dec 13 1996\n"
131 "\\let\\SF@@footnote\\footnote\n"
132 "\\def\\footnote{\\ifx\\protect\\@typeset@protect\n"
133 " \\expandafter\\SF@@footnote\n"
135 " \\expandafter\\SF@gobble@opt\n"
138 "\\expandafter\\def\\csname SF@gobble@opt \\endcsname{\\@ifnextchar[%]\n"
139 " \\SF@gobble@twobracket\n"
142 "\\edef\\SF@gobble@opt{\\noexpand\\protect\n"
143 " \\expandafter\\noexpand\\csname SF@gobble@opt \\endcsname}\n"
144 "\\def\\SF@gobble@twobracket[#1]#2{}\n";
146 static string const boldsymbol_def =
147 "%% Bold symbol macro for standard LaTeX users\n"
148 "\\providecommand{\\boldsymbol}[1]{\\mbox{\\boldmath $#1$}}\n";
150 static string const binom_def =
151 "%% Binom macro for standard LaTeX users\n"
152 "\\newcommand{\\binom}[2]{{#1 \\choose #2}}\n";
154 static string const mathcircumflex_def =
155 "%% For printing a cirumflex inside a formula\n"
156 "\\newcommand{\\mathcircumflex}[0]{\\mbox{\\^{}}}\n";
158 static string const tabularnewline_def =
159 "%% Because html converters don't know tabularnewline\n"
160 "\\providecommand{\\tabularnewline}{\\\\}\n";
162 static string const lyxgreyedout_def =
163 "%% The greyedout annotation environment\n"
164 "\\newenvironment{lyxgreyedout}{\\textcolor[gray]{0.8}\\bgroup}{\\egroup}\n";
166 // We want to omit the file extension for includegraphics, but this does not
167 // work when the filename contains other dots.
168 // Idea from http://www.tex.ac.uk/cgi-bin/texfaq2html?label=unkgrfextn
169 static string const lyxdot_def =
170 "%% A simple dot to overcome graphicx limitations\n"
171 "\\newcommand{\\lyxdot}{.}\n";
173 static string const changetracking_dvipost_def =
174 "%% Change tracking with dvipost\n"
176 "\\dvipost{osstart color push Red}\n"
177 "\\dvipost{osend color pop}\n"
178 "\\dvipost{cbstart color push Blue}\n"
179 "\\dvipost{cbend color pop}\n"
180 "\\newcommand{\\lyxadded}[3]{\\changestart#3\\changeend}\n"
181 "\\newcommand{\\lyxdeleted}[3]{%\n"
182 "\\changestart\\overstrikeon#3\\overstrikeoff\\changeend}\n";
184 static string const changetracking_none_def =
185 "\\newcommand{\\lyxadded}[3]{#3}\n"
186 "\\newcommand{\\lyxdeleted}[3]{}\n";
189 /////////////////////////////////////////////////////////////////////
193 /////////////////////////////////////////////////////////////////////
195 LaTeXFeatures::PackagesList LaTeXFeatures::packages_;
198 LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p,
199 OutputParams const & r)
200 : buffer_(&b), params_(p), runparams_(r)
204 bool LaTeXFeatures::useBabel() const
206 return lyxrc.language_use_babel ||
207 (bufferParams().language->lang() != lyxrc.default_language &&
208 !bufferParams().language->babel().empty()) ||
209 this->hasLanguages();
213 void LaTeXFeatures::require(string const & name)
215 if (isRequired(name))
218 features_.push_back(name);
222 void LaTeXFeatures::getAvailable()
225 support::FileName const real_file = libFileSearch("", "packages.lst");
227 if (real_file.empty())
230 lex.setFile(real_file);
235 // Make sure that we are clean
238 bool finished = false;
240 while (lex.isOK() && !finished) {
242 case Lexer::LEX_FEOF:
246 string const name = lex.getString();
247 PackagesList::const_iterator begin = packages_.begin();
248 PackagesList::const_iterator end = packages_.end();
249 if (find(begin, end, name) == end)
250 packages_.push_back(name);
256 void LaTeXFeatures::useLayout(docstring const & layoutname)
258 // Some code to avoid loops in dependency definition
259 static int level = 0;
260 const int maxlevel = 30;
261 if (level > maxlevel) {
262 lyxerr << "LaTeXFeatures::useLayout: maximum level of "
263 << "recursion attained by layout "
264 << to_utf8(layoutname) << endl;
268 TextClass const & tclass = params_.getTextClass();
269 if (tclass.hasLayout(layoutname)) {
270 // Is this layout already in usedLayouts?
271 list<docstring>::const_iterator cit = usedLayouts_.begin();
272 list<docstring>::const_iterator end = usedLayouts_.end();
273 for (; cit != end; ++cit) {
274 if (layoutname == *cit)
278 LayoutPtr const & lyt = tclass[layoutname];
279 if (!lyt->depends_on().empty()) {
281 useLayout(lyt->depends_on());
284 usedLayouts_.push_back(layoutname);
286 lyxerr << "LaTeXFeatures::useLayout: layout `"
287 << to_utf8(layoutname) << "' does not exist in this class"
295 bool LaTeXFeatures::isRequired(string const & name) const
297 return find(features_.begin(), features_.end(), name) != features_.end();
301 bool LaTeXFeatures::mustProvide(string const & name) const
303 return isRequired(name) && !params_.getTextClass().provides(name);
307 bool LaTeXFeatures::isAvailable(string const & name)
309 if (packages_.empty())
311 return find(packages_.begin(), packages_.end(), name) != packages_.end();
315 void LaTeXFeatures::addPreambleSnippet(string const & preamble)
317 FeaturesList::const_iterator begin = preamble_snippets_.begin();
318 FeaturesList::const_iterator end = preamble_snippets_.end();
319 if (find(begin, end, preamble) == end)
320 preamble_snippets_.push_back(preamble);
324 void LaTeXFeatures::useFloat(string const & name)
326 usedFloats_.insert(name);
327 // We only need float.sty if we use non builtin floats, or if we
328 // use the "H" modifier. This includes modified table and
329 // figure floats. (Lgb)
330 Floating const & fl = params_.getTextClass().floats().getType(name);
331 if (!fl.type().empty() && !fl.builtin()) {
337 void LaTeXFeatures::useLanguage(Language const * lang)
339 if (!lang->babel().empty())
340 UsedLanguages_.insert(lang);
344 void LaTeXFeatures::includeFile(docstring const & key, string const & name)
346 IncludedFiles_[key] = name;
350 bool LaTeXFeatures::hasLanguages() const
352 return !UsedLanguages_.empty();
356 string LaTeXFeatures::getLanguages() const
358 ostringstream languages;
360 LanguageList::const_iterator const begin = UsedLanguages_.begin();
361 for (LanguageList::const_iterator cit = begin;
362 cit != UsedLanguages_.end();
366 languages << (*cit)->babel();
368 return languages.str();
372 set<string> LaTeXFeatures::getEncodingSet(string const & doc_encoding) const
374 // This does only find encodings of languages supported by babel, but
375 // that does not matter since we don't have a language with an
376 // encoding supported by inputenc but without babel support.
377 set<string> encodings;
378 LanguageList::const_iterator it = UsedLanguages_.begin();
379 LanguageList::const_iterator end = UsedLanguages_.end();
380 for (; it != end; ++it)
381 if ((*it)->encoding()->latexName() != doc_encoding &&
382 (*it)->encoding()->package() == Encoding::inputenc)
383 encodings.insert((*it)->encoding()->latexName());
389 char const * simplefeatures[] = {
390 // note that the package order here will be the same in the LaTeX-output
400 /*For a successful cooperation of the `wrapfig' package with the
401 `float' package you should load the `wrapfig' package *after*
402 the `float' package. See the caption package documentation
427 int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
432 string const LaTeXFeatures::getPackages() const
434 ostringstream packages;
435 TextClass const & tclass = params_.getTextClass();
438 // These are all the 'simple' includes. i.e
439 // packages which we just \usepackage{package}
441 for (int i = 0; i < nb_simplefeatures; ++i) {
442 if (mustProvide(simplefeatures[i]))
443 packages << "\\usepackage{"
444 << simplefeatures[i] << "}\n";
448 // The rest of these packages are somewhat more complicated
452 // esint is preferred for esintoramsmath
453 if ((mustProvide("amsmath") &&
454 params_.use_amsmath != BufferParams::package_off) ||
455 (mustProvide("esintoramsmath") &&
456 params_.use_esint == BufferParams::package_off)) {
457 packages << "\\usepackage{amsmath}\n";
460 // wasysym is a simple feature, but it must be after amsmath if both
462 // wasysym redefines some integrals (e.g. iint) from amsmath. That
463 // leads to inconsistent integrals. We only load this package if
464 // the document does not contain integrals (then isRequired("esint")
465 // is false) or if esint is used, since esint redefines all relevant
466 // integral symbols from wasysym and amsmath.
467 // See http://bugzilla.lyx.org/show_bug.cgi?id=1942
468 if (mustProvide("wasysym") &&
469 (params_.use_esint != BufferParams::package_off || !isRequired("esint")))
470 packages << "\\usepackage{wasysym}\n";
473 if (mustProvide("color")) {
474 if (params_.graphicsDriver == "default")
475 packages << "\\usepackage{color}\n";
477 packages << "\\usepackage["
478 << params_.graphicsDriver
483 if (isRequired("makeidx")) {
484 if (!tclass.provides("makeidx"))
485 packages << "\\usepackage{makeidx}\n";
486 packages << "\\makeindex\n";
490 if (mustProvide("graphicx") && params_.graphicsDriver != "none") {
491 if (params_.graphicsDriver == "default")
492 packages << "\\usepackage{graphicx}\n";
494 packages << "\\usepackage["
495 << params_.graphicsDriver
498 // shadecolor for shaded
499 if (mustProvide("framed") && mustProvide("color")) {
500 RGBColor c = RGBColor(lcolor.getX11Name(Color::shadedbg));
501 //255.0 to force conversion to double
502 //NOTE As Jürgen Spitzmüller pointed out, an alternative would be
503 //to use the xcolor package instead, and then we can do
504 // \define{shadcolor}{RGB}...
505 //and not do any conversion. We'd then need to require xcolor
506 //in InsetNote::validate().
507 int const stmSize = packages.precision(2);
508 packages << "\\definecolor{shadecolor}{rgb}{"
509 << c.r / 255.0 << ',' << c.g / 255.0 << ',' << c.b / 255.0 << "}\n";
510 packages.precision(stmSize);
513 // lyxskak.sty --- newer chess support based on skak.sty
514 if (mustProvide("chess")) {
515 packages << "\\usepackage[ps,mover]{lyxskak}\n";
519 if ((params_.spacing().getSpace() != Spacing::Single
520 && !params_.spacing().isDefault())
521 || isRequired("setspace")) {
522 packages << "\\usepackage{setspace}\n";
524 switch (params_.spacing().getSpace()) {
525 case Spacing::Default:
526 case Spacing::Single:
527 // we dont use setspace.sty so dont print anything
528 //packages += "\\singlespacing\n";
530 case Spacing::Onehalf:
531 packages << "\\onehalfspacing\n";
533 case Spacing::Double:
534 packages << "\\doublespacing\n";
537 packages << "\\setstretch{"
538 << params_.spacing().getValue() << "}\n";
543 if (mustProvide("amssymb")
544 || params_.use_amsmath == BufferParams::package_on)
545 packages << "\\usepackage{amssymb}\n";
547 // esint must be after amsmath and wasysym, since it will redeclare
548 // inconsistent integral symbols
549 if ((mustProvide("esint") || mustProvide("esintoramsmath")) &&
550 params_.use_esint != BufferParams::package_off)
551 packages << "\\usepackage{esint}\n";
554 if (mustProvide("natbib")) {
555 packages << "\\usepackage[";
556 if (params_.getEngine() == biblio::ENGINE_NATBIB_NUMERICAL) {
557 packages << "numbers";
559 packages << "authoryear";
561 packages << "]{natbib}\n";
564 // jurabib -- we need version 0.6 at least.
565 if (mustProvide("jurabib")) {
566 packages << "\\usepackage{jurabib}[2004/01/25]\n";
569 // bibtopic -- the dot provides the aux file naming which
571 if (mustProvide("bibtopic")) {
572 packages << "\\usepackage[dot]{bibtopic}\n";
575 if (mustProvide("xy"))
576 packages << "\\usepackage[all]{xy}\n";
578 if (mustProvide("nomencl")) {
579 // Make it work with the new and old version of the package,
580 // but don't use the compatibility option since it is
581 // incompatible to other packages.
582 packages << "\\usepackage{nomencl}\n"
583 "% the following is useful when we have the old nomencl.sty package\n"
584 "\\providecommand{\\printnomenclature}{\\printglossary}\n"
585 "\\providecommand{\\makenomenclature}{\\makeglossary}\n"
586 "\\makenomenclature\n";
589 if (mustProvide("listings"))
590 packages << "\\usepackage{listings}\n";
592 return packages.str();
596 string const LaTeXFeatures::getMacros() const
598 ostringstream macros;
600 if (!preamble_snippets_.empty())
602 FeaturesList::const_iterator pit = preamble_snippets_.begin();
603 FeaturesList::const_iterator pend = preamble_snippets_.end();
604 for (; pit != pend; ++pit) {
605 macros << *pit << '\n';
608 if (mustProvide("LyX"))
609 macros << lyx_def << '\n';
611 if (mustProvide("lyxline"))
612 macros << lyxline_def << '\n';
614 if (mustProvide("noun"))
615 macros << noun_def << '\n';
617 if (mustProvide("lyxarrow"))
618 macros << lyxarrow_def << '\n';
621 if (mustProvide("quotesinglbase"))
622 macros << quotesinglbase_def << '\n';
623 if (mustProvide("quotedblbase"))
624 macros << quotedblbase_def << '\n';
625 if (mustProvide("guilsinglleft"))
626 macros << guilsinglleft_def << '\n';
627 if (mustProvide("guilsinglright"))
628 macros << guilsinglright_def << '\n';
629 if (mustProvide("guillemotleft"))
630 macros << guillemotleft_def << '\n';
631 if (mustProvide("guillemotright"))
632 macros << guillemotright_def << '\n';
635 if (mustProvide("boldsymbol") && !isRequired("amsmath"))
636 macros << boldsymbol_def << '\n';
637 if (mustProvide("binom") && !isRequired("amsmath"))
638 macros << binom_def << '\n';
639 if (mustProvide("mathcircumflex"))
640 macros << mathcircumflex_def << '\n';
643 if (mustProvide("ParagraphLeftIndent"))
644 macros << paragraphleftindent_def;
645 if (mustProvide("NeedLyXFootnoteCode"))
646 macros << floatingfootnote_def;
648 // some problems with tex->html converters
649 if (mustProvide("NeedTabularnewline"))
650 macros << tabularnewline_def;
652 // greyedout environment (note inset)
653 if (mustProvide("lyxgreyedout"))
654 macros << lyxgreyedout_def;
656 if (mustProvide("lyxdot"))
657 macros << lyxdot_def << '\n';
660 getFloatDefinitions(macros);
663 if (mustProvide("ct-dvipost")) {
664 macros << changetracking_dvipost_def;
666 if (mustProvide("ct-xcolor-soul")) {
667 int const prec = macros.precision(2);
669 RGBColor cadd = RGBColor(lcolor.getX11Name(Color::addedtext));
670 macros << "\\providecolor{lyxadded}{rgb}{"
671 << cadd.r / 255.0 << ',' << cadd.g / 255.0 << ',' << cadd.b / 255.0 << "}\n";
673 RGBColor cdel = RGBColor(lcolor.getX11Name(Color::deletedtext));
674 macros << "\\providecolor{lyxdeleted}{rgb}{"
675 << cdel.r / 255.0 << ',' << cdel.g / 255.0 << ',' << cdel.b / 255.0 << "}\n";
677 macros.precision(prec);
679 macros << "\\newcommand{\\lyxadded}[3]{{\\color{lyxadded}#3}}\n"
680 << "\\newcommand{\\lyxdeleted}[3]{{\\color{lyxdeleted}\\st{#3}}}\n";
682 if (mustProvide("ct-none")) {
683 macros << changetracking_none_def;
690 string const LaTeXFeatures::getBabelOptions() const
694 LanguageList::const_iterator it = UsedLanguages_.begin();
695 LanguageList::const_iterator end = UsedLanguages_.end();
696 for (; it != end; ++it)
697 if (!(*it)->latex_options().empty())
698 tmp << (*it)->latex_options() << '\n';
699 if (!params_.language->latex_options().empty())
700 tmp << params_.language->latex_options() << '\n';
706 docstring const LaTeXFeatures::getTClassPreamble() const
708 // the text class specific preamble
709 TextClass const & tclass = params_.getTextClass();
710 odocstringstream tcpreamble;
712 tcpreamble << tclass.preamble();
714 list<docstring>::const_iterator cit = usedLayouts_.begin();
715 list<docstring>::const_iterator end = usedLayouts_.end();
716 for (; cit != end; ++cit) {
717 tcpreamble << tclass[*cit]->preamble();
720 InsetLayouts const & insetlayouts = tclass.insetlayouts();
721 InsetLayouts::const_iterator cit2 = insetlayouts.begin();
722 InsetLayouts::const_iterator end2 = insetlayouts.end();
723 for (; cit2 != end2; ++cit2) {
724 if (isRequired(to_utf8(cit2->first))) {
725 tcpreamble << from_utf8(cit2->second.preamble);
729 return tcpreamble.str();
733 docstring const LaTeXFeatures::getLyXSGMLEntities() const
735 // Definition of entities used in the document that are LyX related.
736 odocstringstream entities;
738 if (mustProvide("lyxarrow")) {
739 entities << "<!ENTITY lyxarrow \"->\">" << '\n';
742 return entities.str();
746 docstring const LaTeXFeatures::getIncludedFiles(string const & fname) const
748 odocstringstream sgmlpreamble;
750 docstring const basename(from_utf8(onlyPath(fname)));
752 FileMap::const_iterator end = IncludedFiles_.end();
753 for (FileMap::const_iterator fi = IncludedFiles_.begin();
756 sgmlpreamble << "\n<!ENTITY " << fi->first
757 << (isSGMLFilename(fi->second) ? " SYSTEM \"" : " \"")
758 << makeRelPath(from_utf8(fi->second), basename) << "\">";
760 return sgmlpreamble.str();
764 void LaTeXFeatures::showStruct() const {
765 lyxerr << "LyX needs the following commands when LaTeXing:"
766 << "\n***** Packages:" << getPackages()
767 << "\n***** Macros:" << getMacros()
768 << "\n***** Textclass stuff:" << to_utf8(getTClassPreamble())
769 << "\n***** done." << endl;
773 Buffer const & LaTeXFeatures::buffer() const
779 void LaTeXFeatures::setBuffer(Buffer const & buffer)
785 BufferParams const & LaTeXFeatures::bufferParams() const
791 void LaTeXFeatures::getFloatDefinitions(ostream & os) const
793 FloatList const & floats = params_.getTextClass().floats();
795 // Here we will output the code to create the needed float styles.
796 // We will try to do this as minimal as possible.
797 // \floatstyle{ruled}
798 // \newfloat{algorithm}{htbp}{loa}
799 // \floatname{algorithm}{Algorithm}
800 UsedFloats::const_iterator cit = usedFloats_.begin();
801 UsedFloats::const_iterator end = usedFloats_.end();
802 // ostringstream floats;
803 for (; cit != end; ++cit) {
804 Floating const & fl = floats.getType((*cit));
806 // For builtin floats we do nothing.
807 if (fl.builtin()) continue;
809 // We have to special case "table" and "figure"
810 if (fl.type() == "tabular" || fl.type() == "figure") {
811 // Output code to modify "table" or "figure"
812 // but only if builtin == false
813 // and that have to be true at this point in the
815 string const type = fl.type();
816 string const placement = fl.placement();
817 string const style = fl.style();
818 if (!style.empty()) {
819 os << "\\floatstyle{" << style << "}\n"
820 << "\\restylefloat{" << type << "}\n";
822 if (!placement.empty()) {
823 os << "\\floatplacement{" << type << "}{"
824 << placement << "}\n";
827 // The other non builtin floats.
829 string const type = fl.type();
830 string const placement = fl.placement();
831 string const ext = fl.ext();
832 string const within = fl.within();
833 string const style = fl.style();
834 string const name = fl.name();
835 os << "\\floatstyle{" << style << "}\n"
836 << "\\newfloat{" << type << "}{" << placement
837 << "}{" << ext << '}';
839 os << '[' << within << ']';
841 << "\\floatname{" << type << "}{"
844 // What missing here is to code to minimalize the code
845 // output so that the same floatstyle will not be
846 // used several times, when the same style is still in