diff options
author | albert-github <albert.tests@gmail.com> | 2014-01-15 12:37:01 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2014-01-15 12:37:01 (GMT) |
commit | dd2c137847e16d0a7c6086053f55bce501d84a0c (patch) | |
tree | 324281ae6b269144c0230383cffb308604b4a2e3 /src/latexgen.cpp | |
parent | de9e2e0b72c5f460e38f0157039836fcdfb35c21 (diff) | |
download | Doxygen-dd2c137847e16d0a7c6086053f55bce501d84a0c.zip Doxygen-dd2c137847e16d0a7c6086053f55bce501d84a0c.tar.gz Doxygen-dd2c137847e16d0a7c6086053f55bce501d84a0c.tar.bz2 |
Enabling possibility to have { and } in (latex) index items
In the doxygen manual the index items for \{ and \} were missing due to the missing support for the usage of { and } in parts of the code.
This patch fixes this problem by introducing 2 new latex commands. See also http://tex.stackexchange.com/questions/153291/index-unmatched-braces-in-latex
Further improvements in the index are:
- consistency in different places
- correction of index for \::
- placing \~ on a more logical place (together with other special characters, ~ is in the ASCII table after a-z whilst other characters are before this range)
Diffstat (limited to 'src/latexgen.cpp')
-rw-r--r-- | src/latexgen.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 6db6148..fae61cc 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -1374,8 +1374,10 @@ void LatexGenerator::startMemberDoc(const char *clname, t << "}"; if (clname) { - t << "!" << clname << "@{"; - docify(clname); + t << "!"; + escapeLabelName(clname); + t << "@{"; + escapeMakeIndexChars(clname); t << "}"; } t << "}" << endl; @@ -2012,13 +2014,18 @@ void LatexGenerator::escapeLabelName(const char *s) { switch (c) { + case '|': t << "\\texttt{\"|}"; break; + case '!': t << "\"!"; break; case '%': t << "\\%"; break; + case '{': t << "\\lcurly{}"; break; + case '}': t << "\\rcurly{}"; break; + case '~': t << "````~"; break; // to get it a bit better in index together with other special characters // NOTE: adding a case here, means adding it to while below as well! default: i=0; // collect as long string as possible, before handing it to docify result[i++]=c; - while ((c=*p) && c!='%') + while ((c=*p) && c!='|' && c!='!' && c!='%' && c!='{' && c!='}' && c!='~') { result[i++]=c; p++; @@ -2041,16 +2048,20 @@ void LatexGenerator::escapeMakeIndexChars(const char *s) { switch (c) { + case '!': t << "\"!"; break; case '"': t << "\"\""; break; case '@': t << "\"@"; break; + case '|': t << "\\texttt{\"|}"; break; case '[': t << "["; break; case ']': t << "]"; break; + case '{': t << "\\lcurly{}"; break; + case '}': t << "\\rcurly{}"; break; // NOTE: adding a case here, means adding it to while below as well! default: i=0; // collect as long string as possible, before handing it to docify result[i++]=c; - while ((c=*p) && c!='"' && c!='@' && c!='[' && c!=']') + while ((c=*p) && c!='"' && c!='@' && c!='[' && c!=']' && c!='!' && c!='{' && c!='}' && c!='|') { result[i++]=c; p++; |