summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index f9d8a09..8e936b5 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -47,6 +47,7 @@
#include "searchindex.h"
#include "doxygen.h"
#include "textdocvisitor.h"
+#include "latexdocvisitor.h"
#include "portable.h"
#include "parserintf.h"
#include "bufstr.h"
@@ -6725,6 +6726,12 @@ void filterLatexString(FTextStream &t,const char *str,
case '{': t << "\\{"; break;
case '}': t << "\\}"; break;
case '_': t << "\\_"; break;
+ case '&': t << "\\&"; break;
+ case '%': t << "\\%"; break;
+ case '#': t << "\\#"; break;
+ case '$': t << "\\$"; break;
+ case '^': (usedTableLevels()>0) ? t << "\\string^" : t << (char)c; break;
+ case '~': (usedTableLevels()>0) ? t << "\\string~" : t << (char)c; break;
case ' ': if (keepSpaces) t << "~"; else t << ' ';
break;
default:
@@ -8823,3 +8830,23 @@ void writeExtraLatexPackages(FTextStream &t)
}
}
+//------------------------------------------------------
+
+static int g_usedTableLevels = 0;
+
+void incUsedTableLevels()
+{
+ g_usedTableLevels++;
+}
+void decUsedTableLevels()
+{
+ g_usedTableLevels--;
+}
+int usedTableLevels()
+{
+ return g_usedTableLevels;
+}
+
+//------------------------------------------------------
+
+