summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 581ecfc..6c7e3d5 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -6741,6 +6741,16 @@ void filterLatexString(FTextStream &t,const char *str,
{
switch(c)
{
+ case 0xef: // handle U+FFFD i.e. "Replacement character" caused by octal: 357 277 275 / hexadecimal 0xef 0xbf 0xbd
+ // the LaTeX command \ucr has been defined in doxygen.sty
+ if ((unsigned char)*(p) == 0xbf && (unsigned char)*(p+1) == 0xbd)
+ {
+ t << "{\\ucr}";
+ p += 2;
+ }
+ else
+ t << (char)c;
+ break;
case '\\': t << "\\(\\backslash\\)"; break;
case '{': t << "\\{"; break;
case '}': t << "\\}"; break;
@@ -6762,6 +6772,16 @@ void filterLatexString(FTextStream &t,const char *str,
{
switch(c)
{
+ case 0xef: // handle U+FFFD i.e. "Replacement character" caused by octal: 357 277 275 / hexadecimal 0xef 0xbf 0xbd
+ // the LaTeX command \ucr has been defined in doxygen.sty
+ if ((unsigned char)*(p) == 0xbf && (unsigned char)*(p+1) == 0xbd)
+ {
+ t << "{\\ucr}";
+ p += 2;
+ }
+ else
+ t << (char)c;
+ break;
case '#': t << "\\#"; break;
case '$': t << "\\$"; break;
case '%': t << "\\%"; break;
@@ -8846,6 +8866,32 @@ 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 << "\\usepackage{newunicodechar}\n"
+ " \\newunicodechar{" << pminus << "}{${}^{-}$}% Superscript minus\n"
+ " \\newunicodechar{" << psup2 << "}{${}^{2}$}% Superscript two\n"
+ " \\newunicodechar{" << psup3 << "}{${}^{3}$}% Superscript three\n"
+ "\n";
+}
+
//------------------------------------------------------
static int g_usedTableLevels = 0;