Format 19
+# CSS for the TOC
+AddToHTMLPreamble
+<style type="text/css">
+ div.toc {
+ margin: 2em 0em;
+ border-style: solid;
+ border-width: 2px 0px;
+ padding: 1em 0em;
+ }
+ div.tochead { font-size: x-large; font-weight: bold; }
+ div.lyxtoc-1 {
+ margin: 1em 0em 0em 0em;
+ font-size: x-large;
+ font-weight: bold;
+ }
+ div.lyxtoc-2 {
+ margin: 0em 0em 0em 1em;
+ font-size: large;
+ font-weight: normal;
+ }
+ div.lyxtoc-3 { margin: 0em 0em 0em 1em; font-size: medium; }
+ div.lyxtoc-4 { margin: 0em 0em 0em 1em; }
+ div.lyxtoc-5 { margin: 0em 0em 0em 1em; }
+ div.lyxtoc-6 { margin: 0em 0em 0em 1em; }
+</style>
+EndPreamble
+
+
Style Title
Margin Static
LatexType Command
xs << StartTag("div", "class='toc'");
- // we want to figure out look like a chapter, section, or whatever.
+ // we want to look like a chapter, section, or whatever.
// so we're going to look for the layout with the minimum toclevel
- // number. we'll take the first one, just because.
+ // number > 0, because we don't want Part.
+ // we'll take the first one, just because.
DocumentClass const & dc = buffer().params().documentClass();
TextClass::LayoutList::const_iterator lit = dc.begin();
TextClass::LayoutList::const_iterator len = dc.end();
Layout const * lay = NULL;
for (; lit != len; ++lit) {
int const level = lit->toclevel;
- if (level == Layout::NOT_IN_TOC || level >= minlevel)
+ if (level > 0 && (level == Layout::NOT_IN_TOC || level >= minlevel))
continue;
lay = &*lit;
minlevel = level;
}
- string const tocclass = lay ? lay->defaultCSSClass() + " ": "";
- string const tocattr = "class='" + tocclass + "tochead'";
+ string const tocclass = lay ? " " + lay->defaultCSSClass(): "";
+ string const tocattr = "class='tochead" + tocclass + "'";
xs << StartTag("div", tocattr)
<< _("Table of Contents")
}
-void InsetTOC::validate(LaTeXFeatures & features) const
-{
- if (features.runparams().flavor != OutputParams::HTML)
- return;
- features.addPreambleSnippet("<style type=\"text/css\">\n"
- "div.lyxtoc-1 { margin-left: 2em; text-indent: -2em; }\n"
- "span.bibtexlabel:before{ content: \"[\"; }\n"
- "span.bibtexlabel:after{ content: \"] \"; }\n"
- "</style>");
-}
-
} // namespace lyx