summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-02-03 20:07:39 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-02-03 20:07:39 (GMT)
commitae7007a45fbf1957fa265ae667a7c20a72298468 (patch)
tree0025125994627e74d4f11d5a3e0499a84928476c /src
parentbe7a6bf70f440124bc205e02f456e2178696e207 (diff)
parentdd2c137847e16d0a7c6086053f55bce501d84a0c (diff)
downloadDoxygen-ae7007a45fbf1957fa265ae667a7c20a72298468.zip
Doxygen-ae7007a45fbf1957fa265ae667a7c20a72298468.tar.gz
Doxygen-ae7007a45fbf1957fa265ae667a7c20a72298468.tar.bz2
Merge pull request #95 from albert-github/feature/bug_latex_index_1
Enabling possibility to have { and } in (latex) index items
Diffstat (limited to 'src')
-rw-r--r--src/doxygen.sty4
-rw-r--r--src/latexdocvisitor.cpp5
-rw-r--r--src/latexgen.cpp19
3 files changed, 24 insertions, 4 deletions
diff --git a/src/doxygen.sty b/src/doxygen.sty
index 199abf8..072104b 100644
--- a/src/doxygen.sty
+++ b/src/doxygen.sty
@@ -450,6 +450,10 @@
\textbf{#1} (\textnormal{#2}\,\pageref{#3})%
}
+% Used by @addindex
+\newcommand{\lcurly}{\{}
+\newcommand{\rcurly}{\}}
+
% Used for syntax highlighting
\definecolor{comment}{rgb}{0.5,0.0,0.0}
\definecolor{keyword}{rgb}{0.0,0.5,0.0}
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 91064a3..bc8e5a5 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -44,6 +44,9 @@ static QCString escapeLabelName(const char *s)
case '%': result+="\\%"; break;
case '|': result+="\\texttt{\"|}"; break;
case '!': result+="\"!"; break;
+ case '{': result+="\\lcurly{}"; break;
+ case '}': result+="\\rcurly{}"; break;
+ case '~': result+="````~"; break; // to get it a bit better in index together with other special characters
default: result+=c;
}
}
@@ -79,6 +82,8 @@ QCString LatexDocVisitor::escapeMakeIndexChars(const char *s)
case '|': m_t << "\\texttt{\"|}"; break;
case '[': m_t << "["; break;
case ']': m_t << "]"; break;
+ case '{': m_t << "\\lcurly{}"; break;
+ case '}': m_t << "\\rcurly{}"; break;
default: str[0]=c; filter(str); break;
}
}
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index 8b8c835..04750f5 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -1375,8 +1375,10 @@ void LatexGenerator::startMemberDoc(const char *clname,
t << "}";
if (clname)
{
- t << "!" << clname << "@{";
- docify(clname);
+ t << "!";
+ escapeLabelName(clname);
+ t << "@{";
+ escapeMakeIndexChars(clname);
t << "}";
}
t << "}" << endl;
@@ -2013,13 +2015,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++;
@@ -2042,16 +2049,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++;