summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2018-07-21 13:13:25 (GMT)
committerGitHub <noreply@github.com>2018-07-21 13:13:25 (GMT)
commit5e05075b2eb5957739d6e32577f6b9643e6bbee6 (patch)
treeafb60fa51be77c2ec4ce06f342e0dfaceffabeb8 /src/util.cpp
parent72b5d9ccf8e82930dac5dc4c847babcf41f7cc0a (diff)
parent7bb6b4792a95626685df5750a6ab79b675c9fd60 (diff)
downloadDoxygen-5e05075b2eb5957739d6e32577f6b9643e6bbee6.zip
Doxygen-5e05075b2eb5957739d6e32577f6b9643e6bbee6.tar.gz
Doxygen-5e05075b2eb5957739d6e32577f6b9643e6bbee6.tar.bz2
Merge pull request #738 from albert-github/feature/bug_latex_code
Small problems when having code in LaTeX output
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 581ecfc..a0522d4 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -8846,6 +8846,41 @@ void writeExtraLatexPackages(FTextStream &t)
}
}
+void writeLatexSpecialFormulaChars(FTextStream &t)
+{
+ 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 << "\\ifthenelse{\\isundefined{\\DeclareUnicodeCharacter}}{%\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"
+ "}{%\n"
+ " \\DeclareUnicodeCharacter{207B}{${}^{-}$}% Superscript minus\n"
+ " \\DeclareUnicodeCharacter{C2B2}{${}^{2}$}% Superscript two\n"
+ " \\DeclareUnicodeCharacter{C2B3}{${}^{3}$}% Superscript three\n"
+ " \\DeclareUnicodeCharacter{2212}{-}% Just a minus sign\n"
+ "}\n"
+ "\n";
+}
+
//------------------------------------------------------
static int g_usedTableLevels = 0;