3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
12 * Full author contact details are available in file CREDITS.
17 #include "TextClass.h"
21 #include "support/debug.h"
22 #include "support/gettext.h"
24 #include "FloatList.h"
29 #include "frontends/alert.h"
31 #include "support/ExceptionMessage.h"
32 #include "support/lstrings.h"
33 #include "support/FileName.h"
34 #include "support/filetools.h"
35 #include "support/os.h"
41 using namespace lyx::support;
47 class LayoutNamesEqual : public unary_function<LayoutPtr, bool> {
49 LayoutNamesEqual(docstring const & name)
52 bool operator()(LayoutPtr const & c) const
54 return c->name() == name_;
64 bool layout2layout(FileName const & filename, FileName const & tempfile)
66 FileName const script = libFileSearch("scripts", "layout2layout.py");
68 lyxerr << "Could not find layout conversion "
69 "script layout2layout.py." << endl;
73 ostringstream command;
74 command << os::python() << ' ' << quoteName(script.toFilesystemEncoding())
75 << ' ' << quoteName(filename.toFilesystemEncoding())
76 << ' ' << quoteName(tempfile.toFilesystemEncoding());
77 string const command_str = command.str();
79 LYXERR(Debug::TCLASS, "Running `" << command_str << '\'');
82 runCommand(command_str);
84 lyxerr << "Could not run layout conversion "
85 "script layout2layout.py." << endl;
92 std::string translateRT(TextClass::ReadType rt)
95 case TextClass::BASECLASS:
97 case TextClass::MERGE:
99 case TextClass::MODULE:
100 return "module file";
109 TextClass::TextClass(string const & fn, string const & cln,
110 string const & desc, bool texClassAvail )
111 : name_(fn), latexname_(cln), description_(desc),
112 floatlist_(new FloatList), counters_(new Counters),
113 texClassAvail_(texClassAvail)
121 pagestyle_ = "default";
122 defaultfont_ = sane_font;
123 opt_fontsize_ = "10|11|12";
124 opt_pagestyle_ = "empty|plain|headings|fancy";
125 titletype_ = TITLE_COMMAND_AFTER;
126 titlename_ = "maketitle";
128 // a hack to make this available for translation
129 // i'm sure there must be a better way (rgh)
134 docstring const TextClass::emptylayout_ = from_ascii("PlainLayout");
137 bool TextClass::isTeXClassAvailable() const
139 return texClassAvail_;
143 bool TextClass::readStyle(Lexer & lexrc, Layout & lay)
145 LYXERR(Debug::TCLASS, "Reading style " << to_utf8(lay.name()));
146 if (!lay.read(lexrc, *this)) {
147 lyxerr << "Error parsing style `" << to_utf8(lay.name()) << '\'' << endl;
151 lay.resfont = lay.font;
152 lay.resfont.realize(defaultfont());
153 lay.reslabelfont = lay.labelfont;
154 lay.reslabelfont.realize(defaultfont());
155 return true; // no errors
188 // Reads a textclass structure from file.
189 bool TextClass::read(FileName const & filename, ReadType rt)
191 if (!filename.isReadableFile()) {
192 lyxerr << "Cannot read layout file `" << filename << "'."
197 keyword_item textClassTags[] = {
198 { "classoptions", TC_CLASSOPTIONS },
199 { "columns", TC_COLUMNS },
200 { "counter", TC_COUNTER },
201 { "defaultfont", TC_DEFAULTFONT },
202 { "defaultstyle", TC_DEFAULTSTYLE },
203 { "environment", TC_ENVIRONMENT },
204 { "float", TC_FLOAT },
205 { "format", TC_FORMAT },
206 { "input", TC_INPUT },
207 { "insetlayout", TC_INSETLAYOUT },
208 { "leftmargin", TC_LEFTMARGIN },
209 { "nofloat", TC_NOFLOAT },
210 { "nostyle", TC_NOSTYLE },
211 { "outputtype", TC_OUTPUTTYPE },
212 { "pagestyle", TC_PAGESTYLE },
213 { "preamble", TC_PREAMBLE },
214 { "provides", TC_PROVIDES },
215 { "requires", TC_REQUIRES },
216 { "rightmargin", TC_RIGHTMARGIN },
217 { "secnumdepth", TC_SECNUMDEPTH },
218 { "sides", TC_SIDES },
219 { "style", TC_STYLE },
220 { "titlelatexname", TC_TITLELATEXNAME },
221 { "titlelatextype", TC_TITLELATEXTYPE },
222 { "tocdepth", TC_TOCDEPTH }
225 LYXERR(Debug::TCLASS, "Reading " + translateRT(rt) + ": " +
226 to_utf8(makeDisplayPath(filename.absFilename())));
228 // Define the `empty' layout used in table cells, ert, etc. Note that
229 // we do this before loading any layout file, so that classes can
230 // override features of this layout if they should choose to do so.
231 if (rt == BASECLASS) {
232 static char const * s = "Margin Static\n"
233 "LatexType Paragraph\n"
236 "AlignPossible Left, Right, Center\n"
237 "LabelType No_Label\n"
240 Lexer lex(textClassTags, sizeof(textClassTags) / sizeof(textClassTags[0]));
243 lay.setName(emptylayout_);
244 if (!readStyle(lex, lay)) {
245 // The only way this happens is because the hardcoded layout above
249 layoutlist_.push_back(boost::shared_ptr<Layout>(new Layout(lay)));
252 Lexer lexrc(textClassTags,
253 sizeof(textClassTags) / sizeof(textClassTags[0]));
255 lexrc.setFile(filename);
256 bool error = !lexrc.isOK();
258 // Format of files before the 'Format' tag was introduced
262 while (lexrc.isOK() && !error) {
263 int le = lexrc.lex();
266 case Lexer::LEX_FEOF:
269 case Lexer::LEX_UNDEF:
270 lexrc.printError("Unknown TextClass tag `$$Token'");
278 switch (static_cast<TextClassTags>(le)) {
282 format = lexrc.getInteger();
285 case TC_OUTPUTTYPE: // output type definition
286 readOutputType(lexrc);
289 case TC_INPUT: // Include file
291 string const inc = lexrc.getString();
292 FileName tmp = libFileSearch("layouts", inc,
296 lexrc.printError("Could not find input file: " + inc);
298 } else if (!read(tmp, MERGE)) {
299 lexrc.printError("Error reading input"
300 "file: " + tmp.absFilename());
306 case TC_DEFAULTSTYLE:
308 docstring const name = from_utf8(subst(lexrc.getString(),
310 defaultlayout_ = name;
317 docstring const name = from_utf8(subst(lexrc.getString(),
320 string s = "Could not read name for style: `$$Token' "
321 + lexrc.getString() + " is probably not valid UTF-8!";
322 lexrc.printError(s.c_str());
324 //FIXME If we're just dropping this layout, do we really
325 //care whether there's an error?? Or should we just set
326 //error to true, since we couldn't even read the name?
327 error = !readStyle(lexrc, lay);
328 } else if (hasLayout(name)) {
329 Layout * lay = operator[](name).get();
330 error = !readStyle(lexrc, *lay);
334 if (le == TC_ENVIRONMENT)
335 lay.is_environment = true;
336 error = !readStyle(lexrc, lay);
338 layoutlist_.push_back(boost::shared_ptr<Layout>(new Layout(lay)));
340 if (defaultlayout_.empty()) {
341 // We do not have a default layout yet, so we choose
342 // the first layout we encounter.
343 defaultlayout_ = name;
348 //FIXME Should we also eat the style here? viz:
350 //readStyle(lexrc, lay);
352 lexrc.printError("No name given for style: `$$Token'.");
359 docstring const style = from_utf8(subst(lexrc.getString(),
361 if (!deleteLayout(style))
362 lyxerr << "Cannot delete style `"
363 << to_utf8(style) << '\'' << endl;
369 columns_ = lexrc.getInteger();
374 switch (lexrc.getInteger()) {
375 case 1: sides_ = OneSide; break;
376 case 2: sides_ = TwoSides; break;
378 lyxerr << "Impossible number of page"
379 " sides, setting to one."
389 pagestyle_ = rtrim(lexrc.getString());
393 defaultfont_ = lyxRead(lexrc);
394 if (!defaultfont_.resolved()) {
395 lexrc.printError("Warning: defaultfont should "
396 "be fully instantiated!");
397 defaultfont_.realize(sane_font);
403 secnumdepth_ = lexrc.getInteger();
408 tocdepth_ = lexrc.getInteger();
411 // First step to support options
412 case TC_CLASSOPTIONS:
413 readClassOptions(lexrc);
417 preamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
422 string const feature = lexrc.getString();
424 if (lexrc.getInteger())
425 provides_.insert(feature);
427 provides_.erase(feature);
433 vector<string> const req
434 = getVectorFromString(lexrc.getString());
435 requires_.insert(req.begin(), req.end());
439 case TC_LEFTMARGIN: // left margin type
441 leftmargin_ = lexrc.getDocString();
444 case TC_RIGHTMARGIN: // right margin type
446 rightmargin_ = lexrc.getDocString();
451 docstring const name = subst(lexrc.getDocString(), '_', ' ');
452 readInsetLayout(lexrc, name);
464 case TC_TITLELATEXTYPE:
465 readTitleType(lexrc);
468 case TC_TITLELATEXNAME:
470 titlename_ = lexrc.getString();
475 string const nofloat = lexrc.getString();
476 floatlist_->erase(nofloat);
481 //Note that this is triggered the first time through the loop unless
482 //we hit a format tag.
483 if (format != FORMAT)
487 if (format != FORMAT) {
488 LYXERR(Debug::TCLASS, "Converting layout file from format "
489 << format << " to " << FORMAT);
490 FileName const tempfile = FileName::tempName();
491 error = !layout2layout(filename, tempfile);
493 error = read(tempfile, rt);
494 tempfile.removeFile();
498 LYXERR(Debug::TCLASS, "Finished reading " + translateRT(rt) + ": " +
499 to_utf8(makeDisplayPath(filename.absFilename())));
504 if (defaultlayout_.empty()) {
505 lyxerr << "Error: Textclass '" << name_
506 << "' is missing a defaultstyle." << endl;
510 //Try to erase "stdinsets" from the provides_ set.
512 // Provides stdinsets 1
513 //declaration simply tells us that the standard insets have been
514 //defined. (It's found in stdinsets.inc but could also be used in
515 //user-defined files.) There isn't really any such package. So we
516 //might as well go ahead and erase it.
517 //If we do not succeed, then it was not there, which means that
518 //the textclass did not provide the definitions of the standard
519 //insets. So we need to try to load them.
520 int erased = provides_.erase("stdinsets");
522 FileName tmp = libFileSearch("layouts", "stdinsets.inc");
525 throw ExceptionMessage(WarningException, _("Missing File"),
526 _("Could not find stdinsets.inc! This may lead to data loss!"));
528 } else if (!read(tmp, MERGE)) {
529 throw ExceptionMessage(WarningException, _("Corrupt File"),
530 _("Could not read stdinsets.inc! This may lead to data loss!"));
535 min_toclevel_ = Layout::NOT_IN_TOC;
536 max_toclevel_ = Layout::NOT_IN_TOC;
537 const_iterator cit = begin();
538 const_iterator the_end = end();
539 for ( ; cit != the_end ; ++cit) {
540 int const toclevel = (*cit)->toclevel;
541 if (toclevel != Layout::NOT_IN_TOC) {
542 if (min_toclevel_ == Layout::NOT_IN_TOC)
543 min_toclevel_ = toclevel;
545 min_toclevel_ = min(min_toclevel_,
547 max_toclevel_ = max(max_toclevel_,
551 LYXERR(Debug::TCLASS, "Minimum TocLevel is " << min_toclevel_
552 << ", maximum is " << max_toclevel_);
558 void TextClass::readTitleType(Lexer & lexrc)
560 keyword_item titleTypeTags[] = {
561 { "commandafter", TITLE_COMMAND_AFTER },
562 { "environment", TITLE_ENVIRONMENT }
565 PushPopHelper pph(lexrc, titleTypeTags, TITLE_ENVIRONMENT);
567 int le = lexrc.lex();
569 case Lexer::LEX_UNDEF:
570 lexrc.printError("Unknown output type `$$Token'");
572 case TITLE_COMMAND_AFTER:
573 case TITLE_ENVIRONMENT:
574 titletype_ = static_cast<TitleLatexType>(le);
577 lyxerr << "Unhandled value " << le
578 << " in TextClass::readTitleType." << endl;
585 void TextClass::readOutputType(Lexer & lexrc)
587 keyword_item outputTypeTags[] = {
588 { "docbook", DOCBOOK },
590 { "literate", LITERATE }
593 PushPopHelper pph(lexrc, outputTypeTags, LITERATE);
595 int le = lexrc.lex();
597 case Lexer::LEX_UNDEF:
598 lexrc.printError("Unknown output type `$$Token'");
603 outputType_ = static_cast<OutputType>(le);
606 lyxerr << "Unhandled value " << le
607 << " in TextClass::readOutputType." << endl;
614 enum ClassOptionsTags {
623 void TextClass::readClassOptions(Lexer & lexrc)
625 keyword_item classOptionsTags[] = {
627 {"fontsize", CO_FONTSIZE },
628 {"header", CO_HEADER },
629 {"other", CO_OTHER },
630 {"pagestyle", CO_PAGESTYLE }
633 lexrc.pushTable(classOptionsTags, CO_END);
635 while (!getout && lexrc.isOK()) {
636 int le = lexrc.lex();
638 case Lexer::LEX_UNDEF:
639 lexrc.printError("Unknown ClassOption tag `$$Token'");
643 switch (static_cast<ClassOptionsTags>(le)) {
646 opt_fontsize_ = rtrim(lexrc.getString());
650 opt_pagestyle_ = rtrim(lexrc.getString());
654 options_ = lexrc.getString();
658 class_header_ = subst(lexrc.getString(), """, "\"");
669 enum InsetLayoutTags {
691 void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
693 keyword_item elementTags[] = {
694 { "bgcolor", IL_BGCOLOR },
695 { "decoration", IL_DECORATION },
698 { "forceltr", IL_FORCELTR },
699 { "freespacing", IL_FREESPACING },
700 { "keepempty", IL_KEEPEMPTY },
701 { "labelfont", IL_LABELFONT },
702 { "labelstring", IL_LABELSTRING },
703 { "latexname", IL_LATEXNAME },
704 { "latexparam", IL_LATEXPARAM },
705 { "latextype", IL_LATEXTYPE },
706 { "lyxtype", IL_LYXTYPE },
707 { "multipar", IL_MULTIPAR },
708 { "needprotect", IL_NEEDPROTECT },
709 { "passthru", IL_PASSTHRU },
710 { "preamble", IL_PREAMBLE },
711 { "requires", IL_REQUIRES }
714 lexrc.pushTable(elementTags, IL_END);
717 docstring labelstring;
722 FontInfo font = inherit_font;
723 FontInfo labelfont = inherit_font;
724 ColorCode bgcolor(Color_background);
726 set<string> requires;
727 bool multipar = false;
728 bool passthru = false;
729 bool needprotect = false;
730 bool keepempty = false;
731 bool freespacing = false;
732 bool forceltr = false;
735 while (!getout && lexrc.isOK()) {
736 int le = lexrc.lex();
738 case Lexer::LEX_UNDEF:
739 lexrc.printError("Unknown InsetLayout tag `$$Token'");
743 switch (static_cast<InsetLayoutTags>(le)) {
746 lyxtype = lexrc.getString();
750 latextype = lexrc.getString();
754 labelstring = lexrc.getDocString();
758 decoration = lexrc.getString();
762 latexname = lexrc.getString();
766 latexparam = subst(lexrc.getString(), """, "\"");
769 labelfont = lyxRead(lexrc, inherit_font);
773 forceltr = lexrc.getBool();
777 multipar = lexrc.getBool();
781 passthru = lexrc.getBool();
785 keepempty = lexrc.getBool();
789 freespacing = lexrc.getBool();
793 needprotect = lexrc.getBool();
796 font = lyxRead(lexrc, inherit_font);
797 // So: define font before labelfont
802 string const token = lexrc.getString();
803 bgcolor = lcolor.getFromLyXName(token);
807 preamble = lexrc.getLongString("EndPreamble");
811 vector<string> const req
812 = getVectorFromString(lexrc.getString());
813 requires.insert(req.begin(), req.end());
822 // Here add element to list if getout == true
825 il.name = to_ascii(name);
826 il.lyxtype = lyxtype;
827 il.labelstring = labelstring;
828 il.decoration = decoration;
829 il.latextype = latextype;
830 il.latexname = latexname;
831 il.latexparam = latexparam;
832 il.multipar = multipar;
833 il.passthru = passthru;
834 il.needprotect = needprotect;
835 il.freespacing = freespacing;
836 il.forceltr = forceltr;
837 il.keepempty = keepempty;
839 // The label font is generally used as-is without
840 // any realization against a given context.
841 labelfont.realize(sane_font);
842 il.labelfont = labelfont;
843 il.bgcolor = bgcolor;
844 il.preamble = preamble;
845 il.requires = requires;
846 insetlayoutlist_[name] = il;
867 void TextClass::readFloat(Lexer & lexrc)
869 keyword_item floatTags[] = {
871 { "extension", FT_EXT },
872 { "guiname", FT_NAME },
873 { "latexbuiltin", FT_BUILTIN },
874 { "listname", FT_LISTNAME },
875 { "numberwithin", FT_WITHIN },
876 { "placement", FT_PLACEMENT },
877 { "style", FT_STYLE },
881 lexrc.pushTable(floatTags, FT_END);
890 bool builtin = false;
893 while (!getout && lexrc.isOK()) {
894 int le = lexrc.lex();
896 case Lexer::LEX_UNDEF:
897 lexrc.printError("Unknown float tag `$$Token'");
901 switch (static_cast<FloatTags>(le)) {
904 type = lexrc.getString();
905 if (floatlist_->typeExist(type)) {
906 Floating const & fl = floatlist_->getType(type);
907 placement = fl.placement();
909 within = fl.within();
912 listName = fl.listName();
913 builtin = fl.builtin();
918 name = lexrc.getString();
922 placement = lexrc.getString();
926 ext = lexrc.getString();
930 within = lexrc.getString();
931 if (within == "none")
936 style = lexrc.getString();
940 listName = lexrc.getString();
944 builtin = lexrc.getBool();
952 // Here if have a full float if getout == true
954 Floating fl(type, placement, ext, within,
955 style, name, listName, builtin);
956 floatlist_->newFloat(fl);
957 // each float has its own counter
958 counters_->newCounter(from_ascii(type), from_ascii(within),
959 docstring(), docstring());
970 CT_LABELSTRING_APPENDIX,
975 void TextClass::readCounter(Lexer & lexrc)
977 keyword_item counterTags[] = {
979 { "labelstring", CT_LABELSTRING },
980 { "labelstringappendix", CT_LABELSTRING_APPENDIX },
982 { "within", CT_WITHIN }
985 lexrc.pushTable(counterTags, CT_END);
989 docstring labelstring;
990 docstring labelstring_appendix;
993 while (!getout && lexrc.isOK()) {
994 int le = lexrc.lex();
996 case Lexer::LEX_UNDEF:
997 lexrc.printError("Unknown counter tag `$$Token'");
1001 switch (static_cast<CounterTags>(le)) {
1004 name = lexrc.getDocString();
1005 if (counters_->hasCounter(name))
1006 LYXERR(Debug::TCLASS, "Reading existing counter " << to_utf8(name));
1008 LYXERR(Debug::TCLASS, "Reading new counter " << to_utf8(name));
1012 within = lexrc.getDocString();
1013 if (within == "none")
1016 case CT_LABELSTRING:
1018 labelstring = lexrc.getDocString();
1019 labelstring_appendix = labelstring;
1021 case CT_LABELSTRING_APPENDIX:
1023 labelstring_appendix = lexrc.getDocString();
1031 // Here if have a full counter if getout == true
1033 counters_->newCounter(name, within,
1034 labelstring, labelstring_appendix);
1040 FontInfo const & TextClass::defaultfont() const
1042 return defaultfont_;
1046 docstring const & TextClass::leftmargin() const
1052 docstring const & TextClass::rightmargin() const
1054 return rightmargin_;
1058 bool TextClass::hasLayout(docstring const & n) const
1060 docstring const name = n.empty() ? defaultLayoutName() : n;
1062 return find_if(layoutlist_.begin(), layoutlist_.end(),
1063 LayoutNamesEqual(name))
1064 != layoutlist_.end();
1069 LayoutPtr const & TextClass::operator[](docstring const & name) const
1071 BOOST_ASSERT(!name.empty());
1073 LayoutList::const_iterator cit =
1074 find_if(layoutlist_.begin(),
1076 LayoutNamesEqual(name));
1078 if (cit == layoutlist_.end()) {
1079 lyxerr << "We failed to find the layout '" << to_utf8(name)
1080 << "' in the layout list. You MUST investigate!"
1082 for (LayoutList::const_iterator it = layoutlist_.begin();
1083 it != layoutlist_.end(); ++it)
1084 lyxerr << " " << to_utf8(it->get()->name()) << endl;
1086 // we require the name to exist
1087 BOOST_ASSERT(false);
1094 bool TextClass::deleteLayout(docstring const & name)
1096 if (name == defaultLayoutName() || name == emptyLayoutName())
1099 LayoutList::iterator it =
1100 remove_if(layoutlist_.begin(), layoutlist_.end(),
1101 LayoutNamesEqual(name));
1103 LayoutList::iterator end = layoutlist_.end();
1104 bool const ret = (it != end);
1105 layoutlist_.erase(it, end);
1110 // Load textclass info if not loaded yet
1111 bool TextClass::load(string const & path) const
1116 // Read style-file, provided path is searched before the system ones
1117 FileName layout_file;
1119 layout_file = FileName(addName(path, name_ + ".layout"));
1120 if (layout_file.empty() || !layout_file.exists())
1121 layout_file = libFileSearch("layouts", name_, "layout");
1122 loaded_ = const_cast<TextClass*>(this)->read(layout_file);
1125 lyxerr << "Error reading `"
1126 << to_utf8(makeDisplayPath(layout_file.absFilename()))
1127 << "'\n(Check `" << name_
1128 << "')\nCheck your installation and "
1129 "try Options/Reconfigure..." << endl;
1136 FloatList & TextClass::floats()
1138 return *floatlist_.get();
1142 FloatList const & TextClass::floats() const
1144 return *floatlist_.get();
1148 Counters & TextClass::counters() const
1150 return *counters_.get();
1154 // Return the layout object of an inset given by name. If the name
1155 // is not found as such, the part after the ':' is stripped off, and
1156 // searched again. In this way, an error fallback can be provided:
1157 // An erroneous 'CharStyle:badname' (e.g., after a documentclass switch)
1158 // will invoke the layout object defined by name = 'CharStyle'.
1159 // If that doesn't work either, an empty object returns (shouldn't
1160 // happen). -- Idea JMarc, comment MV
1161 InsetLayout const & TextClass::insetlayout(docstring const & name) const
1164 while (!n.empty()) {
1165 if (insetlayoutlist_.count(n) > 0)
1166 return insetlayoutlist_[n];
1167 docstring::size_type i = n.find(':');
1168 if (i == string::npos)
1172 static InsetLayout empty;
1173 empty.labelstring = from_utf8("UNDEFINED");
1174 empty.labelfont = sane_font;
1175 empty.labelfont.setColor(Color_error);
1176 empty.bgcolor = Color_error;
1181 docstring const & TextClass::defaultLayoutName() const
1183 // This really should come from the actual layout... (Lgb)
1184 return defaultlayout_;
1188 LayoutPtr const & TextClass::defaultLayout() const
1190 return operator[](defaultLayoutName());
1194 string const & TextClass::name() const
1200 string const & TextClass::latexname() const
1202 const_cast<TextClass*>(this)->load();
1207 string const & TextClass::description() const
1209 return description_;
1213 string const & TextClass::opt_fontsize() const
1215 return opt_fontsize_;
1219 string const & TextClass::opt_pagestyle() const
1221 return opt_pagestyle_;
1225 string const & TextClass::options() const
1231 string const & TextClass::class_header() const
1233 return class_header_;
1237 string const & TextClass::pagestyle() const
1243 docstring const & TextClass::preamble() const
1249 PageSides TextClass::sides() const
1255 int TextClass::secnumdepth() const
1257 return secnumdepth_;
1261 int TextClass::tocdepth() const
1267 OutputType TextClass::outputType() const
1273 bool TextClass::provides(string const & p) const
1275 return provides_.find(p) != provides_.end();
1279 unsigned int TextClass::columns() const
1285 TitleLatexType TextClass::titletype() const
1291 string const & TextClass::titlename() const
1297 int TextClass::size() const
1299 return layoutlist_.size();
1303 int TextClass::min_toclevel() const
1305 return min_toclevel_;
1309 int TextClass::max_toclevel() const
1311 return max_toclevel_;
1315 bool TextClass::hasTocLevels() const
1317 return min_toclevel_ != Layout::NOT_IN_TOC;
1321 ostream & operator<<(ostream & os, PageSides p)