1 /******************************************************************************
5 * Copyright (C) 1997-2014 by Dimitri van Heesch.
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation under the terms of the GNU General Public License is hereby
9 * granted. No representations are made about the suitability of this software
10 * for any purpose. It is provided "as is" without express or implied warranty.
11 * See the GNU General Public License for more details.
13 * Documents produced by Doxygen are derivative works derived from the
14 * input used in their production; they are not affected by this license.
31 #include "docparser.h"
32 #include "latexdocvisitor.h"
36 #include "classlist.h"
37 #include "namespacedef.h"
40 static const char doxygenLatexStyle[] =
41 #include "doxygen.sty.h"
44 //static QCString filterTitle(const char *s)
46 // QCString tmp=s,result;
47 // uint i;for (i=0;i<tmp.length();i++)
52 // case '#': result+="\\#"; break;
53 // case '"': result+="\\\""; break;
54 // case '%': result+="\\%"; break;
55 // case '[': result+="{"; break;
56 // case ']': result+="}"; break;
57 // default: result+=c; break;
65 LatexGenerator::LatexGenerator() : OutputGenerator()
67 dir=Config_getString("LATEX_OUTPUT");
69 //printf("LatexGenerator::LatexGenerator() insideTabbing=FALSE\n");
74 templateMemberItem = FALSE;
75 m_prettyCode=Config_getBool("LATEX_SOURCE_CODE");
78 LatexGenerator::~LatexGenerator()
82 static void writeLatexMakefile()
84 bool generateBib = !Doxygen::citeDict->isEmpty();
85 QCString dir=Config_getString("LATEX_OUTPUT");
86 QCString fileName=dir+"/Makefile";
88 if (!file.open(IO_WriteOnly))
90 err("Could not open file %s for writing\n",fileName.data());
93 // inserted by KONNO Akihisa <konno@researchers.jp> 2002-03-05
94 QCString latex_command = Config_getString("LATEX_CMD_NAME");
95 QCString mkidx_command = Config_getString("MAKEINDEX_CMD_NAME");
96 // end insertion by KONNO Akihisa <konno@researchers.jp> 2002-03-05
98 if (!Config_getBool("USE_PDFLATEX")) // use plain old latex
100 t << "all: refman.dvi" << endl
102 << "ps: refman.ps" << endl
104 << "pdf: refman.pdf" << endl
106 << "ps_2on1: refman_2on1.ps" << endl
108 << "pdf_2on1: refman_2on1.pdf" << endl
110 << "refman.ps: refman.dvi" << endl
111 << "\tdvips -o refman.ps refman.dvi" << endl
113 t << "refman.pdf: refman.ps" << endl;
114 t << "\tps2pdf refman.ps refman.pdf" << endl << endl;
115 t << "refman.dvi: clean refman.tex doxygen.sty" << endl
116 << "\techo \"Running latex...\"" << endl
117 << "\t" << latex_command << " refman.tex" << endl
118 << "\techo \"Running makeindex...\"" << endl
119 << "\t" << mkidx_command << " refman.idx" << endl;
122 t << "\techo \"Running bibtex...\"" << endl;
123 t << "\tbibtex refman" << endl;
124 t << "\techo \"Rerunning latex....\"" << endl;
125 t << "\t" << latex_command << " refman.tex" << endl;
127 t << "\techo \"Rerunning latex....\"" << endl
128 << "\t" << latex_command << " refman.tex" << endl
129 << "\tlatex_count=8 ; \\" << endl
130 << "\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\" << endl
131 << "\t do \\" << endl
132 << "\t echo \"Rerunning latex....\" ;\\" << endl
133 << "\t " << latex_command << " refman.tex ;\\" << endl
134 << "\t latex_count=`expr $$latex_count - 1` ;\\" << endl
136 << "\t" << mkidx_command << " refman.idx" << endl
137 << "\t" << latex_command << " refman.tex" << endl << endl
138 << "refman_2on1.ps: refman.ps" << endl
139 << "\tpsnup -2 refman.ps >refman_2on1.ps" << endl
141 << "refman_2on1.pdf: refman_2on1.ps" << endl
142 << "\tps2pdf refman_2on1.ps refman_2on1.pdf" << endl;
144 else // use pdflatex for higher quality output
146 t << "all: refman.pdf" << endl << endl
147 << "pdf: refman.pdf" << endl << endl;
148 t << "refman.pdf: clean refman.tex" << endl;
149 t << "\tpdflatex refman" << endl;
150 t << "\t" << mkidx_command << " refman.idx" << endl;
153 t << "\tbibtex refman" << endl;
154 t << "\tpdflatex refman" << endl;
156 t << "\tpdflatex refman" << endl
157 << "\tlatex_count=8 ; \\" << endl
158 << "\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\" << endl
159 << "\t do \\" << endl
160 << "\t echo \"Rerunning latex....\" ;\\" << endl
161 << "\t pdflatex refman ;\\" << endl
162 << "\t latex_count=`expr $$latex_count - 1` ;\\" << endl
164 << "\t" << mkidx_command << " refman.idx" << endl
165 << "\tpdflatex refman" << endl << endl;
171 << "*.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf" << endl;
174 static void writeMakeBat()
176 #if defined(_MSC_VER)
177 QCString dir=Config_getString("LATEX_OUTPUT");
178 QCString fileName=dir+"/make.bat";
179 QCString latex_command = Config_getString("LATEX_CMD_NAME");
180 QCString mkidx_command = Config_getString("MAKEINDEX_CMD_NAME");
181 QFile file(fileName);
182 bool generateBib = !Doxygen::citeDict->isEmpty();
183 if (!file.open(IO_WriteOnly))
185 err("Could not open file %s for writing\n",fileName.data());
188 FTextStream t(&file);
189 t << "set Dir_Old=%cd%\n";
190 t << "cd /D %~dp0\n\n";
191 t << "del /s /f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf\n\n";
192 if (!Config_getBool("USE_PDFLATEX")) // use plain old latex
194 t << latex_command << " refman.tex\n";
196 t << mkidx_command << " refman.idx\n";
199 t << "bibtex refman\n";
201 t << latex_command << " refman.tex\n";
203 t << "setlocal enabledelayedexpansion\n";
204 t << "set count=8\n";
206 t << "set content=X\n";
207 t << "for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\n";
208 t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\n";
209 t << "if !content! == X goto :skip\n";
210 t << "set /a count-=1\n";
211 t << "if !count! EQU 0 goto :skip\n\n";
213 t << latex_command << " refman.tex\n";
214 t << "goto :repeat\n";
217 t << mkidx_command << " refman.idx\n";
218 t << latex_command << " refman.tex\n";
219 t << "dvips -o refman.ps refman.dvi\n";
220 t << "gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "
221 "-sOutputFile=refman.pdf -c save pop -f refman.ps\n";
225 t << "pdflatex refman\n";
227 t << mkidx_command << " refman.idx\n";
230 t << "bibtex refman" << endl;
231 t << "pdflatex refman" << endl;
234 t << "pdflatex refman\n\n";
235 t << "setlocal enabledelayedexpansion\n";
236 t << "set count=8\n";
238 t << "set content=X\n";
239 t << "for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\n";
240 t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\n";
241 t << "if !content! == X goto :skip\n";
242 t << "set /a count-=1\n";
243 t << "if !count! EQU 0 goto :skip\n\n";
245 t << "pdflatex refman\n";
246 t << "goto :repeat\n";
249 t << mkidx_command << " refman.idx\n";
250 t << "pdflatex refman\n";
251 t << "cd /D %Dir_Old%\n";
252 t << "set Dir_Old=\n";
257 void LatexGenerator::init()
260 QCString dir=Config_getString("LATEX_OUTPUT");
262 if (!d.exists() && !d.mkdir(dir))
264 err("Could not create output directory %s\n",dir.data());
268 writeLatexMakefile();
274 static void writeDefaultHeaderPart1(FTextStream &t)
279 if (Config_getBool("LATEX_BATCHMODE"))
280 t << "\\batchmode\n";
282 // Set document class depending on configuration
283 QCString documentClass;
284 if (Config_getBool("COMPACT_LATEX"))
285 documentClass = "article";
287 documentClass = "book";
288 t << "\\documentclass[twoside]{" << documentClass << "}\n"
291 // Load required packages
292 t << "% Packages required by doxygen\n"
293 "\\usepackage{fixltx2e}\n" // for \textsubscript
294 "\\usepackage{calc}\n"
295 "\\usepackage{doxygen}\n"
296 "\\usepackage{graphicx}\n"
297 "\\usepackage[utf8]{inputenc}\n"
298 "\\usepackage{makeidx}\n"
299 "\\usepackage{multicol}\n"
300 "\\usepackage{multirow}\n"
301 "\\PassOptionsToPackage{warn}{textcomp}\n"
302 "\\usepackage{textcomp}\n"
303 "\\usepackage[nointegrals]{wasysym}\n"
304 "\\usepackage[table]{xcolor}\n"
308 QCString languageSupport = theTranslator->latexLanguageSupportCommand();
309 if (!languageSupport.isEmpty())
311 t << "% NLS support packages\n"
316 // Define default fonts
317 t << "% Font selection\n"
318 "\\usepackage[T1]{fontenc}\n"
319 "\\usepackage{mathptmx}\n"
320 "\\usepackage[scaled=.90]{helvet}\n"
321 "\\usepackage{courier}\n"
322 "\\usepackage{amssymb}\n"
323 "\\usepackage{sectsty}\n"
324 "\\renewcommand{\\familydefault}{\\sfdefault}\n"
325 "\\allsectionsfont{%\n"
326 " \\fontseries{bc}\\selectfont%\n"
327 " \\color{darkgray}%\n"
329 "\\renewcommand{\\DoxyLabelFont}{%\n"
330 " \\fontseries{bc}\\selectfont%\n"
331 " \\color{darkgray}%\n"
333 "\\newcommand{\\+}{\\discretionary{\\mbox{\\scriptsize$\\hookleftarrow$}}{}{}}\n"
336 // Define page & text layout
338 QCString &paperType=Config_getEnum("PAPER_TYPE");
339 // "a4wide" package is obsolete (see bug 563698)
340 if (paperType=="a4wide")
344 t << "% Page & text layout\n"
345 "\\usepackage{geometry}\n"
347 " " << paperName << "paper,%\n"
353 // \sloppy is obsolete (see bug 563698)
354 // Allow a bit of overflow to go unnoticed by other means
355 t << "\\tolerance=750\n"
358 "\\setlength{\\emergencystretch}{15pt}\n"
359 "\\setlength{\\parindent}{0cm}\n"
360 "\\setlength{\\parskip}{0.2cm}\n";
361 // Redefine paragraph/subparagraph environments, using sectsty fonts
362 t << "\\makeatletter\n"
363 "\\renewcommand{\\paragraph}{%\n"
364 " \\@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%\n"
365 " \\normalfont\\normalsize\\bfseries\\SS@parafont%\n"
368 "\\renewcommand{\\subparagraph}{%\n"
369 " \\@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{%\n"
370 " \\normalfont\\normalsize\\bfseries\\SS@subparafont%\n"
378 FTextStream tg(&genString);
379 filterLatexString(tg,
380 theTranslator->trGeneratedAt(dateToString(TRUE),
381 Config_getString("PROJECT_NAME")),
383 t << "% Headers & footers\n"
384 "\\usepackage{fancyhdr}\n"
385 "\\pagestyle{fancyplain}\n"
386 "\\fancyhead[LE]{\\fancyplain{}{\\bfseries\\thepage}}\n"
387 "\\fancyhead[CE]{\\fancyplain{}{}}\n"
388 "\\fancyhead[RE]{\\fancyplain{}{\\bfseries\\leftmark}}\n"
389 "\\fancyhead[LO]{\\fancyplain{}{\\bfseries\\rightmark}}\n"
390 "\\fancyhead[CO]{\\fancyplain{}{}}\n"
391 "\\fancyhead[RO]{\\fancyplain{}{\\bfseries\\thepage}}\n"
392 "\\fancyfoot[LE]{\\fancyplain{}{}}\n"
393 "\\fancyfoot[CE]{\\fancyplain{}{}}\n"
394 "\\fancyfoot[RE]{\\fancyplain{}{\\bfseries\\scriptsize " << genString << " Doxygen }}\n"
395 "\\fancyfoot[LO]{\\fancyplain{}{\\bfseries\\scriptsize " << genString << " Doxygen }}\n"
396 "\\fancyfoot[CO]{\\fancyplain{}{}}\n"
397 "\\fancyfoot[RO]{\\fancyplain{}{}}\n"
398 "\\renewcommand{\\footrulewidth}{0.4pt}\n";
399 if (!Config_getBool("COMPACT_LATEX"))
401 t << "\\renewcommand{\\chaptermark}[1]{%\n"
402 " \\markboth{#1}{}%\n"
405 t << "\\renewcommand{\\sectionmark}[1]{%\n"
406 " \\markright{\\thesection\\ #1}%\n"
410 // ToC, LoF, LoT, bibliography, and index
411 t << "% Indices & bibliography\n"
412 "\\usepackage{natbib}\n"
413 "\\usepackage[titles]{tocloft}\n"
414 "\\setcounter{tocdepth}{3}\n"
415 "\\setcounter{secnumdepth}{5}\n"
419 // User-specified packages
420 QStrList &extraPackages = Config_getList("EXTRA_PACKAGES");
421 if (!extraPackages.isEmpty()) {
422 t << "% Packages requested by user\n";
423 const char *pkgName=extraPackages.first();
426 t << "\\usepackage{" << pkgName << "}\n";
427 pkgName=extraPackages.next();
433 bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
436 t << "% Hyperlinks (required, but should be loaded last)\n"
437 "\\usepackage{ifpdf}\n"
439 " \\usepackage[pdftex,pagebackref=true]{hyperref}\n"
441 " \\usepackage[ps2pdf,pagebackref=true]{hyperref}\n"
444 " colorlinks=true,%\n"
445 " linkcolor=blue,%\n"
446 " citecolor=blue,%\n"
452 // Custom commands used by the header
453 t << "% Custom commands\n"
454 "\\newcommand{\\clearemptydoublepage}{%\n"
455 " \\newpage{\\pagestyle{empty}\\cleardoublepage}%\n"
460 // End of preamble, now comes the document contents
461 t << "%===== C O N T E N T S =====\n"
463 "\\begin{document}\n";
464 if (theTranslator->idLanguage()=="greek")
465 t << "\\selectlanguage{greek}\n";
469 t << "% Titlepage & ToC\n";
470 bool usePDFLatex = Config_getBool("USE_PDFLATEX");
471 if (pdfHyperlinks && usePDFLatex)
473 // To avoid duplicate page anchors due to reuse of same numbers for
474 // the index (be it as roman numbers)
475 t << "\\hypersetup{pageanchor=false,\n"
476 << " bookmarks=true,\n"
477 << " bookmarksnumbered=true,\n"
478 << " pdfencoding=unicode\n"
481 t << "\\pagenumbering{roman}\n"
482 "\\begin{titlepage}\n"
488 static void writeDefaultHeaderPart2(FTextStream &t)
491 // Finalize project name
497 static void writeDefaultHeaderPart3(FTextStream &t)
500 // Finalize project number
501 t << " Doxygen " << versionString << "}\\\\\n"
503 "{\\small " << dateToString(TRUE) << "}\\\\\n"
505 "\\end{titlepage}\n";
506 bool compactLatex = Config_getBool("COMPACT_LATEX");
508 t << "\\clearemptydoublepage\n";
511 t << "\\tableofcontents\n";
513 t << "\\clearemptydoublepage\n";
514 t << "\\pagenumbering{arabic}\n";
515 bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
516 bool usePDFLatex = Config_getBool("USE_PDFLATEX");
517 if (pdfHyperlinks && usePDFLatex)
519 // re-enable anchors again
520 t << "\\hypersetup{pageanchor=true}\n";
523 "%--- Begin generated contents ---\n";
526 static void writeDefaultStyleSheet(FTextStream &t)
528 t << doxygenLatexStyle;
531 static void writeDefaultFooter(FTextStream &t)
533 t << "%--- End generated contents ---\n"
537 Doxygen::citeDict->writeLatexBibliography(t);
541 if (Config_getBool("COMPACT_LATEX"))
548 "\\addcontentsline{toc}{" << unit << "}{" << theTranslator->trRTFGeneralIndex() << "}\n"
554 void LatexGenerator::writeHeaderFile(QFile &f)
557 t << "% Latex header for doxygen " << versionString << endl;
558 writeDefaultHeaderPart1(t);
559 t << "Your title here";
560 writeDefaultHeaderPart2(t);
562 writeDefaultHeaderPart3(t);
565 void LatexGenerator::writeFooterFile(QFile &f)
568 t << "% Latex footer for doxygen " << versionString << endl;
569 writeDefaultFooter(t);
572 void LatexGenerator::writeStyleSheetFile(QFile &f)
575 t << "% stylesheet for doxygen " << versionString << endl;
576 writeDefaultStyleSheet(t);
579 void LatexGenerator::startFile(const char *name,const char *,const char *)
582 setEncoding(Config_getString("LATEX_OUTPUT_ENCODING"));
584 QCString fileName=name;
585 relPath = relativePathToRoot(fileName);
586 sourceFileName = stripPath(fileName);
587 if (fileName.right(4)!=".tex" && fileName.right(4)!=".sty") fileName+=".tex";
588 startPlainFile(fileName);
591 void LatexGenerator::endFile()
594 sourceFileName.resize(0);
597 //void LatexGenerator::writeIndex()
599 // startFile("refman.tex");
602 void LatexGenerator::startProjectNumber()
604 t << "\\\\[1ex]\\large ";
607 static QCString convertToLaTeX(const QCString &s)
610 FTextStream t(&result);
611 filterLatexString(t,s,FALSE,FALSE,FALSE);
612 return result.data();
615 void LatexGenerator::startIndexSection(IndexSections is)
617 bool &compactLatex = Config_getBool("COMPACT_LATEX");
618 QCString &latexHeader = Config_getString("LATEX_HEADER");
621 case isTitlePageStart:
623 if (latexHeader.isEmpty())
625 writeDefaultHeaderPart1(t);
629 QCString header = fileToString(latexHeader);
630 t << substituteKeywords(header,"",
631 convertToLaTeX(Config_getString("PROJECT_NAME")),
632 convertToLaTeX(Config_getString("PROJECT_NUMBER")),
633 convertToLaTeX(Config_getString("PROJECT_BRIEF")));
637 case isTitlePageAuthor:
638 if (latexHeader.isEmpty())
640 writeDefaultHeaderPart2(t);
644 if (compactLatex) t << "\\section"; else t << "\\chapter";
645 t << "{"; //Introduction}\n"
647 //case isPackageIndex:
648 // if (compactLatex) t << "\\section"; else t << "\\chapter";
649 // t << "{"; //Package Index}\n"
652 if (compactLatex) t << "\\section"; else t << "\\chapter";
653 t << "{"; //Module Index}\n"
656 if (compactLatex) t << "\\section"; else t << "\\chapter";
657 t << "{"; //Directory Index}\n"
659 case isNamespaceIndex:
660 if (compactLatex) t << "\\section"; else t << "\\chapter";
661 t << "{"; //Namespace Index}\"
663 case isClassHierarchyIndex:
664 if (compactLatex) t << "\\section"; else t << "\\chapter";
665 t << "{"; //Hierarchical Index}\n"
667 case isCompoundIndex:
668 if (compactLatex) t << "\\section"; else t << "\\chapter";
669 t << "{"; //Annotated Compound Index}\n"
672 if (compactLatex) t << "\\section"; else t << "\\chapter";
673 t << "{"; //Annotated File Index}\n"
676 if (compactLatex) t << "\\section"; else t << "\\chapter";
677 t << "{"; //Annotated Page Index}\n"
679 case isModuleDocumentation:
681 GroupSDict::Iterator gli(*Doxygen::groupSDict);
684 for (gli.toFirst();(gd=gli.current()) && !found;++gli)
686 if (!gd->isReference())
688 if (compactLatex) t << "\\section"; else t << "\\chapter";
689 t << "{"; //Module Documentation}\n";
695 case isDirDocumentation:
697 SDict<DirDef>::Iterator dli(*Doxygen::directories);
700 for (dli.toFirst();(dd=dli.current()) && !found;++dli)
702 if (dd->isLinkableInProject())
704 if (compactLatex) t << "\\section"; else t << "\\chapter";
705 t << "{"; //Module Documentation}\n";
711 case isNamespaceDocumentation:
713 NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
716 for (nli.toFirst();(nd=nli.current()) && !found;++nli)
718 if (nd->isLinkableInProject())
720 if (compactLatex) t << "\\section"; else t << "\\chapter";
721 t << "{"; // Namespace Documentation}\n":
727 case isClassDocumentation:
729 ClassSDict::Iterator cli(*Doxygen::classSDict);
732 for (cli.toFirst();(cd=cli.current()) && !found;++cli)
734 if (cd->isLinkableInProject() &&
735 cd->templateMaster()==0 &&
736 !cd->isEmbeddedInOuterScope()
739 if (compactLatex) t << "\\section"; else t << "\\chapter";
740 t << "{"; //Compound Documentation}\n";
746 case isFileDocumentation:
749 FileNameListIterator fnli(*Doxygen::inputNameList);
751 for (fnli.toFirst();(fn=fnli.current());++fnli)
753 FileNameIterator fni(*fn);
755 for (;(fd=fni.current());++fni)
757 if (fd->isLinkableInProject())
761 if (compactLatex) t << "\\section"; else t << "\\chapter";
762 t << "{"; //File Documentation}\n";
771 case isExampleDocumentation:
773 if (compactLatex) t << "\\section"; else t << "\\chapter";
774 t << "{"; //Example Documentation}\n";
777 case isPageDocumentation:
779 if (compactLatex) t << "\\section"; else t << "\\chapter";
780 t << "{"; //Page Documentation}\n";
783 case isPageDocumentation2:
790 void LatexGenerator::endIndexSection(IndexSections is)
792 //static bool compactLatex = Config_getBool("COMPACT_LATEX");
793 static bool sourceBrowser = Config_getBool("SOURCE_BROWSER");
794 static QCString latexHeader = Config_getString("LATEX_HEADER");
795 static QCString latexFooter = Config_getString("LATEX_FOOTER");
798 case isTitlePageStart:
800 case isTitlePageAuthor:
801 if (latexHeader.isEmpty())
803 writeDefaultHeaderPart3(t);
808 //QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index";
809 QCString indexName="index";
810 t << "}\n\\label{index}";
811 if (Config_getBool("PDF_HYPERLINKS")) t << "\\hypertarget{index}{}";
812 t << "\\input{" << indexName << "}\n";
816 t << "}\n\\input{modules}\n";
819 t << "}\n\\input{dirs}\n";
821 case isNamespaceIndex:
822 t << "}\n\\input{namespaces}\n";
824 case isClassHierarchyIndex:
825 t << "}\n\\input{hierarchy}\n";
827 case isCompoundIndex:
828 t << "}\n\\input{annotated}\n";
831 t << "}\n\\input{files}\n";
834 t << "}\n\\input{pages}\n";
836 case isModuleDocumentation:
838 GroupSDict::Iterator gli(*Doxygen::groupSDict);
841 for (gli.toFirst();(gd=gli.current()) && !found;++gli)
843 if (!gd->isReference())
845 t << "}\n\\input{" << gd->getOutputFileBase() << "}\n";
849 for (;(gd=gli.current());++gli)
851 if (!gd->isReference())
853 //if (compactLatex) t << "\\input"; else t << "\\include";
855 t << "{" << gd->getOutputFileBase() << "}\n";
860 case isDirDocumentation:
862 SDict<DirDef>::Iterator dli(*Doxygen::directories);
865 for (dli.toFirst();(dd=dli.current()) && !found;++dli)
867 if (dd->isLinkableInProject())
869 t << "}\n\\input{" << dd->getOutputFileBase() << "}\n";
873 for (;(dd=dli.current());++dli)
875 if (dd->isLinkableInProject())
877 //if (compactLatex) t << "\\input"; else t << "\\include";
879 t << "{" << dd->getOutputFileBase() << "}\n";
884 case isNamespaceDocumentation:
886 NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
889 for (nli.toFirst();(nd=nli.current()) && !found;++nli)
891 if (nd->isLinkableInProject())
893 t << "}\n\\input{" << nd->getOutputFileBase() << "}\n";
897 while ((nd=nli.current()))
899 if (nd->isLinkableInProject())
901 //if (compactLatex) t << "\\input"; else t << "\\include";
903 t << "{" << nd->getOutputFileBase() << "}\n";
909 case isClassDocumentation:
911 ClassSDict::Iterator cli(*Doxygen::classSDict);
914 for (cli.toFirst();(cd=cli.current()) && !found;++cli)
916 if (cd->isLinkableInProject() &&
917 cd->templateMaster()==0 &&
918 !cd->isEmbeddedInOuterScope()
921 t << "}\n\\input{" << cd->getOutputFileBase() << "}\n";
925 for (;(cd=cli.current());++cli)
927 if (cd->isLinkableInProject() &&
928 cd->templateMaster()==0 &&
929 !cd->isEmbeddedInOuterScope()
932 //if (compactLatex) t << "\\input"; else t << "\\include";
934 t << "{" << cd->getOutputFileBase() << "}\n";
939 case isFileDocumentation:
942 FileNameListIterator fnli(*Doxygen::inputNameList);
944 for (fnli.toFirst();(fn=fnli.current());++fnli)
946 FileNameIterator fni(*fn);
948 for (;(fd=fni.current());++fni)
950 if (fd->isLinkableInProject())
954 t << "}\n\\input{" << fd->getOutputFileBase() << "}\n";
955 if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
957 //t << "\\include{" << fd->getSourceFileBase() << "}\n";
958 t << "\\input{" << fd->getSourceFileBase() << "}\n";
964 //if (compactLatex) t << "\\input" ; else t << "\\include";
966 t << "{" << fd->getOutputFileBase() << "}\n";
967 if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
969 //t << "\\include{" << fd->getSourceFileBase() << "}\n";
970 t << "\\input{" << fd->getSourceFileBase() << "}\n";
978 case isExampleDocumentation:
981 PageSDict::Iterator pdi(*Doxygen::exampleSDict);
982 PageDef *pd=pdi.toFirst();
985 t << "\\input{" << pd->getOutputFileBase() << "}\n";
987 for (++pdi;(pd=pdi.current());++pdi)
989 //if (compactLatex) t << "\\input" ; else t << "\\include";
991 t << "{" << pd->getOutputFileBase() << "}\n";
995 case isPageDocumentation:
999 PageSDict::Iterator pdi(*Doxygen::pageSDict);
1000 PageDef *pd=pdi.toFirst();
1002 for (pdi.toFirst();(pd=pdi.current());++pdi)
1004 if (!pd->getGroupDef() && !pd->isReference())
1006 if (compactLatex) t << "\\section"; else t << "\\chapter";
1007 t << "{" << pd->title();
1010 if (compactLatex || first) t << "\\input" ; else t << "\\include";
1011 t << "{" << pd->getOutputFileBase() << "}\n";
1018 case isPageDocumentation2:
1021 if (latexFooter.isEmpty())
1023 writeDefaultFooter(t);
1027 QCString footer = fileToString(latexFooter);
1028 t << substituteKeywords(footer,"",
1029 convertToLaTeX(Config_getString("PROJECT_NAME")),
1030 convertToLaTeX(Config_getString("PROJECT_NUMBER")),
1031 convertToLaTeX(Config_getString("PROJECT_BRIEF")));
1037 void LatexGenerator::writePageLink(const char *name, bool /*first*/)
1039 //bool &compactLatex = Config_getBool("COMPACT_LATEX");
1040 // next is remove for bug615957
1041 //if (compactLatex || first) t << "\\input" ; else t << "\\include";
1043 t << "{" << name << "}\n";
1047 void LatexGenerator::writeStyleInfo(int part)
1052 startPlainFile("doxygen.sty");
1053 writeDefaultStyleSheet(t);
1057 void LatexGenerator::newParagraph()
1062 void LatexGenerator::startParagraph()
1067 void LatexGenerator::endParagraph()
1072 void LatexGenerator::writeString(const char *text)
1077 void LatexGenerator::startIndexItem(const char *ref,const char *fn)
1082 t << "\\contentsline{section}{";
1086 void LatexGenerator::endIndexItem(const char *ref,const char *fn)
1090 t << "}{\\pageref{" << fn << "}}{}" << endl;
1094 //void LatexGenerator::writeIndexFileItem(const char *,const char *text)
1096 // t << "\\item\\contentsline{section}{";
1098 // t << "}{\\pageref{" << text << "}}" << endl;
1102 void LatexGenerator::startHtmlLink(const char *url)
1104 if (Config_getBool("PDF_HYPERLINKS"))
1113 void LatexGenerator::endHtmlLink()
1118 //void LatexGenerator::writeMailLink(const char *url)
1120 // if (Config_getBool("PDF_HYPERLINKS"))
1122 // t << "\\href{mailto:";
1131 void LatexGenerator::writeStartAnnoItem(const char *,const char *,
1132 const char *path,const char *name)
1134 t << "\\item\\contentsline{section}{\\bf ";
1135 if (path) docify(path);
1140 void LatexGenerator::writeEndAnnoItem(const char *name)
1142 t << "}{\\pageref{" << name << "}}{}" << endl;
1145 void LatexGenerator::startIndexKey()
1147 t << "\\item\\contentsline{section}{";
1150 void LatexGenerator::endIndexKey()
1154 void LatexGenerator::startIndexValue(bool hasBrief)
1157 if (hasBrief) t << "\\\\*";
1160 void LatexGenerator::endIndexValue(const char *name,bool /*hasBrief*/)
1162 //if (hasBrief) t << ")";
1163 t << "}{\\pageref{" << name << "}}{}" << endl;
1166 //void LatexGenerator::writeClassLink(const char *,const char *,
1167 // const char *,const char *name)
1174 void LatexGenerator::startTextLink(const char *f,const char *anchor)
1176 if (!disableLinks && Config_getBool("PDF_HYPERLINKS"))
1178 t << "\\hyperlink{";
1179 if (f) t << stripPath(f);
1180 if (anchor) t << "_" << anchor;
1189 void LatexGenerator::endTextLink()
1194 void LatexGenerator::writeObjectLink(const char *ref, const char *f,
1195 const char *anchor, const char *text)
1197 if (!disableLinks && !ref && Config_getBool("PDF_HYPERLINKS"))
1199 t << "\\hyperlink{";
1200 if (f) t << stripPath(f);
1201 if (f && anchor) t << "_";
1202 if (anchor) t << anchor;
1215 void LatexGenerator::startPageRef()
1217 t << " \\doxyref{}{";
1220 void LatexGenerator::endPageRef(const char *clname, const char *anchor)
1223 if (clname) t << clname;
1224 if (anchor) t << "_" << anchor;
1228 void LatexGenerator::writeCodeLink(const char *ref,const char *f,
1229 const char *anchor,const char *name,
1232 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1233 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1234 int l = qstrlen(name);
1240 if (/*m_prettyCode &&*/ !disableLinks && !ref && usePDFLatex && pdfHyperlinks)
1242 t << "\\hyperlink{";
1243 if (f) t << stripPath(f);
1244 if (f && anchor) t << "_";
1245 if (anchor) t << anchor;
1257 void LatexGenerator::startTitleHead(const char *fileName)
1259 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1260 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1261 if (usePDFLatex && pdfHyperlinks && fileName)
1263 t << "\\hypertarget{" << stripPath(fileName) << "}{";
1265 if (Config_getBool("COMPACT_LATEX"))
1267 t << "\\subsection{";
1275 void LatexGenerator::endTitleHead(const char *fileName,const char *name)
1277 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1278 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1282 t << "\\label{" << stripPath(fileName) << "}\\index{";
1283 escapeLabelName(name);
1285 escapeMakeIndexChars(name);
1288 if (usePDFLatex && pdfHyperlinks && fileName)
1294 void LatexGenerator::startTitle()
1296 if (Config_getBool("COMPACT_LATEX"))
1298 t << "\\subsection{";
1306 void LatexGenerator::startGroupHeader(int extraIndentLevel)
1308 if (Config_getBool("COMPACT_LATEX"))
1313 if (extraIndentLevel==3)
1315 t << "\\subparagraph*{";
1317 else if (extraIndentLevel==2)
1319 t << "\\paragraph{";
1321 else if (extraIndentLevel==1)
1323 t << "\\subsubsection{";
1325 else // extraIndentLevel==0
1327 t << "\\subsection{";
1332 void LatexGenerator::endGroupHeader(int)
1338 void LatexGenerator::startMemberHeader(const char *)
1340 if (Config_getBool("COMPACT_LATEX"))
1342 t << "\\subsubsection*{";
1346 t << "\\subsection*{";
1351 void LatexGenerator::endMemberHeader()
1357 void LatexGenerator::startMemberDoc(const char *clname,
1358 const char *memname,
1363 if (memname && memname[0]!='@')
1368 escapeLabelName(clname);
1370 escapeMakeIndexChars(clname);
1373 escapeLabelName(memname);
1375 escapeMakeIndexChars(memname);
1379 escapeLabelName(memname);
1381 escapeMakeIndexChars(memname);
1386 escapeLabelName(clname);
1388 escapeMakeIndexChars(clname);
1393 static const char *levelLab[] = { "subsubsection","paragraph","subparagraph", "subparagraph" };
1394 static bool compactLatex = Config_getBool("COMPACT_LATEX");
1396 if (showInline) level+=2;
1397 if (compactLatex) level++;
1398 t << "\\" << levelLab[level];
1400 //if (Config_getBool("PDF_HYPERLINKS") && memname)
1403 // escapeMakeIndexChars(this,t,memname);
1407 escapeMakeIndexChars(title);
1409 t << "{\\setlength{\\rightskip}{0pt plus 5cm}";
1413 void LatexGenerator::endMemberDoc(bool)
1417 //if (Config_getBool("COMPACT_LATEX")) t << "\\hfill";
1420 void LatexGenerator::startDoxyAnchor(const char *fName,const char *,
1421 const char *anchor, const char *,
1424 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1425 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1426 if (usePDFLatex && pdfHyperlinks)
1428 t << "\\hypertarget{";
1429 if (fName) t << stripPath(fName);
1430 if (anchor) t << "_" << anchor;
1435 void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor)
1437 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1438 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1439 if (usePDFLatex && pdfHyperlinks)
1444 if (fName) t << stripPath(fName);
1445 if (anchor) t << "_" << anchor;
1449 void LatexGenerator::writeAnchor(const char *fName,const char *name)
1451 //printf("LatexGenerator::writeAnchor(%s,%s)\n",fName,name);
1452 t << "\\label{" << name << "}" << endl;
1453 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1454 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1455 if (usePDFLatex && pdfHyperlinks)
1459 t << "\\hypertarget{" << stripPath(fName) << "_" << name << "}{}" << endl;
1463 t << "\\hypertarget{" << name << "}{}" << endl;
1469 //void LatexGenerator::writeLatexLabel(const char *clName,const char *anchor)
1471 // writeDoxyAnchor(0,clName,anchor,0);
1474 void LatexGenerator::addIndexItem(const char *s1,const char *s2)
1479 escapeLabelName(s1);
1481 escapeMakeIndexChars(s1);
1486 escapeLabelName(s2);
1488 escapeMakeIndexChars(s2);
1496 void LatexGenerator::startSection(const char *lab,const char *,SectionInfo::SectionType type)
1498 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1499 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1500 if (usePDFLatex && pdfHyperlinks)
1502 t << "\\hypertarget{" << stripPath(lab) << "}{}";
1505 if (Config_getBool("COMPACT_LATEX"))
1509 case SectionInfo::Page: t << "subsection"; break;
1510 case SectionInfo::Section: t << "subsubsection"; break;
1511 case SectionInfo::Subsection: t << "paragraph"; break;
1512 case SectionInfo::Subsubsection: t << "subparagraph"; break;
1513 case SectionInfo::Paragraph: t << "subparagraph"; break;
1514 default: ASSERT(0); break;
1522 case SectionInfo::Page: t << "section"; break;
1523 case SectionInfo::Section: t << "subsection"; break;
1524 case SectionInfo::Subsection: t << "subsubsection"; break;
1525 case SectionInfo::Subsubsection: t << "paragraph"; break;
1526 case SectionInfo::Paragraph: t << "subparagraph"; break;
1527 default: ASSERT(0); break;
1533 void LatexGenerator::endSection(const char *lab,SectionInfo::SectionType)
1535 t << "}\\label{" << lab << "}" << endl;
1539 void LatexGenerator::docify(const char *str)
1541 filterLatexString(t,str,insideTabbing,FALSE,FALSE);
1544 void LatexGenerator::codify(const char *str)
1551 int spacesToNextTabStop;
1552 static int tabSize = Config_getInt("TAB_SIZE");
1553 const int maxLineLen = 108;
1554 QCString result(4*maxLineLen+1); // worst case for 1 line of 4-byte chars
1560 case 0x0c: p++; // remove ^L
1562 case '\t': spacesToNextTabStop =
1563 tabSize - (col%tabSize);
1564 t << Doxygen::spaces.left(spacesToNextTabStop);
1565 col+=spacesToNextTabStop;
1568 case '\n': t << '\n'; col=0; p++;
1574 // helper macro to copy a single utf8 character, dealing with multibyte chars.
1575 #define COPYCHAR() do { \
1576 result[i++]=c; p++; \
1577 if (c<0) /* multibyte utf-8 character */ \
1579 /* 1xxx.xxxx: >=2 byte character */ \
1581 if (((uchar)c&0xE0)==0xE0) \
1583 /* 111x.xxxx: >=3 byte character */ \
1586 if (((uchar)c&0xF0)==0xF0) \
1588 /* 1111.xxxx: 4 byte character */ \
1595 // gather characters until we find whitespace or are at
1596 // the end of a line
1598 if (col>=maxLineLen) // force line break
1603 else // copy more characters
1605 while (col<maxLineLen && (c=*p) &&
1606 c!=0x0c && c!='\t' && c!='\n' && c!=' '
1611 if (col>=maxLineLen) // force line break
1617 result[i]=0; // add terminator
1620 filterLatexString(t,result,insideTabbing,TRUE);
1632 void LatexGenerator::writeChar(char c)
1640 void LatexGenerator::startClassDiagram()
1642 //if (Config_getBool("COMPACT_LATEX")) t << "\\subsubsection"; else t << "\\subsection";
1646 void LatexGenerator::endClassDiagram(const ClassDiagram &d,
1647 const char *fileName,const char *)
1649 d.writeFigure(t,dir,fileName);
1653 void LatexGenerator::startAnonTypeScope(int indent)
1657 t << "\\begin{tabbing}" << endl;
1658 t << "xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=\\kill" << endl;
1664 void LatexGenerator::endAnonTypeScope(int indent)
1668 t << endl << "\\end{tabbing}";
1669 insideTabbing=FALSE;
1674 void LatexGenerator::startMemberTemplateParams()
1676 if (templateMemberItem)
1678 t << "{\\footnotesize ";
1682 void LatexGenerator::endMemberTemplateParams(const char *,const char *)
1684 if (templateMemberItem)
1690 void LatexGenerator::startMemberItem(const char *,int annoType,const char *)
1692 //printf("LatexGenerator::startMemberItem(%d)\n",annType);
1695 t << "\\item " << endl;
1696 templateMemberItem = (annoType == 3);
1700 void LatexGenerator::endMemberItem()
1706 templateMemberItem = FALSE;
1710 void LatexGenerator::startMemberDescription(const char *,const char *)
1714 t << "\\begin{DoxyCompactList}\\small\\item\\em ";
1718 for (int i=0;i<m_indent+2;i++) t << "\\>";
1723 void LatexGenerator::endMemberDescription()
1727 //t << "\\item\\end{DoxyCompactList}";
1728 t << "\\end{DoxyCompactList}";
1737 void LatexGenerator::writeNonBreakableSpace(int)
1739 //printf("writeNonBreakbleSpace()\n");
1750 void LatexGenerator::startMemberList()
1754 t << "\\begin{DoxyCompactItemize}" << endl;
1758 void LatexGenerator::endMemberList()
1760 //printf("LatexGenerator::endMemberList(%d)\n",insideTabbing);
1763 t << "\\end{DoxyCompactItemize}" << endl;
1768 void LatexGenerator::startMemberGroupHeader(bool hasHeader)
1770 if (hasHeader) t << "\\begin{Indent}";
1772 // changed back to rev 756 due to bug 660501
1773 //if (Config_getBool("COMPACT_LATEX"))
1775 // t << "\\subparagraph*{";
1779 // t << "\\paragraph*{";
1783 void LatexGenerator::endMemberGroupHeader()
1785 // changed back to rev 756 due to bug 660501
1786 t << "}\\par" << endl;
1790 void LatexGenerator::startMemberGroupDocs()
1795 void LatexGenerator::endMemberGroupDocs()
1800 void LatexGenerator::startMemberGroup()
1804 void LatexGenerator::endMemberGroup(bool hasHeader)
1806 if (hasHeader)t << "\\end{Indent}";
1810 void LatexGenerator::startDotGraph()
1815 void LatexGenerator::endDotGraph(const DotClassGraph &g)
1817 g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString("LATEX_OUTPUT"),fileName,relPath);
1820 void LatexGenerator::startInclDepGraph()
1824 void LatexGenerator::endInclDepGraph(const DotInclDepGraph &g)
1826 g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString("LATEX_OUTPUT"),fileName,relPath);
1829 void LatexGenerator::startGroupCollaboration()
1833 void LatexGenerator::endGroupCollaboration(const DotGroupCollaboration &g)
1835 g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString("LATEX_OUTPUT"),fileName,relPath);
1838 void LatexGenerator::startCallGraph()
1842 void LatexGenerator::endCallGraph(const DotCallGraph &g)
1844 g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString("LATEX_OUTPUT"),fileName,relPath);
1847 void LatexGenerator::startDirDepGraph()
1851 void LatexGenerator::endDirDepGraph(const DotDirDeps &g)
1853 g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString("LATEX_OUTPUT"),fileName,relPath);
1856 void LatexGenerator::startDescription()
1858 t << "\\begin{description}" << endl;
1861 void LatexGenerator::endDescription()
1863 t << "\\end{description}" << endl;
1867 void LatexGenerator::startDescItem()
1873 void LatexGenerator::endDescItem()
1878 firstDescItem=FALSE;
1886 void LatexGenerator::startSimpleSect(SectionTypes,const char *file,
1887 const char *anchor,const char *title)
1889 t << "\\begin{Desc}\n\\item[";
1892 writeObjectLink(0,file,anchor,title);
1901 void LatexGenerator::endSimpleSect()
1903 t << "\\end{Desc}" << endl;
1906 void LatexGenerator::startParamList(ParamListTypes,const char *title)
1908 t << "\\begin{Desc}\n\\item[";
1913 void LatexGenerator::endParamList()
1915 t << "\\end{Desc}" << endl;
1918 void LatexGenerator::startParameterList(bool openBracket)
1920 /* start of ParameterType ParameterName list */
1921 if (openBracket) t << "(";
1922 t << endl << "\\begin{DoxyParamCaption}" << endl;
1925 void LatexGenerator::endParameterList()
1929 void LatexGenerator::startParameterType(bool first,const char *key)
1932 if (!first && key) t << key;
1935 void LatexGenerator::endParameterType()
1940 void LatexGenerator::startParameterName(bool /*oneArgOnly*/)
1945 void LatexGenerator::endParameterName(bool last,bool /* emptyList */,bool closeBracket)
1951 t << "\\end{DoxyParamCaption}" << endl;
1952 if (closeBracket) t << ")";
1956 void LatexGenerator::exceptionEntry(const char* prefix,bool closeBracket)
1960 else if (closeBracket)
1965 void LatexGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *)
1967 LatexDocVisitor *visitor =
1968 new LatexDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""),insideTabbing);
1973 void LatexGenerator::startConstraintList(const char *header)
1975 t << "\\begin{Desc}\n\\item[";
1978 t << "\\begin{description}" << endl;
1981 void LatexGenerator::startConstraintParam()
1983 t << "\\item[{\\em ";
1986 void LatexGenerator::endConstraintParam()
1990 void LatexGenerator::startConstraintType()
1995 void LatexGenerator::endConstraintType()
2000 void LatexGenerator::startConstraintDocs()
2004 void LatexGenerator::endConstraintDocs()
2008 void LatexGenerator::endConstraintList()
2010 t << "\\end{description}" << endl;
2011 t << "\\end{Desc}" << endl;
2014 void LatexGenerator::escapeLabelName(const char *s)
2019 QCString result(qstrlen(s)+1); // worst case allocation
2025 case '|': t << "\\texttt{\"|}"; break;
2026 case '!': t << "\"!"; break;
2027 case '%': t << "\\%"; break;
2028 case '{': t << "\\lcurly{}"; break;
2029 case '}': t << "\\rcurly{}"; break;
2030 case '~': t << "````~"; break; // to get it a bit better in index together with other special characters
2031 // NOTE: adding a case here, means adding it to while below as well!
2034 // collect as long string as possible, before handing it to docify
2036 while ((c=*p) && c!='|' && c!='!' && c!='%' && c!='{' && c!='}' && c!='~')
2048 void LatexGenerator::escapeMakeIndexChars(const char *s)
2053 QCString result(qstrlen(s)+1); // worst case allocation
2059 case '!': t << "\"!"; break;
2060 case '"': t << "\"\""; break;
2061 case '@': t << "\"@"; break;
2062 case '|': t << "\\texttt{\"|}"; break;
2063 case '[': t << "["; break;
2064 case ']': t << "]"; break;
2065 case '{': t << "\\lcurly{}"; break;
2066 case '}': t << "\\rcurly{}"; break;
2067 // NOTE: adding a case here, means adding it to while below as well!
2070 // collect as long string as possible, before handing it to docify
2072 while ((c=*p) && c!='"' && c!='@' && c!='[' && c!=']' && c!='!' && c!='{' && c!='}' && c!='|')
2084 void LatexGenerator::startCodeFragment()
2086 t << "\n\\begin{DoxyCode}\n";
2089 void LatexGenerator::endCodeFragment()
2091 t << "\\end{DoxyCode}\n";
2094 void LatexGenerator::writeLineNumber(const char *ref,const char *fileName,const char *anchor,int l)
2096 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
2097 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
2100 QCString lineNumber;
2101 lineNumber.sprintf("%05d",l);
2103 if (fileName && !sourceFileName.isEmpty())
2105 QCString lineAnchor;
2106 lineAnchor.sprintf("_l%05d",l);
2107 lineAnchor.prepend(sourceFileName);
2108 //if (!m_prettyCode) return;
2109 if (usePDFLatex && pdfHyperlinks)
2111 t << "\\hypertarget{" << stripPath(lineAnchor) << "}{}";
2113 writeCodeLink(ref,fileName,anchor,lineNumber,0);
2127 void LatexGenerator::startCodeLine(bool)
2132 void LatexGenerator::endCodeLine()
2137 void LatexGenerator::startFontClass(const char *name)
2139 //if (!m_prettyCode) return;
2140 t << "\\textcolor{" << name << "}{";
2143 void LatexGenerator::endFontClass()
2145 //if (!m_prettyCode) return;
2149 void LatexGenerator::startInlineHeader()
2151 if (Config_getBool("COMPACT_LATEX"))
2153 t << "\\paragraph*{";
2157 t << "\\subsubsection*{";
2161 void LatexGenerator::endInlineHeader()
2166 void LatexGenerator::lineBreak(const char *)
2178 void LatexGenerator::startMemberDocSimple()
2180 t << "\\begin{DoxyFields}{";
2181 docify(theTranslator->trCompoundMembers());
2185 void LatexGenerator::endMemberDocSimple()
2187 t << "\\end{DoxyFields}" << endl;
2190 void LatexGenerator::startInlineMemberType()
2194 void LatexGenerator::endInlineMemberType()
2199 void LatexGenerator::startInlineMemberName()
2203 void LatexGenerator::endInlineMemberName()
2208 void LatexGenerator::startInlineMemberDoc()
2212 void LatexGenerator::endInlineMemberDoc()
2214 t << "\\\\\n\\hline\n" << endl;
2217 void LatexGenerator::startLabels()
2219 t << "\\hspace{0.3cm}";
2222 void LatexGenerator::writeLabel(const char *l,bool isLast)
2224 t << "{\\ttfamily [" << l << "]}";
2225 if (!isLast) t << ", ";
2228 void LatexGenerator::endLabels()