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"
22 #include "FloatList.h"
27 #include "frontends/alert.h"
29 #include "support/debug.h"
30 #include "support/ExceptionMessage.h"
31 #include "support/FileName.h"
32 #include "support/filetools.h"
33 #include "support/gettext.h"
34 #include "support/lstrings.h"
35 #include "support/os.h"
40 using namespace lyx::support;
46 class LayoutNamesEqual : public unary_function<LayoutPtr, bool> {
48 LayoutNamesEqual(docstring const & name)
51 bool operator()(LayoutPtr const & c) const
53 return c->name() == name_;
63 bool layout2layout(FileName const & filename, FileName const & tempfile)
65 FileName const script = libFileSearch("scripts", "layout2layout.py");
67 lyxerr << "Could not find layout conversion "
68 "script layout2layout.py." << endl;
72 ostringstream command;
73 command << os::python() << ' ' << quoteName(script.toFilesystemEncoding())
74 << ' ' << quoteName(filename.toFilesystemEncoding())
75 << ' ' << quoteName(tempfile.toFilesystemEncoding());
76 string const command_str = command.str();
78 LYXERR(Debug::TCLASS, "Running `" << command_str << '\'');
81 runCommand(command_str);
83 lyxerr << "Could not run layout conversion "
84 "script layout2layout.py." << endl;
91 std::string translateRT(TextClass::ReadType rt)
94 case TextClass::BASECLASS:
96 case TextClass::MERGE:
98 case TextClass::MODULE:
108 TextClass::TextClass(string const & fn, string const & cln,
109 string const & desc, bool texClassAvail )
110 : name_(fn), latexname_(cln), description_(desc),
111 floatlist_(new FloatList), counters_(new Counters),
112 texClassAvail_(texClassAvail)
120 pagestyle_ = "default";
121 defaultfont_ = sane_font;
122 opt_fontsize_ = "10|11|12";
123 opt_pagestyle_ = "empty|plain|headings|fancy";
124 titletype_ = TITLE_COMMAND_AFTER;
125 titlename_ = "maketitle";
127 // a hack to make this available for translation
128 // i'm sure there must be a better way (rgh)
133 docstring const TextClass::emptylayout_ = from_ascii("PlainLayout");
136 bool TextClass::isTeXClassAvailable() const
138 return texClassAvail_;
142 bool TextClass::readStyle(Lexer & lexrc, Layout & lay)
144 LYXERR(Debug::TCLASS, "Reading style " << to_utf8(lay.name()));
145 if (!lay.read(lexrc, *this)) {
146 lyxerr << "Error parsing style `" << to_utf8(lay.name()) << '\'' << endl;
150 lay.resfont = lay.font;
151 lay.resfont.realize(defaultfont());
152 lay.reslabelfont = lay.labelfont;
153 lay.reslabelfont.realize(defaultfont());
154 return true; // no errors
187 // Reads a textclass structure from file.
188 bool TextClass::read(FileName const & filename, ReadType rt)
190 if (!filename.isReadableFile()) {
191 lyxerr << "Cannot read layout file `" << filename << "'."
196 keyword_item textClassTags[] = {
197 { "classoptions", TC_CLASSOPTIONS },
198 { "columns", TC_COLUMNS },
199 { "counter", TC_COUNTER },
200 { "defaultfont", TC_DEFAULTFONT },
201 { "defaultstyle", TC_DEFAULTSTYLE },
202 { "environment", TC_ENVIRONMENT },
203 { "float", TC_FLOAT },
204 { "format", TC_FORMAT },
205 { "input", TC_INPUT },
206 { "insetlayout", TC_INSETLAYOUT },
207 { "leftmargin", TC_LEFTMARGIN },
208 { "nofloat", TC_NOFLOAT },
209 { "nostyle", TC_NOSTYLE },
210 { "outputtype", TC_OUTPUTTYPE },
211 { "pagestyle", TC_PAGESTYLE },
212 { "preamble", TC_PREAMBLE },
213 { "provides", TC_PROVIDES },
214 { "requires", TC_REQUIRES },
215 { "rightmargin", TC_RIGHTMARGIN },
216 { "secnumdepth", TC_SECNUMDEPTH },
217 { "sides", TC_SIDES },
218 { "style", TC_STYLE },
219 { "titlelatexname", TC_TITLELATEXNAME },
220 { "titlelatextype", TC_TITLELATEXTYPE },
221 { "tocdepth", TC_TOCDEPTH }
224 LYXERR(Debug::TCLASS, "Reading " + translateRT(rt) + ": " +
225 to_utf8(makeDisplayPath(filename.absFilename())));
227 // Define the `empty' layout used in table cells, ert, etc. Note that
228 // we do this before loading any layout file, so that classes can
229 // override features of this layout if they should choose to do so.
230 if (rt == BASECLASS) {
231 static char const * s = "Margin Static\n"
232 "LatexType Paragraph\n"
235 "AlignPossible Left, Right, Center\n"
236 "LabelType No_Label\n"
239 Lexer lex(textClassTags, sizeof(textClassTags) / sizeof(textClassTags[0]));
242 lay.setName(emptylayout_);
243 if (!readStyle(lex, lay)) {
244 // The only way this happens is because the hardcoded layout above
248 layoutlist_.push_back(boost::shared_ptr<Layout>(new Layout(lay)));
251 Lexer lexrc(textClassTags,
252 sizeof(textClassTags) / sizeof(textClassTags[0]));
254 lexrc.setFile(filename);
255 bool error = !lexrc.isOK();
257 // Format of files before the 'Format' tag was introduced
261 while (lexrc.isOK() && !error) {
262 int le = lexrc.lex();
265 case Lexer::LEX_FEOF:
268 case Lexer::LEX_UNDEF:
269 lexrc.printError("Unknown TextClass tag `$$Token'");
277 switch (static_cast<TextClassTags>(le)) {
281 format = lexrc.getInteger();
284 case TC_OUTPUTTYPE: // output type definition
285 readOutputType(lexrc);
288 case TC_INPUT: // Include file
290 string const inc = lexrc.getString();
291 FileName tmp = libFileSearch("layouts", inc,
295 lexrc.printError("Could not find input file: " + inc);
297 } else if (!read(tmp, MERGE)) {
298 lexrc.printError("Error reading input"
299 "file: " + tmp.absFilename());
305 case TC_DEFAULTSTYLE:
307 docstring const name = from_utf8(subst(lexrc.getString(),
309 defaultlayout_ = name;
316 docstring const name = from_utf8(subst(lexrc.getString(),
319 string s = "Could not read name for style: `$$Token' "
320 + lexrc.getString() + " is probably not valid UTF-8!";
321 lexrc.printError(s.c_str());
323 //FIXME If we're just dropping this layout, do we really
324 //care whether there's an error?? Or should we just set
325 //error to true, since we couldn't even read the name?
326 error = !readStyle(lexrc, lay);
327 } else if (hasLayout(name)) {
328 Layout * lay = operator[](name).get();
329 error = !readStyle(lexrc, *lay);
333 if (le == TC_ENVIRONMENT)
334 lay.is_environment = true;
335 error = !readStyle(lexrc, lay);
337 layoutlist_.push_back(boost::shared_ptr<Layout>(new Layout(lay)));
339 if (defaultlayout_.empty()) {
340 // We do not have a default layout yet, so we choose
341 // the first layout we encounter.
342 defaultlayout_ = name;
347 //FIXME Should we also eat the style here? viz:
349 //readStyle(lexrc, lay);
351 lexrc.printError("No name given for style: `$$Token'.");
358 docstring const style = from_utf8(subst(lexrc.getString(),
360 if (!deleteLayout(style))
361 lyxerr << "Cannot delete style `"
362 << to_utf8(style) << '\'' << endl;
368 columns_ = lexrc.getInteger();
373 switch (lexrc.getInteger()) {
374 case 1: sides_ = OneSide; break;
375 case 2: sides_ = TwoSides; break;
377 lyxerr << "Impossible number of page"
378 " sides, setting to one."
388 pagestyle_ = rtrim(lexrc.getString());
392 defaultfont_ = lyxRead(lexrc);
393 if (!defaultfont_.resolved()) {
394 lexrc.printError("Warning: defaultfont should "
395 "be fully instantiated!");
396 defaultfont_.realize(sane_font);
402 secnumdepth_ = lexrc.getInteger();
407 tocdepth_ = lexrc.getInteger();
410 // First step to support options
411 case TC_CLASSOPTIONS:
412 readClassOptions(lexrc);
416 preamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
421 string const feature = lexrc.getString();
423 if (lexrc.getInteger())
424 provides_.insert(feature);
426 provides_.erase(feature);
432 vector<string> const req
433 = getVectorFromString(lexrc.getString());
434 requires_.insert(req.begin(), req.end());
438 case TC_LEFTMARGIN: // left margin type
440 leftmargin_ = lexrc.getDocString();
443 case TC_RIGHTMARGIN: // right margin type
445 rightmargin_ = lexrc.getDocString();
450 docstring const name = subst(lexrc.getDocString(), '_', ' ');
451 readInsetLayout(lexrc, name);
463 case TC_TITLELATEXTYPE:
464 readTitleType(lexrc);
467 case TC_TITLELATEXNAME:
469 titlename_ = lexrc.getString();
474 string const nofloat = lexrc.getString();
475 floatlist_->erase(nofloat);
480 //Note that this is triggered the first time through the loop unless
481 //we hit a format tag.
482 if (format != FORMAT)
486 if (format != FORMAT) {
487 LYXERR(Debug::TCLASS, "Converting layout file from format "
488 << format << " to " << FORMAT);
489 FileName const tempfile = FileName::tempName();
490 error = !layout2layout(filename, tempfile);
492 error = read(tempfile, rt);
493 tempfile.removeFile();
497 LYXERR(Debug::TCLASS, "Finished reading " + translateRT(rt) + ": " +
498 to_utf8(makeDisplayPath(filename.absFilename())));
503 if (defaultlayout_.empty()) {
504 lyxerr << "Error: Textclass '" << name_
505 << "' is missing a defaultstyle." << endl;
509 //Try to erase "stdinsets" from the provides_ set.
511 // Provides stdinsets 1
512 //declaration simply tells us that the standard insets have been
513 //defined. (It's found in stdinsets.inc but could also be used in
514 //user-defined files.) There isn't really any such package. So we
515 //might as well go ahead and erase it.
516 //If we do not succeed, then it was not there, which means that
517 //the textclass did not provide the definitions of the standard
518 //insets. So we need to try to load them.
519 int erased = provides_.erase("stdinsets");
521 FileName tmp = libFileSearch("layouts", "stdinsets.inc");
524 throw ExceptionMessage(WarningException, _("Missing File"),
525 _("Could not find stdinsets.inc! This may lead to data loss!"));
527 } else if (!read(tmp, MERGE)) {
528 throw ExceptionMessage(WarningException, _("Corrupt File"),
529 _("Could not read stdinsets.inc! This may lead to data loss!"));
534 min_toclevel_ = Layout::NOT_IN_TOC;
535 max_toclevel_ = Layout::NOT_IN_TOC;
536 const_iterator cit = begin();
537 const_iterator the_end = end();
538 for ( ; cit != the_end ; ++cit) {
539 int const toclevel = (*cit)->toclevel;
540 if (toclevel != Layout::NOT_IN_TOC) {
541 if (min_toclevel_ == Layout::NOT_IN_TOC)
542 min_toclevel_ = toclevel;
544 min_toclevel_ = min(min_toclevel_,
546 max_toclevel_ = max(max_toclevel_,
550 LYXERR(Debug::TCLASS, "Minimum TocLevel is " << min_toclevel_
551 << ", maximum is " << max_toclevel_);
557 void TextClass::readTitleType(Lexer & lexrc)
559 keyword_item titleTypeTags[] = {
560 { "commandafter", TITLE_COMMAND_AFTER },
561 { "environment", TITLE_ENVIRONMENT }
564 PushPopHelper pph(lexrc, titleTypeTags, TITLE_ENVIRONMENT);
566 int le = lexrc.lex();
568 case Lexer::LEX_UNDEF:
569 lexrc.printError("Unknown output type `$$Token'");
571 case TITLE_COMMAND_AFTER:
572 case TITLE_ENVIRONMENT:
573 titletype_ = static_cast<TitleLatexType>(le);
576 lyxerr << "Unhandled value " << le
577 << " in TextClass::readTitleType." << endl;
584 void TextClass::readOutputType(Lexer & lexrc)
586 keyword_item outputTypeTags[] = {
587 { "docbook", DOCBOOK },
589 { "literate", LITERATE }
592 PushPopHelper pph(lexrc, outputTypeTags, LITERATE);
594 int le = lexrc.lex();
596 case Lexer::LEX_UNDEF:
597 lexrc.printError("Unknown output type `$$Token'");
602 outputType_ = static_cast<OutputType>(le);
605 lyxerr << "Unhandled value " << le
606 << " in TextClass::readOutputType." << endl;
613 enum ClassOptionsTags {
622 void TextClass::readClassOptions(Lexer & lexrc)
624 keyword_item classOptionsTags[] = {
626 {"fontsize", CO_FONTSIZE },
627 {"header", CO_HEADER },
628 {"other", CO_OTHER },
629 {"pagestyle", CO_PAGESTYLE }
632 lexrc.pushTable(classOptionsTags, CO_END);
634 while (!getout && lexrc.isOK()) {
635 int le = lexrc.lex();
637 case Lexer::LEX_UNDEF:
638 lexrc.printError("Unknown ClassOption tag `$$Token'");
642 switch (static_cast<ClassOptionsTags>(le)) {
645 opt_fontsize_ = rtrim(lexrc.getString());
649 opt_pagestyle_ = rtrim(lexrc.getString());
653 options_ = lexrc.getString();
657 class_header_ = subst(lexrc.getString(), """, "\"");
668 enum InsetLayoutTags {
690 void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
692 keyword_item elementTags[] = {
693 { "bgcolor", IL_BGCOLOR },
694 { "decoration", IL_DECORATION },
697 { "forceltr", IL_FORCELTR },
698 { "freespacing", IL_FREESPACING },
699 { "keepempty", IL_KEEPEMPTY },
700 { "labelfont", IL_LABELFONT },
701 { "labelstring", IL_LABELSTRING },
702 { "latexname", IL_LATEXNAME },
703 { "latexparam", IL_LATEXPARAM },
704 { "latextype", IL_LATEXTYPE },
705 { "lyxtype", IL_LYXTYPE },
706 { "multipar", IL_MULTIPAR },
707 { "needprotect", IL_NEEDPROTECT },
708 { "passthru", IL_PASSTHRU },
709 { "preamble", IL_PREAMBLE },
710 { "requires", IL_REQUIRES }
713 lexrc.pushTable(elementTags, IL_END);
716 docstring labelstring;
721 FontInfo font = inherit_font;
722 FontInfo labelfont = inherit_font;
723 ColorCode bgcolor(Color_background);
725 set<string> requires;
726 bool multipar = false;
727 bool passthru = false;
728 bool needprotect = false;
729 bool keepempty = false;
730 bool freespacing = false;
731 bool forceltr = false;
734 while (!getout && lexrc.isOK()) {
735 int le = lexrc.lex();
737 case Lexer::LEX_UNDEF:
738 lexrc.printError("Unknown InsetLayout tag `$$Token'");
742 switch (static_cast<InsetLayoutTags>(le)) {
745 lyxtype = lexrc.getString();
749 latextype = lexrc.getString();
753 labelstring = lexrc.getDocString();
757 decoration = lexrc.getString();
761 latexname = lexrc.getString();
765 latexparam = subst(lexrc.getString(), """, "\"");
768 labelfont = lyxRead(lexrc, inherit_font);
772 forceltr = lexrc.getBool();
776 multipar = lexrc.getBool();
780 passthru = lexrc.getBool();
784 keepempty = lexrc.getBool();
788 freespacing = lexrc.getBool();
792 needprotect = lexrc.getBool();
795 font = lyxRead(lexrc, inherit_font);
796 // So: define font before labelfont
801 string const token = lexrc.getString();
802 bgcolor = lcolor.getFromLyXName(token);
806 preamble = lexrc.getLongString("EndPreamble");
810 vector<string> const req
811 = getVectorFromString(lexrc.getString());
812 requires.insert(req.begin(), req.end());
821 // Here add element to list if getout == true
824 il.name = to_ascii(name);
825 il.lyxtype = lyxtype;
826 il.labelstring = labelstring;
827 il.decoration = decoration;
828 il.latextype = latextype;
829 il.latexname = latexname;
830 il.latexparam = latexparam;
831 il.multipar = multipar;
832 il.passthru = passthru;
833 il.needprotect = needprotect;
834 il.freespacing = freespacing;
835 il.forceltr = forceltr;
836 il.keepempty = keepempty;
838 // The label font is generally used as-is without
839 // any realization against a given context.
840 labelfont.realize(sane_font);
841 il.labelfont = labelfont;
842 il.bgcolor = bgcolor;
843 il.preamble = preamble;
844 il.requires = requires;
845 insetlayoutlist_[name] = il;
866 void TextClass::readFloat(Lexer & lexrc)
868 keyword_item floatTags[] = {
870 { "extension", FT_EXT },
871 { "guiname", FT_NAME },
872 { "latexbuiltin", FT_BUILTIN },
873 { "listname", FT_LISTNAME },
874 { "numberwithin", FT_WITHIN },
875 { "placement", FT_PLACEMENT },
876 { "style", FT_STYLE },
880 lexrc.pushTable(floatTags, FT_END);
889 bool builtin = false;
892 while (!getout && lexrc.isOK()) {
893 int le = lexrc.lex();
895 case Lexer::LEX_UNDEF:
896 lexrc.printError("Unknown float tag `$$Token'");
900 switch (static_cast<FloatTags>(le)) {
903 type = lexrc.getString();
904 if (floatlist_->typeExist(type)) {
905 Floating const & fl = floatlist_->getType(type);
906 placement = fl.placement();
908 within = fl.within();
911 listName = fl.listName();
912 builtin = fl.builtin();
917 name = lexrc.getString();
921 placement = lexrc.getString();
925 ext = lexrc.getString();
929 within = lexrc.getString();
930 if (within == "none")
935 style = lexrc.getString();
939 listName = lexrc.getString();
943 builtin = lexrc.getBool();
951 // Here if have a full float if getout == true
953 Floating fl(type, placement, ext, within,
954 style, name, listName, builtin);
955 floatlist_->newFloat(fl);
956 // each float has its own counter
957 counters_->newCounter(from_ascii(type), from_ascii(within),
958 docstring(), docstring());
969 CT_LABELSTRING_APPENDIX,
974 void TextClass::readCounter(Lexer & lexrc)
976 keyword_item counterTags[] = {
978 { "labelstring", CT_LABELSTRING },
979 { "labelstringappendix", CT_LABELSTRING_APPENDIX },
981 { "within", CT_WITHIN }
984 lexrc.pushTable(counterTags, CT_END);
988 docstring labelstring;
989 docstring labelstring_appendix;
992 while (!getout && lexrc.isOK()) {
993 int le = lexrc.lex();
995 case Lexer::LEX_UNDEF:
996 lexrc.printError("Unknown counter tag `$$Token'");
1000 switch (static_cast<CounterTags>(le)) {
1003 name = lexrc.getDocString();
1004 if (counters_->hasCounter(name))
1005 LYXERR(Debug::TCLASS, "Reading existing counter " << to_utf8(name));
1007 LYXERR(Debug::TCLASS, "Reading new counter " << to_utf8(name));
1011 within = lexrc.getDocString();
1012 if (within == "none")
1015 case CT_LABELSTRING:
1017 labelstring = lexrc.getDocString();
1018 labelstring_appendix = labelstring;
1020 case CT_LABELSTRING_APPENDIX:
1022 labelstring_appendix = lexrc.getDocString();
1030 // Here if have a full counter if getout == true
1032 counters_->newCounter(name, within,
1033 labelstring, labelstring_appendix);
1039 FontInfo const & TextClass::defaultfont() const
1041 return defaultfont_;
1045 docstring const & TextClass::leftmargin() const
1051 docstring const & TextClass::rightmargin() const
1053 return rightmargin_;
1057 bool TextClass::hasLayout(docstring const & n) const
1059 docstring const name = n.empty() ? defaultLayoutName() : n;
1061 return find_if(layoutlist_.begin(), layoutlist_.end(),
1062 LayoutNamesEqual(name))
1063 != layoutlist_.end();
1068 LayoutPtr const & TextClass::operator[](docstring const & name) const
1070 BOOST_ASSERT(!name.empty());
1072 LayoutList::const_iterator cit =
1073 find_if(layoutlist_.begin(),
1075 LayoutNamesEqual(name));
1077 if (cit == layoutlist_.end()) {
1078 lyxerr << "We failed to find the layout '" << to_utf8(name)
1079 << "' in the layout list. You MUST investigate!"
1081 for (LayoutList::const_iterator it = layoutlist_.begin();
1082 it != layoutlist_.end(); ++it)
1083 lyxerr << " " << to_utf8(it->get()->name()) << endl;
1085 // we require the name to exist
1086 BOOST_ASSERT(false);
1093 bool TextClass::deleteLayout(docstring const & name)
1095 if (name == defaultLayoutName() || name == emptyLayoutName())
1098 LayoutList::iterator it =
1099 remove_if(layoutlist_.begin(), layoutlist_.end(),
1100 LayoutNamesEqual(name));
1102 LayoutList::iterator end = layoutlist_.end();
1103 bool const ret = (it != end);
1104 layoutlist_.erase(it, end);
1109 // Load textclass info if not loaded yet
1110 bool TextClass::load(string const & path) const
1115 // Read style-file, provided path is searched before the system ones
1116 FileName layout_file;
1118 layout_file = FileName(addName(path, name_ + ".layout"));
1119 if (layout_file.empty() || !layout_file.exists())
1120 layout_file = libFileSearch("layouts", name_, "layout");
1121 loaded_ = const_cast<TextClass*>(this)->read(layout_file);
1124 lyxerr << "Error reading `"
1125 << to_utf8(makeDisplayPath(layout_file.absFilename()))
1126 << "'\n(Check `" << name_
1127 << "')\nCheck your installation and "
1128 "try Options/Reconfigure..." << endl;
1135 FloatList & TextClass::floats()
1137 return *floatlist_.get();
1141 FloatList const & TextClass::floats() const
1143 return *floatlist_.get();
1147 Counters & TextClass::counters() const
1149 return *counters_.get();
1153 // Return the layout object of an inset given by name. If the name
1154 // is not found as such, the part after the ':' is stripped off, and
1155 // searched again. In this way, an error fallback can be provided:
1156 // An erroneous 'CharStyle:badname' (e.g., after a documentclass switch)
1157 // will invoke the layout object defined by name = 'CharStyle'.
1158 // If that doesn't work either, an empty object returns (shouldn't
1159 // happen). -- Idea JMarc, comment MV
1160 InsetLayout const & TextClass::insetlayout(docstring const & name) const
1163 while (!n.empty()) {
1164 if (insetlayoutlist_.count(n) > 0)
1165 return insetlayoutlist_[n];
1166 docstring::size_type i = n.find(':');
1167 if (i == string::npos)
1171 static InsetLayout empty;
1172 empty.labelstring = from_utf8("UNDEFINED");
1173 empty.labelfont = sane_font;
1174 empty.labelfont.setColor(Color_error);
1175 empty.bgcolor = Color_error;
1180 docstring const & TextClass::defaultLayoutName() const
1182 // This really should come from the actual layout... (Lgb)
1183 return defaultlayout_;
1187 LayoutPtr const & TextClass::defaultLayout() const
1189 return operator[](defaultLayoutName());
1193 string const & TextClass::name() const
1199 string const & TextClass::latexname() const
1201 const_cast<TextClass*>(this)->load();
1206 string const & TextClass::description() const
1208 return description_;
1212 string const & TextClass::opt_fontsize() const
1214 return opt_fontsize_;
1218 string const & TextClass::opt_pagestyle() const
1220 return opt_pagestyle_;
1224 string const & TextClass::options() const
1230 string const & TextClass::class_header() const
1232 return class_header_;
1236 string const & TextClass::pagestyle() const
1242 docstring const & TextClass::preamble() const
1248 PageSides TextClass::sides() const
1254 int TextClass::secnumdepth() const
1256 return secnumdepth_;
1260 int TextClass::tocdepth() const
1266 OutputType TextClass::outputType() const
1272 bool TextClass::provides(string const & p) const
1274 return provides_.find(p) != provides_.end();
1278 unsigned int TextClass::columns() const
1284 TitleLatexType TextClass::titletype() const
1290 string const & TextClass::titlename() const
1296 int TextClass::size() const
1298 return layoutlist_.size();
1302 int TextClass::min_toclevel() const
1304 return min_toclevel_;
1308 int TextClass::max_toclevel() const
1310 return max_toclevel_;
1314 bool TextClass::hasTocLevels() const
1316 return min_toclevel_ != Layout::NOT_IN_TOC;
1320 ostream & operator<<(ostream & os, PageSides p)