summaryrefslogtreecommitdiffstats
path: root/src/latexdocvisitor.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2003-02-23 20:49:55 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2003-02-23 20:49:55 (GMT)
commit6ac75f5093a2ac447626579cfbda2d1a8af6d86e (patch)
tree4163d92b8a5b2126fe8413cc21df8eb3f247dbfa /src/latexdocvisitor.cpp
parentb0cbd5971eb11555a9ea3ab5c23f2b0b97279b4d (diff)
downloadDoxygen-6ac75f5093a2ac447626579cfbda2d1a8af6d86e.zip
Doxygen-6ac75f5093a2ac447626579cfbda2d1a8af6d86e.tar.gz
Doxygen-6ac75f5093a2ac447626579cfbda2d1a8af6d86e.tar.bz2
Doxygen-1.3-rc3-20030223
Diffstat (limited to 'src/latexdocvisitor.cpp')
-rw-r--r--src/latexdocvisitor.cpp65
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 *)