diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-02-03 20:07:39 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2014-02-03 20:07:39 (GMT) |
commit | ae7007a45fbf1957fa265ae667a7c20a72298468 (patch) | |
tree | 0025125994627e74d4f11d5a3e0499a84928476c | |
parent | be7a6bf70f440124bc205e02f456e2178696e207 (diff) | |
parent | dd2c137847e16d0a7c6086053f55bce501d84a0c (diff) | |
download | Doxygen-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
-rw-r--r-- | doc/commands.doc | 8 | ||||
-rw-r--r-- | doc/doxygen.sty | 2 | ||||
-rw-r--r-- | src/doxygen.sty | 4 | ||||
-rw-r--r-- | src/latexdocvisitor.cpp | 5 | ||||
-rw-r--r-- | src/latexgen.cpp | 19 |
5 files changed, 32 insertions, 6 deletions
diff --git a/doc/commands.doc b/doc/commands.doc index ab7c569..7644f69 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -2698,6 +2698,8 @@ class Receiver <hr> \section cmdfcurlyopen \\f{environment}{ + \addindex \\f{ + Marks the start of a formula that is in a specific environment. \note The second \c { is optional and is only to help editors (such as \c Vim) to do proper syntax highlighting by making the number of opening and closing braces @@ -2707,6 +2709,8 @@ class Receiver <hr> \section cmdfcurlyclose \\f} + \addindex \\f} + Marks the end of a formula that is in a specific environment. \sa section \ref cmdfcurlyopen "\\f{" and section \ref formulas "formulas". @@ -3032,7 +3036,7 @@ class Receiver \section cmdchardot \\. \addindex \\\. - This command writes a dot (\c .) to the output. This can be useful to + This command writes a dot (`.`) to the output. This can be useful to prevent ending a brief description when JAVADOC_AUTOBRIEF is enabled or to prevent starting a numbered list when the dot follows a number at the start of a line. @@ -3040,7 +3044,7 @@ class Receiver <hr> \section cmddcolon \\:: - \addindex \\\:: + \addindex \\:: This command writes a double colon (\c \::) to the output. This character sequence has to be escaped in some cases, because it is used to reference to documented entities. diff --git a/doc/doxygen.sty b/doc/doxygen.sty index 45bec34..8013dad 100644 --- a/doc/doxygen.sty +++ b/doc/doxygen.sty @@ -381,6 +381,8 @@ } \newcommand{\doxyref}[3]{\textbf{#1} (\textnormal{#2}\,\pageref{#3})} +\newcommand{\lcurly}{\{} +\newcommand{\rcurly}{\}} \newenvironment{DoxyCompactList} {\begin{list}{}{ \setlength{\leftmargin}{0.5cm} 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++; |