diff options
Diffstat (limited to 'src/latexgen.cpp')
-rw-r--r-- | src/latexgen.cpp | 128 |
1 files changed, 90 insertions, 38 deletions
diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 3f72ff4..d848a97 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -92,7 +92,7 @@ void LatexGenerator::init() QCString latex_command = Config_getString("LATEX_CMD_NAME"); QCString mkidx_command = Config_getString("MAKEINDEX_CMD_NAME"); // end insertion by KONNO Akihisa <konno@researchers.jp> 2002-03-05 - QTextStream t(&file); + FTextStream t(&file); if (!Config_getBool("USE_PDFLATEX")) // use plain old latex { t << "all: clean refman.dvi" << endl @@ -166,7 +166,7 @@ void LatexGenerator::init() createSubDirs(d); } -static void writeDefaultHeaderPart1(QTextStream &t) +static void writeDefaultHeaderPart1(FTextStream &t) { // part 1 @@ -267,7 +267,7 @@ static void writeDefaultHeaderPart1(QTextStream &t) } -static void writeDefaultHeaderPart2(QTextStream &t) +static void writeDefaultHeaderPart2(FTextStream &t) { // part 2 t << "}\\\\" << endl @@ -275,7 +275,7 @@ static void writeDefaultHeaderPart2(QTextStream &t) << "{\\large "; } -static void writeDefaultHeaderPart3(QTextStream &t) +static void writeDefaultHeaderPart3(FTextStream &t) { // part 3 t << " Doxygen " << versionString << "}\\\\" << endl @@ -296,7 +296,7 @@ static void writeDefaultHeaderPart3(QTextStream &t) } } -static void writeDefaultStyleSheetPart1(QTextStream &t) +static void writeDefaultStyleSheetPart1(FTextStream &t) { // part 1 t << "\\NeedsTeXFormat{LaTeX2e}\n" @@ -329,13 +329,14 @@ static void writeDefaultStyleSheetPart1(QTextStream &t) t << "\\rfoot[\\fancyplain{}{\\bfseries\\scriptsize%\n "; } -static void writeDefaultStyleSheetPart2(QTextStream &t) +static void writeDefaultStyleSheetPart2(FTextStream &t) { t << "\\lfoot[]{\\fancyplain{}{\\bfseries\\scriptsize%\n "; } -static void writeDefaultStyleSheetPart3(QTextStream &t) +static void writeDefaultStyleSheetPart3(FTextStream &t) { + static bool latexSourceCode = Config_getBool("LATEX_SOURCE_CODE"); t << "}}\n"; t << "\\cfoot{}\n\n"; t << "%---------- Internal commands used in this style file ----------------\n\n"; @@ -365,13 +366,27 @@ static void writeDefaultStyleSheetPart3(QTextStream &t) " \\normalsize%\n" "}\n\n"; t << "% Used by @code ... @endcode\n" - "\\newenvironment{DoxyCode}{%\n" - " \\footnotesize%\n" - " \\verbatim%\n" - "}{%\n" - " \\endverbatim%\n" - " \\normalsize%\n" - "}\n\n"; + "\\newenvironment{DoxyCode}{%\n"; + if (latexSourceCode) + { + t << "\n\n\\begin{footnotesize}\\begin{alltt}%" << endl; + } + else + { + t << " \\footnotesize%\n" + " \\verbatim%\n"; + } + t << "}{%\n"; + if (latexSourceCode) + { + t << "\\end{alltt}\\end{footnotesize}%" << endl; + } + else + { + t << " \\endverbatim%\n" + " \\normalsize%\n"; + } + t << "}\n\n"; t << "% Used by @example, @include, @includelineno and @dontinclude\n" "\\newenvironment{DoxyCodeInclude}{%\n" " \\DoxyCode%\n" @@ -529,6 +544,11 @@ static void writeDefaultStyleSheetPart3(QTextStream &t) " \\end{description}%\n" " \\end{DoxyDesc}%\n" "}\n\n"; + t << "% is used for parameters within a detailed function description\n" + "\\newenvironment{DoxyParamCaption}{%\n" + " \\renewcommand{\\item}[2][]{##1 \\em ##2}%\n" + " }{%\n" + "}\n\n"; t << "% Used by return value lists\n" "\\newenvironment{DoxyRetVals}[1]{%\n" " \\begin{DoxyDesc}{#1}%\n" @@ -628,7 +648,7 @@ static void writeDefaultStyleSheetPart3(QTextStream &t) void LatexGenerator::writeHeaderFile(QFile &f) { - QTextStream t(&f); + FTextStream t(&f); writeDefaultHeaderPart1(t); t << "Your title here"; writeDefaultHeaderPart2(t); @@ -638,8 +658,8 @@ void LatexGenerator::writeHeaderFile(QFile &f) void LatexGenerator::writeStyleSheetFile(QFile &f) { - QTextStream t(&f); - t.setEncoding(QTextStream::UnicodeUTF8); + FTextStream t(&f); + //t.setEncoding(QTextStream::UnicodeUTF8); writeDefaultStyleSheetPart1(t); QCString &projectName = Config_getString("PROJECT_NAME"); @@ -855,7 +875,7 @@ void LatexGenerator::startIndexSection(IndexSections is) void LatexGenerator::endIndexSection(IndexSections is) { - static bool compactLatex = Config_getBool("COMPACT_LATEX"); + //static bool compactLatex = Config_getBool("COMPACT_LATEX"); static bool sourceBrowser = Config_getBool("SOURCE_BROWSER"); static QCString latexHeader = Config_getString("LATEX_HEADER"); switch (is) @@ -1082,9 +1102,9 @@ void LatexGenerator::endIndexSection(IndexSections is) } } -void LatexGenerator::writePageLink(const char *name, bool first) +void LatexGenerator::writePageLink(const char *name, bool /*first*/) { - bool &compactLatex = Config_getBool("COMPACT_LATEX"); + //bool &compactLatex = Config_getBool("COMPACT_LATEX"); // next is remove for bug615957 //if (compactLatex || first) t << "\\input" ; else t << "\\include"; t << "\\input" ; @@ -1928,14 +1948,46 @@ void LatexGenerator::endParamList() t << "\\end{Desc}" << endl; } -void LatexGenerator::startParameterType(bool first,const char *key) +void LatexGenerator::startParameterList(bool openBracket) +{ + /* start of ParameterType ParameterName list */ + if (openBracket) t << "("; + t << endl << "\\begin{DoxyParamCaption}" << endl; +} + + +void LatexGenerator::startParameterType(bool /*first*/,const char *key) +{ + t << "\\item[{"; + t << key; +// if (!first) +// { +// t << "\\/ " << key << " "; +// } +} + +void LatexGenerator::endParameterType() { - if (!first) + t << "}]"; +} + +void LatexGenerator::startParameterName(bool /*oneArgOnly*/) +{ + t << "{"; +} + +void LatexGenerator::endParameterName(bool last,bool /* emptyList */,bool closeBracket) +{ + t << "}" << endl; + + if (last) { - t << "\\/ " << key << " "; + t << "\\end{DoxyParamCaption}" << endl; + if (closeBracket) t << ")"; } } + void LatexGenerator::printDoc(DocNode *n,const char *langExt) { LatexDocVisitor *visitor = new LatexDocVisitor(t,*this,langExt,insideTabbing); @@ -2025,27 +2077,27 @@ void LatexGenerator::escapeMakeIndexChars(const char *s) void LatexGenerator::startCodeFragment() { - if (m_prettyCode) - { - t << endl << endl; - t << "\\begin{footnotesize}\\begin{alltt}\n"; - } - else - { + //if (m_prettyCode) + //{ + // t << endl << endl; + // t << "\\begin{footnotesize}\\begin{alltt}\n"; + //} + //else + //{ t << "\n\\begin{DoxyCode}\n"; - } + //} } void LatexGenerator::endCodeFragment() { - if (m_prettyCode) - { - t << "\\end{alltt}\\end{footnotesize}" << endl; - } - else - { + //if (m_prettyCode) + //{ + // t << "\\end{alltt}\\end{footnotesize}" << endl; + //} + //else + //{ t << "\\end{DoxyCode}\n"; - } + //} } void LatexGenerator::writeLineNumber(const char *ref,const char *fileName,const char *anchor,int l) |