diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2003-02-23 20:49:55 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2003-02-23 20:49:55 (GMT) |
commit | 448b28836eb910f95e2f1903b4dea5eb8548e424 (patch) | |
tree | 4163d92b8a5b2126fe8413cc21df8eb3f247dbfa /src/latexdocvisitor.cpp | |
parent | 067ee3cfc7a79acd42cedb3f89713b9ed5f47f93 (diff) | |
download | Doxygen-448b28836eb910f95e2f1903b4dea5eb8548e424.zip Doxygen-448b28836eb910f95e2f1903b4dea5eb8548e424.tar.gz Doxygen-448b28836eb910f95e2f1903b4dea5eb8548e424.tar.bz2 |
Doxygen-1.3-rc3-20030223
Diffstat (limited to 'src/latexdocvisitor.cpp')
-rw-r--r-- | src/latexdocvisitor.cpp | 65 |
1 files changed, 19 insertions, 46 deletions
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 937252a..cdbea1b 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -44,6 +44,18 @@ static QString escapeLabelName(const char *s) return result; } +const int maxLevels=5; +static const char *secLabels[maxLevels] = + { "section","subsection","subsubsection","paragraph","subparagraph" }; + +static const char *getSectionName(int level) +{ + int l = level; + if (Config_getBool("COMPACT_LATEX")) l++; + if (Doxygen::insideMainPage) l--; + return secLabels[QMIN(maxLevels-1,l)]; +} + QString LatexDocVisitor::escapeMakeIndexChars(const char *s) { QString result; @@ -187,13 +199,13 @@ void LatexDocVisitor::visit(DocStyleChange *s) switch (s->style()) { case DocStyleChange::Bold: - if (s->enable()) m_t << "{\\bf "; else m_t << "} "; + if (s->enable()) m_t << "{\\bf "; else m_t << "}"; break; case DocStyleChange::Italic: - if (s->enable()) m_t << "{\\em "; else m_t << "} "; + if (s->enable()) m_t << "{\\em "; else m_t << "\\/}"; break; case DocStyleChange::Code: - if (s->enable()) m_t << "{\\tt "; else m_t << "} "; + if (s->enable()) m_t << "{\\tt "; else m_t << "}"; break; case DocStyleChange::Subscript: if (s->enable()) m_t << "$_{\\mbox{"; else m_t << "}}$ "; @@ -219,6 +231,8 @@ void LatexDocVisitor::visit(DocStyleChange *s) m_t << "\\end{alltt}\\normalsize " << endl; } break; + case DocStyleChange::Div: /* HTML only */ break; + case DocStyleChange::Span: /* HTML only */ break; } } @@ -476,26 +490,7 @@ void LatexDocVisitor::visitPre(DocSection *s) { m_t << "\\hypertarget{" << s->file() << "_" << s->anchor() << "}{}"; } - if (Config_getBool("COMPACT_LATEX")) - { - switch(s->level()) - { - case 1: m_t << "\\subsubsection{"; break; - case 2: m_t << "\\paragraph{"; break; - case 3: m_t << "\\subparagraph{"; break; - case 4: m_t << "\\subparagraph{"; break; - } - } - else - { - switch(s->level()) - { - case 1: m_t << "\\subsection{"; break; - case 2: m_t << "\\subsubsection{"; break; - case 3: m_t << "\\paragraph{"; break; - case 4: m_t << "\\subparagraph{"; break; - } - } + m_t << "\\" << getSectionName(s->level()) << "{"; filter(s->title()); m_t << "}\\label{" << s->anchor() << "}" << endl; } @@ -667,27 +662,7 @@ void LatexDocVisitor::visitPost(DocHRef *) void LatexDocVisitor::visitPre(DocHtmlHeader *header) { if (m_hide) return; - if (Config_getBool("COMPACT_LATEX")) - { - switch(header->level()) - { - case 1: m_t << "\\subsection*{"; break; - case 2: m_t << "\\subsubsection*{"; break; - case 3: m_t << "\\paragraph*{"; break; - default: m_t << "\\subparagraph*{"; break; - } - } - else - { - switch(header->level()) - { - case 1: m_t << "\\section*{"; break; - case 2: m_t << "\\subsection*{"; break; - case 3: m_t << "\\subsubsection*{"; break; - case 4: m_t << "\\paragraph*{"; break; - default: m_t << "\\subparagraph*{"; break; - } - } + m_t << "\\" << getSectionName(header->level()) << "*{"; } void LatexDocVisitor::visitPost(DocHtmlHeader *) @@ -835,7 +810,6 @@ void LatexDocVisitor::visitPost(DocRef *) { if (m_hide) return; endLink(); - m_t << " "; } void LatexDocVisitor::visitPre(DocSecRefItem *) @@ -968,7 +942,6 @@ void LatexDocVisitor::visitPost(DocInternalRef *) { if (m_hide) return; endLink(); - m_t << " "; } void LatexDocVisitor::visitPre(DocCopy *) |