diff options
author | albert-github <albert.tests@gmail.com> | 2018-05-22 16:45:20 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2018-05-22 16:45:20 (GMT) |
commit | f4544b7508bde732dacb1172e8200e88ac07c82b (patch) | |
tree | 52baa80d4964f7da9a2d8af06ea8880c5a5763ef /src/latexgen.cpp | |
parent | f10c9a42cd3b506cb5bb5cf0192c9e221adafa72 (diff) | |
download | Doxygen-f4544b7508bde732dacb1172e8200e88ac07c82b.zip Doxygen-f4544b7508bde732dacb1172e8200e88ac07c82b.tar.gz Doxygen-f4544b7508bde732dacb1172e8200e88ac07c82b.tar.bz2 |
Small problems when having code in LaTeX output
- in formulas it is also possible to have special characters
- adding special character '-' for U+2212
- making special characters more system independent (plain latex was not handled) and should be independent of hyperlink setting
- without hyperlinks the name of normally linked names with underscore kept e.g. their underscores instead of escaping it
- be sure that on the end of a code section the previous line is properly 'closed'.
Diffstat (limited to 'src/latexgen.cpp')
-rw-r--r-- | src/latexgen.cpp | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 00826e6..a3cdaa8 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -181,7 +181,7 @@ void LatexCodeGenerator::writeCodeLink(const char *ref,const char *f, } else { - m_t << name; + codify(name); } m_col+=l; } @@ -633,46 +633,18 @@ static void writeDefaultHeaderPart1(FTextStream &t) "\n"; writeExtraLatexPackages(t); + writeLatexSpecialFormulaChars(t); // Hyperlinks bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); if (pdfHyperlinks) { - unsigned char minus[4]; // Superscript minus - char *pminus = (char *)minus; - unsigned char sup2[3]; // Superscript two - char *psup2 = (char *)sup2; - unsigned char sup3[3]; - char *psup3 = (char *)sup3; // Superscript three - minus[0]= 0xE2; - minus[1]= 0x81; - minus[2]= 0xBB; - minus[3]= 0; - sup2[0]= 0xC2; - sup2[1]= 0xB2; - sup2[2]= 0; - sup3[0]= 0xC2; - sup3[1]= 0xB3; - sup3[2]= 0; - t << "% Hyperlinks (required, but should be loaded last)\n" "\\ifpdf\n" " \\usepackage[pdftex,pagebackref=true]{hyperref}\n" "\\else\n" " \\usepackage[ps2pdf,pagebackref=true]{hyperref}\n" "\\fi\n" - "\\ifpdf\n" - " \\DeclareUnicodeCharacter{207B}{${}^{-}$}% Superscript minus\n" - " \\DeclareUnicodeCharacter{C2B2}{${}^{2}$}% Superscript two\n" - " \\DeclareUnicodeCharacter{C2B3}{${}^{3}$}% Superscript three\n" - "\\else\n" - " \\catcode`\\" << pminus << "=13% Superscript minus\n" - " \\def" << pminus << "{${}^{-}$}\n" - " \\catcode`\\" << psup2 << "=13% Superscript two\n" - " \\def" << psup2 << "{${}^{2}$}\n" - " \\catcode`\\"<<psup3<<"=13% Superscript three\n" - " \\def"<<psup3<<"{${}^{3}$}\n" - "\\fi\n" "\n" "\\hypersetup{%\n" " colorlinks=true,%\n" @@ -2209,6 +2181,11 @@ void LatexGenerator::startCodeFragment() void LatexGenerator::endCodeFragment() { + if (DoxyCodeOpen) + { + t << "}\n"; + DoxyCodeOpen = FALSE; + } t << "\\end{DoxyCode}\n"; } |