]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.cpp
Longtable: only output the caption contents in a caption row.
[lyx.git] / src / LaTeXFeatures.cpp
index b10a9a27544623df2181f059a8f9ad668cbf9ad6..3f9eb6776267ab6fb3b0c00efb21a1c53d4d9898 100644 (file)
@@ -419,6 +419,19 @@ static docstring const rtloutputdblcol_def = from_ascii(
        "}\n"
        "\\@mparswitchtrue\n");
 
+static docstring const lyxmintcaption_def = from_ascii(
+       "\\long\\def\\lyxmintcaption[#1]#2{%\n"
+       "  \\ifx#1t\\vskip\\baselineskip\\fi%\n"
+       "  \\refstepcounter{listing}\\noindent%\n"
+       "  \\addcontentsline{lol}{listing}%\n"
+       "  {\\protect\\numberline{\\thelisting}{\\ignorespaces #2}}%\n"
+       "  \\setbox\\@tempboxa\\hbox{\\listingscaption~\\thelisting: #2}%\n"
+       "  \\ifdim \\wd\\@tempboxa >\\linewidth%\n"
+       "  \\parbox[t]{\\linewidth}{\\unhbox\\@tempboxa}\\else%\n"
+       "  \\hbox to\\linewidth{\\hfil\\box\\@tempboxa\\hfil}\\fi%\n"
+       "  \\ifx#1b\\vskip\\baselineskip\\fi\n"
+       "}\n");
+
 
 /////////////////////////////////////////////////////////////////////
 //
@@ -669,7 +682,7 @@ TexString getSnippets(std::list<TexString> const & list)
        return snip.release();
 }
 
-} //anon namespace
+} // namespace
 
 
 void LaTeXFeatures::addPreambleSnippet(TexString ts, bool allow_dupes)
@@ -961,6 +974,8 @@ char const * simplefeatures[] = {
        "todonotes",
        "forest",
        "varwidth",
+       "footnote",
+       "tablefootnote",
 };
 
 char const * bibliofeatures[] = {
@@ -984,7 +999,7 @@ int const nb_bibliofeatures = sizeof(bibliofeatures) / sizeof(char const *);
 
 int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
 
-}
+} // namespace
 
 
 string const LaTeXFeatures::getColorOptions() const
@@ -1491,6 +1506,9 @@ TexString LaTeXFeatures::getMacros() const
        if (mustProvide("rtloutputdblcol"))
                macros << rtloutputdblcol_def;
 
+       if (mustProvide("lyxmintcaption"))
+               macros << lyxmintcaption_def;
+
        return macros.release();
 }
 
@@ -1754,7 +1772,7 @@ docstring const i18npreamble(docstring const & templ, Language const * lang,
        return from_utf8(preamble);
 }
 
-}
+} // namespace
 
 
 docstring const LaTeXFeatures::getTClassI18nPreamble(bool use_babel,