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 << "del /s /f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf\n\n";
190 if (!Config_getBool("USE_PDFLATEX")) // use plain old latex
192 t << latex_command << " refman.tex\n";
194 t << mkidx_command << " refman.idx\n";
197 t << "bibtex refman\n";
199 t << latex_command << " refman.tex\n";
201 t << "setlocal enabledelayedexpansion\n";
202 t << "set count=8\n";
204 t << "set content=X\n";
205 t << "for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\n";
206 t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\n";
207 t << "if !content! == X goto :skip\n";
208 t << "set /a count-=1\n";
209 t << "if !count! EQU 0 goto :skip\n\n";
211 t << latex_command << " refman.tex\n";
212 t << "goto :repeat\n";
215 t << mkidx_command << " refman.idx\n";
216 t << latex_command << " refman.tex\n";
217 t << "dvips -o refman.ps refman.dvi\n";
218 t << "gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "
219 "-sOutputFile=refman.pdf -c save pop -f refman.ps\n";
223 t << "pdflatex refman\n";
225 t << mkidx_command << " refman.idx\n";
228 t << "bibtex refman" << endl;
229 t << "pdflatex refman" << endl;
232 t << "pdflatex refman\n\n";
233 t << "setlocal enabledelayedexpansion\n";
234 t << "set count=8\n";
236 t << "set content=X\n";
237 t << "for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\n";
238 t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\n";
239 t << "if !content! == X goto :skip\n";
240 t << "set /a count-=1\n";
241 t << "if !count! EQU 0 goto :skip\n\n";
243 t << "pdflatex refman\n";
244 t << "goto :repeat\n";
247 t << mkidx_command << " refman.idx\n";
248 t << "pdflatex refman\n";
253 void LatexGenerator::init()
256 QCString dir=Config_getString("LATEX_OUTPUT");
258 if (!d.exists() && !d.mkdir(dir))
260 err("Could not create output directory %s\n",dir.data());
264 writeLatexMakefile();
270 static void writeDefaultHeaderPart1(FTextStream &t)
275 if (Config_getBool("LATEX_BATCHMODE"))
276 t << "\\batchmode\n";
278 // Set document class depending on configuration
279 QCString documentClass;
280 if (Config_getBool("COMPACT_LATEX"))
281 documentClass = "article";
283 documentClass = "book";
284 t << "\\documentclass[twoside]{" << documentClass << "}\n"
287 // Load required packages
288 t << "% Packages required by doxygen\n"
289 "\\usepackage{calc}\n"
290 "\\usepackage{doxygen}\n"
291 "\\usepackage{graphicx}\n"
292 "\\usepackage[utf8]{inputenc}\n"
293 "\\usepackage{makeidx}\n"
294 "\\usepackage{multicol}\n"
295 "\\usepackage{multirow}\n"
296 "\\usepackage{fixltx2e}\n" // for \textsubscript
297 "\\PassOptionsToPackage{warn}{textcomp}\n"
298 "\\usepackage{textcomp}\n"
299 "\\usepackage[nointegrals]{wasysym}\n"
300 "\\usepackage[table]{xcolor}\n"
304 QCString languageSupport = theTranslator->latexLanguageSupportCommand();
305 if (!languageSupport.isEmpty())
307 t << "% NLS support packages\n"
312 // Define default fonts
313 t << "% Font selection\n"
314 "\\usepackage[T1]{fontenc}\n"
315 "\\usepackage{mathptmx}\n"
316 "\\usepackage[scaled=.90]{helvet}\n"
317 "\\usepackage{courier}\n"
318 "\\usepackage{amssymb}\n"
319 "\\usepackage{sectsty}\n"
320 "\\renewcommand{\\familydefault}{\\sfdefault}\n"
321 "\\allsectionsfont{%\n"
322 " \\fontseries{bc}\\selectfont%\n"
323 " \\color{darkgray}%\n"
325 "\\renewcommand{\\DoxyLabelFont}{%\n"
326 " \\fontseries{bc}\\selectfont%\n"
327 " \\color{darkgray}%\n"
329 "\\newcommand{\\+}{\\discretionary{\\mbox{\\scriptsize$\\hookleftarrow$}}{}{}}\n"
332 // Define page & text layout
334 QCString &paperType=Config_getEnum("PAPER_TYPE");
335 // "a4wide" package is obsolete (see bug 563698)
336 if (paperType=="a4wide")
340 t << "% Page & text layout\n"
341 "\\usepackage{geometry}\n"
343 " " << paperName << "paper,%\n"
349 // \sloppy is obsolete (see bug 563698)
350 // Allow a bit of overflow to go unnoticed by other means
351 t << "\\tolerance=750\n"
354 "\\setlength{\\emergencystretch}{15pt}\n"
355 "\\setlength{\\parindent}{0cm}\n"
356 "\\setlength{\\parskip}{0.2cm}\n";
357 // Redefine paragraph/subparagraph environments, using sectsty fonts
358 t << "\\makeatletter\n"
359 "\\renewcommand{\\paragraph}{%\n"
360 " \\@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%\n"
361 " \\normalfont\\normalsize\\bfseries\\SS@parafont%\n"
364 "\\renewcommand{\\subparagraph}{%\n"
365 " \\@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{%\n"
366 " \\normalfont\\normalsize\\bfseries\\SS@subparafont%\n"
374 FTextStream tg(&genString);
375 filterLatexString(tg,
376 theTranslator->trGeneratedAt(dateToString(TRUE),
377 Config_getString("PROJECT_NAME")),
379 t << "% Headers & footers\n"
380 "\\usepackage{fancyhdr}\n"
381 "\\pagestyle{fancyplain}\n"
382 "\\fancyhead[LE]{\\fancyplain{}{\\bfseries\\thepage}}\n"
383 "\\fancyhead[CE]{\\fancyplain{}{}}\n"
384 "\\fancyhead[RE]{\\fancyplain{}{\\bfseries\\leftmark}}\n"
385 "\\fancyhead[LO]{\\fancyplain{}{\\bfseries\\rightmark}}\n"
386 "\\fancyhead[CO]{\\fancyplain{}{}}\n"
387 "\\fancyhead[RO]{\\fancyplain{}{\\bfseries\\thepage}}\n"
388 "\\fancyfoot[LE]{\\fancyplain{}{}}\n"
389 "\\fancyfoot[CE]{\\fancyplain{}{}}\n"
390 "\\fancyfoot[RE]{\\fancyplain{}{\\bfseries\\scriptsize " << genString << " Doxygen }}\n"
391 "\\fancyfoot[LO]{\\fancyplain{}{\\bfseries\\scriptsize " << genString << " Doxygen }}\n"
392 "\\fancyfoot[CO]{\\fancyplain{}{}}\n"
393 "\\fancyfoot[RO]{\\fancyplain{}{}}\n"
394 "\\renewcommand{\\footrulewidth}{0.4pt}\n";
395 if (!Config_getBool("COMPACT_LATEX"))
397 t << "\\renewcommand{\\chaptermark}[1]{%\n"
398 " \\markboth{#1}{}%\n"
401 t << "\\renewcommand{\\sectionmark}[1]{%\n"
402 " \\markright{\\thesection\\ #1}%\n"
406 // ToC, LoF, LoT, bibliography, and index
407 t << "% Indices & bibliography\n"
408 "\\usepackage{natbib}\n"
409 "\\usepackage[titles]{tocloft}\n"
410 "\\setcounter{tocdepth}{3}\n"
411 "\\setcounter{secnumdepth}{5}\n"
415 // User-specified packages
416 QStrList &extraPackages = Config_getList("EXTRA_PACKAGES");
417 if (!extraPackages.isEmpty()) {
418 t << "% Packages requested by user\n";
419 const char *pkgName=extraPackages.first();
422 t << "\\usepackage{" << pkgName << "}\n";
423 pkgName=extraPackages.next();
429 bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
432 t << "% Hyperlinks (required, but should be loaded last)\n"
433 "\\usepackage{ifpdf}\n"
435 " \\usepackage[pdftex,pagebackref=true]{hyperref}\n"
437 " \\usepackage[ps2pdf,pagebackref=true]{hyperref}\n"
440 " colorlinks=true,%\n"
441 " linkcolor=blue,%\n"
442 " citecolor=blue,%\n"
448 // Custom commands used by the header
449 t << "% Custom commands\n"
450 "\\newcommand{\\clearemptydoublepage}{%\n"
451 " \\newpage{\\pagestyle{empty}\\cleardoublepage}%\n"
456 // End of preamble, now comes the document contents
457 t << "%===== C O N T E N T S =====\n"
459 "\\begin{document}\n";
460 if (theTranslator->idLanguage()=="greek")
461 t << "\\selectlanguage{greek}\n";
465 t << "% Titlepage & ToC\n";
466 bool usePDFLatex = Config_getBool("USE_PDFLATEX");
467 if (pdfHyperlinks && usePDFLatex)
469 // To avoid duplicate page anchors due to reuse of same numbers for
470 // the index (be it as roman numbers)
471 t << "\\hypersetup{pageanchor=false,\n"
472 << " bookmarks=true,\n"
473 << " bookmarksnumbered=true,\n"
474 << " pdfencoding=unicode\n"
477 t << "\\pagenumbering{roman}\n"
478 "\\begin{titlepage}\n"
484 static void writeDefaultHeaderPart2(FTextStream &t)
487 // Finalize project name
493 static void writeDefaultHeaderPart3(FTextStream &t)
496 // Finalize project number
497 t << " Doxygen " << versionString << "}\\\\\n"
499 "{\\small " << dateToString(TRUE) << "}\\\\\n"
501 "\\end{titlepage}\n";
502 bool compactLatex = Config_getBool("COMPACT_LATEX");
504 t << "\\clearemptydoublepage\n";
507 t << "\\tableofcontents\n";
509 t << "\\clearemptydoublepage\n";
510 t << "\\pagenumbering{arabic}\n";
511 bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
512 bool usePDFLatex = Config_getBool("USE_PDFLATEX");
513 if (pdfHyperlinks && usePDFLatex)
515 // re-enable anchors again
516 t << "\\hypersetup{pageanchor=true}\n";
519 "%--- Begin generated contents ---\n";
522 static void writeDefaultStyleSheet(FTextStream &t)
524 t << doxygenLatexStyle;
527 static void writeDefaultFooter(FTextStream &t)
529 t << "%--- End generated contents ---\n"
533 Doxygen::citeDict->writeLatexBibliography(t);
537 if (Config_getBool("COMPACT_LATEX"))
544 "\\addcontentsline{toc}{" << unit << "}{" << theTranslator->trRTFGeneralIndex() << "}\n"
550 void LatexGenerator::writeHeaderFile(QFile &f)
553 t << "% Latex header for doxygen " << versionString << endl;
554 writeDefaultHeaderPart1(t);
555 t << "Your title here";
556 writeDefaultHeaderPart2(t);
558 writeDefaultHeaderPart3(t);
561 void LatexGenerator::writeFooterFile(QFile &f)
564 t << "% Latex footer for doxygen " << versionString << endl;
565 writeDefaultFooter(t);
568 void LatexGenerator::writeStyleSheetFile(QFile &f)
571 t << "% stylesheet for doxygen " << versionString << endl;
572 writeDefaultStyleSheet(t);
575 void LatexGenerator::startFile(const char *name,const char *,const char *)
578 setEncoding(Config_getString("LATEX_OUTPUT_ENCODING"));
580 QCString fileName=name;
581 relPath = relativePathToRoot(fileName);
582 sourceFileName = stripPath(fileName);
583 if (fileName.right(4)!=".tex" && fileName.right(4)!=".sty") fileName+=".tex";
584 startPlainFile(fileName);
587 void LatexGenerator::endFile()
590 sourceFileName.resize(0);
593 //void LatexGenerator::writeIndex()
595 // startFile("refman.tex");
598 void LatexGenerator::startProjectNumber()
600 t << "\\\\[1ex]\\large ";
603 static QCString convertToLaTeX(const QCString &s)
606 FTextStream t(&result);
607 filterLatexString(t,s,FALSE,FALSE,FALSE);
608 return result.data();
611 void LatexGenerator::startIndexSection(IndexSections is)
613 bool &compactLatex = Config_getBool("COMPACT_LATEX");
614 QCString &latexHeader = Config_getString("LATEX_HEADER");
617 case isTitlePageStart:
619 if (latexHeader.isEmpty())
621 writeDefaultHeaderPart1(t);
625 QCString header = fileToString(latexHeader);
626 t << substituteKeywords(header,0,
627 convertToLaTeX(Config_getString("PROJECT_NAME")),
628 convertToLaTeX(Config_getString("PROJECT_NUMBER")),
629 convertToLaTeX(Config_getString("PROJECT_BRIEF")));
633 case isTitlePageAuthor:
634 if (latexHeader.isEmpty())
636 writeDefaultHeaderPart2(t);
640 if (compactLatex) t << "\\section"; else t << "\\chapter";
641 t << "{"; //Introduction}\n"
643 //case isPackageIndex:
644 // if (compactLatex) t << "\\section"; else t << "\\chapter";
645 // t << "{"; //Package Index}\n"
648 if (compactLatex) t << "\\section"; else t << "\\chapter";
649 t << "{"; //Module Index}\n"
652 if (compactLatex) t << "\\section"; else t << "\\chapter";
653 t << "{"; //Directory Index}\n"
655 case isNamespaceIndex:
656 if (compactLatex) t << "\\section"; else t << "\\chapter";
657 t << "{"; //Namespace Index}\"
659 case isClassHierarchyIndex:
660 if (compactLatex) t << "\\section"; else t << "\\chapter";
661 t << "{"; //Hierarchical Index}\n"
663 case isCompoundIndex:
664 if (compactLatex) t << "\\section"; else t << "\\chapter";
665 t << "{"; //Annotated Compound Index}\n"
668 if (compactLatex) t << "\\section"; else t << "\\chapter";
669 t << "{"; //Annotated File Index}\n"
672 if (compactLatex) t << "\\section"; else t << "\\chapter";
673 t << "{"; //Annotated Page Index}\n"
675 case isModuleDocumentation:
677 GroupSDict::Iterator gli(*Doxygen::groupSDict);
680 for (gli.toFirst();(gd=gli.current()) && !found;++gli)
682 if (!gd->isReference())
684 if (compactLatex) t << "\\section"; else t << "\\chapter";
685 t << "{"; //Module Documentation}\n";
691 case isDirDocumentation:
693 SDict<DirDef>::Iterator dli(*Doxygen::directories);
696 for (dli.toFirst();(dd=dli.current()) && !found;++dli)
698 if (dd->isLinkableInProject())
700 if (compactLatex) t << "\\section"; else t << "\\chapter";
701 t << "{"; //Module Documentation}\n";
707 case isNamespaceDocumentation:
709 NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
712 for (nli.toFirst();(nd=nli.current()) && !found;++nli)
714 if (nd->isLinkableInProject())
716 if (compactLatex) t << "\\section"; else t << "\\chapter";
717 t << "{"; // Namespace Documentation}\n":
723 case isClassDocumentation:
725 ClassSDict::Iterator cli(*Doxygen::classSDict);
728 for (cli.toFirst();(cd=cli.current()) && !found;++cli)
730 if (cd->isLinkableInProject() &&
731 cd->templateMaster()==0 &&
732 !cd->isEmbeddedInOuterScope()
735 if (compactLatex) t << "\\section"; else t << "\\chapter";
736 t << "{"; //Compound Documentation}\n";
742 case isFileDocumentation:
745 FileNameListIterator fnli(*Doxygen::inputNameList);
747 for (fnli.toFirst();(fn=fnli.current());++fnli)
749 FileNameIterator fni(*fn);
751 for (;(fd=fni.current());++fni)
753 if (fd->isLinkableInProject())
757 if (compactLatex) t << "\\section"; else t << "\\chapter";
758 t << "{"; //File Documentation}\n";
767 case isExampleDocumentation:
769 if (compactLatex) t << "\\section"; else t << "\\chapter";
770 t << "{"; //Example Documentation}\n";
773 case isPageDocumentation:
775 if (compactLatex) t << "\\section"; else t << "\\chapter";
776 t << "{"; //Page Documentation}\n";
779 case isPageDocumentation2:
786 void LatexGenerator::endIndexSection(IndexSections is)
788 //static bool compactLatex = Config_getBool("COMPACT_LATEX");
789 static bool sourceBrowser = Config_getBool("SOURCE_BROWSER");
790 static QCString latexHeader = Config_getString("LATEX_HEADER");
791 static QCString latexFooter = Config_getString("LATEX_FOOTER");
794 case isTitlePageStart:
796 case isTitlePageAuthor:
797 if (latexHeader.isEmpty())
799 writeDefaultHeaderPart3(t);
804 //QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index";
805 QCString indexName="index";
806 t << "}\n\\label{index}";
807 if (Config_getBool("PDF_HYPERLINKS")) t << "\\hypertarget{index}{}";
808 t << "\\input{" << indexName << "}\n";
812 t << "}\n\\input{modules}\n";
815 t << "}\n\\input{dirs}\n";
817 case isNamespaceIndex:
818 t << "}\n\\input{namespaces}\n";
820 case isClassHierarchyIndex:
821 t << "}\n\\input{hierarchy}\n";
823 case isCompoundIndex:
824 t << "}\n\\input{annotated}\n";
827 t << "}\n\\input{files}\n";
830 t << "}\n\\input{pages}\n";
832 case isModuleDocumentation:
834 GroupSDict::Iterator gli(*Doxygen::groupSDict);
837 for (gli.toFirst();(gd=gli.current()) && !found;++gli)
839 if (!gd->isReference())
841 t << "}\n\\input{" << gd->getOutputFileBase() << "}\n";
845 for (;(gd=gli.current());++gli)
847 if (!gd->isReference())
849 //if (compactLatex) t << "\\input"; else t << "\\include";
851 t << "{" << gd->getOutputFileBase() << "}\n";
856 case isDirDocumentation:
858 SDict<DirDef>::Iterator dli(*Doxygen::directories);
861 for (dli.toFirst();(dd=dli.current()) && !found;++dli)
863 if (dd->isLinkableInProject())
865 t << "}\n\\input{" << dd->getOutputFileBase() << "}\n";
869 for (;(dd=dli.current());++dli)
871 if (dd->isLinkableInProject())
873 //if (compactLatex) t << "\\input"; else t << "\\include";
875 t << "{" << dd->getOutputFileBase() << "}\n";
880 case isNamespaceDocumentation:
882 NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
885 for (nli.toFirst();(nd=nli.current()) && !found;++nli)
887 if (nd->isLinkableInProject())
889 t << "}\n\\input{" << nd->getOutputFileBase() << "}\n";
893 while ((nd=nli.current()))
895 if (nd->isLinkableInProject())
897 //if (compactLatex) t << "\\input"; else t << "\\include";
899 t << "{" << nd->getOutputFileBase() << "}\n";
905 case isClassDocumentation:
907 ClassSDict::Iterator cli(*Doxygen::classSDict);
910 for (cli.toFirst();(cd=cli.current()) && !found;++cli)
912 if (cd->isLinkableInProject() &&
913 cd->templateMaster()==0 &&
914 !cd->isEmbeddedInOuterScope()
917 t << "}\n\\input{" << cd->getOutputFileBase() << "}\n";
921 for (;(cd=cli.current());++cli)
923 if (cd->isLinkableInProject() &&
924 cd->templateMaster()==0 &&
925 !cd->isEmbeddedInOuterScope()
928 //if (compactLatex) t << "\\input"; else t << "\\include";
930 t << "{" << cd->getOutputFileBase() << "}\n";
935 case isFileDocumentation:
938 FileNameListIterator fnli(*Doxygen::inputNameList);
940 for (fnli.toFirst();(fn=fnli.current());++fnli)
942 FileNameIterator fni(*fn);
944 for (;(fd=fni.current());++fni)
946 if (fd->isLinkableInProject())
950 t << "}\n\\input{" << fd->getOutputFileBase() << "}\n";
951 if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
953 //t << "\\include{" << fd->getSourceFileBase() << "}\n";
954 t << "\\input{" << fd->getSourceFileBase() << "}\n";
960 //if (compactLatex) t << "\\input" ; else t << "\\include";
962 t << "{" << fd->getOutputFileBase() << "}\n";
963 if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
965 //t << "\\include{" << fd->getSourceFileBase() << "}\n";
966 t << "\\input{" << fd->getSourceFileBase() << "}\n";
974 case isExampleDocumentation:
977 PageSDict::Iterator pdi(*Doxygen::exampleSDict);
978 PageDef *pd=pdi.toFirst();
981 t << "\\input{" << pd->getOutputFileBase() << "}\n";
983 for (++pdi;(pd=pdi.current());++pdi)
985 //if (compactLatex) t << "\\input" ; else t << "\\include";
987 t << "{" << pd->getOutputFileBase() << "}\n";
991 case isPageDocumentation:
995 PageSDict::Iterator pdi(*Doxygen::pageSDict);
996 PageDef *pd=pdi.toFirst();
998 for (pdi.toFirst();(pd=pdi.current());++pdi)
1000 if (!pd->getGroupDef() && !pd->isReference())
1002 if (compactLatex) t << "\\section"; else t << "\\chapter";
1003 t << "{" << pd->title();
1006 if (compactLatex || first) t << "\\input" ; else t << "\\include";
1007 t << "{" << pd->getOutputFileBase() << "}\n";
1014 case isPageDocumentation2:
1017 if (latexFooter.isEmpty())
1019 writeDefaultFooter(t);
1023 QCString footer = fileToString(latexFooter);
1024 t << substituteKeywords(footer,0,
1025 convertToLaTeX(Config_getString("PROJECT_NAME")),
1026 convertToLaTeX(Config_getString("PROJECT_NUMBER")),
1027 convertToLaTeX(Config_getString("PROJECT_BRIEF")));
1033 void LatexGenerator::writePageLink(const char *name, bool /*first*/)
1035 //bool &compactLatex = Config_getBool("COMPACT_LATEX");
1036 // next is remove for bug615957
1037 //if (compactLatex || first) t << "\\input" ; else t << "\\include";
1039 t << "{" << name << "}\n";
1043 void LatexGenerator::writeStyleInfo(int part)
1048 startPlainFile("doxygen.sty");
1049 writeDefaultStyleSheet(t);
1053 void LatexGenerator::newParagraph()
1058 void LatexGenerator::startParagraph()
1063 void LatexGenerator::endParagraph()
1068 void LatexGenerator::writeString(const char *text)
1073 void LatexGenerator::startIndexItem(const char *ref,const char *fn)
1078 t << "\\contentsline{section}{";
1082 void LatexGenerator::endIndexItem(const char *ref,const char *fn)
1086 t << "}{\\pageref{" << fn << "}}{}" << endl;
1090 //void LatexGenerator::writeIndexFileItem(const char *,const char *text)
1092 // t << "\\item\\contentsline{section}{";
1094 // t << "}{\\pageref{" << text << "}}" << endl;
1098 void LatexGenerator::startHtmlLink(const char *url)
1100 if (Config_getBool("PDF_HYPERLINKS"))
1109 void LatexGenerator::endHtmlLink()
1114 //void LatexGenerator::writeMailLink(const char *url)
1116 // if (Config_getBool("PDF_HYPERLINKS"))
1118 // t << "\\href{mailto:";
1127 void LatexGenerator::writeStartAnnoItem(const char *,const char *,
1128 const char *path,const char *name)
1130 t << "\\item\\contentsline{section}{\\bf ";
1131 if (path) docify(path);
1136 void LatexGenerator::writeEndAnnoItem(const char *name)
1138 t << "}{\\pageref{" << name << "}}{}" << endl;
1141 void LatexGenerator::startIndexKey()
1143 t << "\\item\\contentsline{section}{";
1146 void LatexGenerator::endIndexKey()
1150 void LatexGenerator::startIndexValue(bool hasBrief)
1153 if (hasBrief) t << "\\\\*";
1156 void LatexGenerator::endIndexValue(const char *name,bool /*hasBrief*/)
1158 //if (hasBrief) t << ")";
1159 t << "}{\\pageref{" << name << "}}{}" << endl;
1162 //void LatexGenerator::writeClassLink(const char *,const char *,
1163 // const char *,const char *name)
1170 void LatexGenerator::startTextLink(const char *f,const char *anchor)
1172 if (!disableLinks && Config_getBool("PDF_HYPERLINKS"))
1174 t << "\\hyperlink{";
1175 if (f) t << stripPath(f);
1176 if (anchor) t << "_" << anchor;
1185 void LatexGenerator::endTextLink()
1190 void LatexGenerator::writeObjectLink(const char *ref, const char *f,
1191 const char *anchor, const char *text)
1193 if (!disableLinks && !ref && Config_getBool("PDF_HYPERLINKS"))
1195 t << "\\hyperlink{";
1196 if (f) t << stripPath(f);
1197 if (f && anchor) t << "_";
1198 if (anchor) t << anchor;
1211 void LatexGenerator::startPageRef()
1213 t << " \\doxyref{}{";
1216 void LatexGenerator::endPageRef(const char *clname, const char *anchor)
1219 if (clname) t << clname;
1220 if (anchor) t << "_" << anchor;
1224 void LatexGenerator::writeCodeLink(const char *ref,const char *f,
1225 const char *anchor,const char *name,
1228 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1229 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1230 int l = qstrlen(name);
1236 if (/*m_prettyCode &&*/ !disableLinks && !ref && usePDFLatex && pdfHyperlinks)
1238 t << "\\hyperlink{";
1239 if (f) t << stripPath(f);
1240 if (f && anchor) t << "_";
1241 if (anchor) t << anchor;
1253 void LatexGenerator::startTitleHead(const char *fileName)
1255 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1256 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1257 if (usePDFLatex && pdfHyperlinks && fileName)
1259 t << "\\hypertarget{" << stripPath(fileName) << "}{";
1261 if (Config_getBool("COMPACT_LATEX"))
1263 t << "\\subsection{";
1271 void LatexGenerator::endTitleHead(const char *fileName,const char *name)
1273 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1274 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1278 t << "\\label{" << stripPath(fileName) << "}\\index{";
1279 escapeLabelName(name);
1281 escapeMakeIndexChars(name);
1284 if (usePDFLatex && pdfHyperlinks && fileName)
1290 void LatexGenerator::startTitle()
1292 if (Config_getBool("COMPACT_LATEX"))
1294 t << "\\subsection{";
1302 void LatexGenerator::startGroupHeader(int extraIndentLevel)
1304 if (Config_getBool("COMPACT_LATEX"))
1309 if (extraIndentLevel==3)
1311 t << "\\subparagraph*{";
1313 else if (extraIndentLevel==2)
1315 t << "\\paragraph{";
1317 else if (extraIndentLevel==1)
1319 t << "\\subsubsection{";
1321 else // extraIndentLevel==0
1323 t << "\\subsection{";
1328 void LatexGenerator::endGroupHeader(int)
1334 void LatexGenerator::startMemberHeader(const char *)
1336 if (Config_getBool("COMPACT_LATEX"))
1338 t << "\\subsubsection*{";
1342 t << "\\subsection*{";
1347 void LatexGenerator::endMemberHeader()
1353 void LatexGenerator::startMemberDoc(const char *clname,
1354 const char *memname,
1359 if (memname && memname[0]!='@')
1364 escapeLabelName(clname);
1366 escapeMakeIndexChars(clname);
1369 escapeLabelName(memname);
1371 escapeMakeIndexChars(memname);
1375 escapeLabelName(memname);
1377 escapeMakeIndexChars(memname);
1382 escapeLabelName(clname);
1384 escapeMakeIndexChars(clname);
1389 static const char *levelLab[] = { "subsubsection","paragraph","subparagraph", "subparagraph" };
1390 static bool compactLatex = Config_getBool("COMPACT_LATEX");
1392 if (showInline) level+=2;
1393 if (compactLatex) level++;
1394 t << "\\" << levelLab[level];
1396 //if (Config_getBool("PDF_HYPERLINKS") && memname)
1399 // escapeMakeIndexChars(this,t,memname);
1403 escapeMakeIndexChars(title);
1405 t << "{\\setlength{\\rightskip}{0pt plus 5cm}";
1409 void LatexGenerator::endMemberDoc(bool)
1413 //if (Config_getBool("COMPACT_LATEX")) t << "\\hfill";
1416 void LatexGenerator::startDoxyAnchor(const char *fName,const char *,
1417 const char *anchor, const char *,
1420 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1421 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1422 if (usePDFLatex && pdfHyperlinks)
1424 t << "\\hypertarget{";
1425 if (fName) t << stripPath(fName);
1426 if (anchor) t << "_" << anchor;
1431 void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor)
1433 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1434 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1435 if (usePDFLatex && pdfHyperlinks)
1440 if (fName) t << stripPath(fName);
1441 if (anchor) t << "_" << anchor;
1445 void LatexGenerator::writeAnchor(const char *fName,const char *name)
1447 //printf("LatexGenerator::writeAnchor(%s,%s)\n",fName,name);
1448 t << "\\label{" << name << "}" << endl;
1449 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1450 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1451 if (usePDFLatex && pdfHyperlinks)
1455 t << "\\hypertarget{" << stripPath(fName) << "_" << name << "}{}" << endl;
1459 t << "\\hypertarget{" << name << "}{}" << endl;
1465 //void LatexGenerator::writeLatexLabel(const char *clName,const char *anchor)
1467 // writeDoxyAnchor(0,clName,anchor,0);
1470 void LatexGenerator::addIndexItem(const char *s1,const char *s2)
1475 escapeLabelName(s1);
1477 escapeMakeIndexChars(s1);
1482 escapeLabelName(s2);
1484 escapeMakeIndexChars(s2);
1492 void LatexGenerator::startSection(const char *lab,const char *,SectionInfo::SectionType type)
1494 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1495 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
1496 if (usePDFLatex && pdfHyperlinks)
1498 t << "\\hypertarget{" << stripPath(lab) << "}{}";
1501 if (Config_getBool("COMPACT_LATEX"))
1505 case SectionInfo::Page: t << "subsection"; break;
1506 case SectionInfo::Section: t << "subsubsection"; break;
1507 case SectionInfo::Subsection: t << "paragraph"; break;
1508 case SectionInfo::Subsubsection: t << "subparagraph"; break;
1509 case SectionInfo::Paragraph: t << "subparagraph"; break;
1510 default: ASSERT(0); break;
1518 case SectionInfo::Page: t << "section"; break;
1519 case SectionInfo::Section: t << "subsection"; break;
1520 case SectionInfo::Subsection: t << "subsubsection"; break;
1521 case SectionInfo::Subsubsection: t << "paragraph"; break;
1522 case SectionInfo::Paragraph: t << "subparagraph"; break;
1523 default: ASSERT(0); break;
1529 void LatexGenerator::endSection(const char *lab,SectionInfo::SectionType)
1531 t << "}\\label{" << lab << "}" << endl;
1535 void LatexGenerator::docify(const char *str)
1537 filterLatexString(t,str,insideTabbing,FALSE,FALSE);
1540 void LatexGenerator::codify(const char *str)
1547 int spacesToNextTabStop;
1548 static int tabSize = Config_getInt("TAB_SIZE");
1549 const int maxLineLen = 108;
1550 QCString result(4*maxLineLen+1); // worst case for 1 line of 4-byte chars
1556 case 0x0c: p++; // remove ^L
1558 case '\t': spacesToNextTabStop =
1559 tabSize - (col%tabSize);
1560 t << Doxygen::spaces.left(spacesToNextTabStop);
1561 col+=spacesToNextTabStop;
1564 case '\n': t << '\n'; col=0; p++;
1570 // helper macro to copy a single utf8 character, dealing with multibyte chars.
1571 #define COPYCHAR() do { \
1572 result[i++]=c; p++; \
1573 if (c<0) /* multibyte utf-8 character */ \
1575 /* 1xxx.xxxx: >=2 byte character */ \
1577 if (((uchar)c&0xE0)==0xE0) \
1579 /* 111x.xxxx: >=3 byte character */ \
1582 if (((uchar)c&0xF0)==0xF0) \
1584 /* 1111.xxxx: 4 byte character */ \
1591 // gather characters until we find whitespace or are at
1592 // the end of a line
1594 if (col>=maxLineLen) // force line break
1599 else // copy more characters
1601 while (col<maxLineLen && (c=*p) &&
1602 c!=0x0c && c!='\t' && c!='\n' && c!=' '
1607 if (col>=maxLineLen) // force line break
1613 result[i]=0; // add terminator
1616 filterLatexString(t,result,insideTabbing,TRUE);
1628 void LatexGenerator::writeChar(char c)
1636 void LatexGenerator::startClassDiagram()
1638 //if (Config_getBool("COMPACT_LATEX")) t << "\\subsubsection"; else t << "\\subsection";
1642 void LatexGenerator::endClassDiagram(const ClassDiagram &d,
1643 const char *fileName,const char *)
1645 d.writeFigure(t,dir,fileName);
1649 void LatexGenerator::startAnonTypeScope(int indent)
1653 t << "\\begin{tabbing}" << endl;
1654 t << "xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=\\kill" << endl;
1660 void LatexGenerator::endAnonTypeScope(int indent)
1664 t << endl << "\\end{tabbing}";
1665 insideTabbing=FALSE;
1670 void LatexGenerator::startMemberTemplateParams()
1672 if (templateMemberItem)
1674 t << "{\\footnotesize ";
1678 void LatexGenerator::endMemberTemplateParams(const char *,const char *)
1680 if (templateMemberItem)
1686 void LatexGenerator::startMemberItem(const char *,int annoType,const char *)
1688 //printf("LatexGenerator::startMemberItem(%d)\n",annType);
1691 t << "\\item " << endl;
1692 templateMemberItem = (annoType == 3);
1696 void LatexGenerator::endMemberItem()
1702 templateMemberItem = FALSE;
1706 void LatexGenerator::startMemberDescription(const char *,const char *)
1710 t << "\\begin{DoxyCompactList}\\small\\item\\em ";
1714 for (int i=0;i<m_indent+2;i++) t << "\\>";
1719 void LatexGenerator::endMemberDescription()
1723 //t << "\\item\\end{DoxyCompactList}";
1724 t << "\\end{DoxyCompactList}";
1733 void LatexGenerator::writeNonBreakableSpace(int)
1735 //printf("writeNonBreakbleSpace()\n");
1746 void LatexGenerator::startMemberList()
1750 t << "\\begin{DoxyCompactItemize}" << endl;
1754 void LatexGenerator::endMemberList()
1756 //printf("LatexGenerator::endMemberList(%d)\n",insideTabbing);
1759 t << "\\end{DoxyCompactItemize}" << endl;
1764 void LatexGenerator::startMemberGroupHeader(bool hasHeader)
1766 if (hasHeader) t << "\\begin{Indent}";
1768 // changed back to rev 756 due to bug 660501
1769 //if (Config_getBool("COMPACT_LATEX"))
1771 // t << "\\subparagraph*{";
1775 // t << "\\paragraph*{";
1779 void LatexGenerator::endMemberGroupHeader()
1781 // changed back to rev 756 due to bug 660501
1782 t << "}\\par" << endl;
1786 void LatexGenerator::startMemberGroupDocs()
1791 void LatexGenerator::endMemberGroupDocs()
1796 void LatexGenerator::startMemberGroup()
1800 void LatexGenerator::endMemberGroup(bool hasHeader)
1802 if (hasHeader)t << "\\end{Indent}";
1806 void LatexGenerator::startDotGraph()
1811 void LatexGenerator::endDotGraph(const DotClassGraph &g)
1813 g.writeGraph(t,EPS,Config_getString("LATEX_OUTPUT"),fileName,relPath);
1816 void LatexGenerator::startInclDepGraph()
1820 void LatexGenerator::endInclDepGraph(const DotInclDepGraph &g)
1822 g.writeGraph(t,EPS,Config_getString("LATEX_OUTPUT"),fileName,relPath);
1825 void LatexGenerator::startGroupCollaboration()
1829 void LatexGenerator::endGroupCollaboration(const DotGroupCollaboration &g)
1831 g.writeGraph(t,EPS,Config_getString("LATEX_OUTPUT"),fileName,relPath);
1834 void LatexGenerator::startCallGraph()
1838 void LatexGenerator::endCallGraph(const DotCallGraph &g)
1840 g.writeGraph(t,EPS,Config_getString("LATEX_OUTPUT"),fileName,relPath);
1843 void LatexGenerator::startDirDepGraph()
1847 void LatexGenerator::endDirDepGraph(const DotDirDeps &g)
1849 g.writeGraph(t,EPS,Config_getString("LATEX_OUTPUT"),fileName,relPath);
1852 void LatexGenerator::startDescription()
1854 t << "\\begin{description}" << endl;
1857 void LatexGenerator::endDescription()
1859 t << "\\end{description}" << endl;
1863 void LatexGenerator::startDescItem()
1869 void LatexGenerator::endDescItem()
1874 firstDescItem=FALSE;
1882 void LatexGenerator::startSimpleSect(SectionTypes,const char *file,
1883 const char *anchor,const char *title)
1885 t << "\\begin{Desc}\n\\item[";
1888 writeObjectLink(0,file,anchor,title);
1897 void LatexGenerator::endSimpleSect()
1899 t << "\\end{Desc}" << endl;
1902 void LatexGenerator::startParamList(ParamListTypes,const char *title)
1904 t << "\\begin{Desc}\n\\item[";
1909 void LatexGenerator::endParamList()
1911 t << "\\end{Desc}" << endl;
1914 void LatexGenerator::startParameterList(bool openBracket)
1916 /* start of ParameterType ParameterName list */
1917 if (openBracket) t << "(";
1918 t << endl << "\\begin{DoxyParamCaption}" << endl;
1921 void LatexGenerator::endParameterList()
1925 void LatexGenerator::startParameterType(bool first,const char *key)
1928 if (!first && key) t << key;
1931 void LatexGenerator::endParameterType()
1936 void LatexGenerator::startParameterName(bool /*oneArgOnly*/)
1941 void LatexGenerator::endParameterName(bool last,bool /* emptyList */,bool closeBracket)
1947 t << "\\end{DoxyParamCaption}" << endl;
1948 if (closeBracket) t << ")";
1952 void LatexGenerator::exceptionEntry(const char* prefix,bool closeBracket)
1956 else if (closeBracket)
1961 void LatexGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *)
1963 LatexDocVisitor *visitor =
1964 new LatexDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""),insideTabbing);
1969 void LatexGenerator::startConstraintList(const char *header)
1971 t << "\\begin{Desc}\n\\item[";
1974 t << "\\begin{description}" << endl;
1977 void LatexGenerator::startConstraintParam()
1979 t << "\\item[{\\em ";
1982 void LatexGenerator::endConstraintParam()
1986 void LatexGenerator::startConstraintType()
1991 void LatexGenerator::endConstraintType()
1996 void LatexGenerator::startConstraintDocs()
2000 void LatexGenerator::endConstraintDocs()
2004 void LatexGenerator::endConstraintList()
2006 t << "\\end{description}" << endl;
2007 t << "\\end{Desc}" << endl;
2010 void LatexGenerator::escapeLabelName(const char *s)
2015 QCString result(qstrlen(s)+1); // worst case allocation
2021 case '|': t << "\\texttt{\"|}"; break;
2022 case '!': t << "\"!"; break;
2023 case '%': t << "\\%"; break;
2024 case '{': t << "\\lcurly{}"; break;
2025 case '}': t << "\\rcurly{}"; break;
2026 case '~': t << "````~"; break; // to get it a bit better in index together with other special characters
2027 // NOTE: adding a case here, means adding it to while below as well!
2030 // collect as long string as possible, before handing it to docify
2032 while ((c=*p) && c!='|' && c!='!' && c!='%' && c!='{' && c!='}' && c!='~')
2044 void LatexGenerator::escapeMakeIndexChars(const char *s)
2049 QCString result(qstrlen(s)+1); // worst case allocation
2055 case '!': t << "\"!"; break;
2056 case '"': t << "\"\""; break;
2057 case '@': t << "\"@"; break;
2058 case '|': t << "\\texttt{\"|}"; break;
2059 case '[': t << "["; break;
2060 case ']': t << "]"; break;
2061 case '{': t << "\\lcurly{}"; break;
2062 case '}': t << "\\rcurly{}"; break;
2063 // NOTE: adding a case here, means adding it to while below as well!
2066 // collect as long string as possible, before handing it to docify
2068 while ((c=*p) && c!='"' && c!='@' && c!='[' && c!=']' && c!='!' && c!='{' && c!='}' && c!='|')
2080 void LatexGenerator::startCodeFragment()
2082 t << "\n\\begin{DoxyCode}\n";
2085 void LatexGenerator::endCodeFragment()
2087 t << "\\end{DoxyCode}\n";
2090 void LatexGenerator::writeLineNumber(const char *ref,const char *fileName,const char *anchor,int l)
2092 static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
2093 static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
2096 QCString lineNumber;
2097 lineNumber.sprintf("%05d",l);
2099 if (fileName && !sourceFileName.isEmpty())
2101 QCString lineAnchor;
2102 lineAnchor.sprintf("_l%05d",l);
2103 lineAnchor.prepend(sourceFileName);
2104 //if (!m_prettyCode) return;
2105 if (usePDFLatex && pdfHyperlinks)
2107 t << "\\hypertarget{" << stripPath(lineAnchor) << "}{}";
2109 writeCodeLink(ref,fileName,anchor,lineNumber,0);
2123 void LatexGenerator::startCodeLine(bool)
2128 void LatexGenerator::endCodeLine()
2133 void LatexGenerator::startFontClass(const char *name)
2135 //if (!m_prettyCode) return;
2136 t << "\\textcolor{" << name << "}{";
2139 void LatexGenerator::endFontClass()
2141 //if (!m_prettyCode) return;
2145 void LatexGenerator::startInlineHeader()
2147 if (Config_getBool("COMPACT_LATEX"))
2149 t << "\\paragraph*{";
2153 t << "\\subsubsection*{";
2157 void LatexGenerator::endInlineHeader()
2162 void LatexGenerator::lineBreak(const char *)
2174 void LatexGenerator::startMemberDocSimple()
2176 t << "\\begin{DoxyFields}{";
2177 docify(theTranslator->trCompoundMembers());
2181 void LatexGenerator::endMemberDocSimple()
2183 t << "\\end{DoxyFields}" << endl;
2186 void LatexGenerator::startInlineMemberType()
2190 void LatexGenerator::endInlineMemberType()
2195 void LatexGenerator::startInlineMemberName()
2199 void LatexGenerator::endInlineMemberName()
2204 void LatexGenerator::startInlineMemberDoc()
2208 void LatexGenerator::endInlineMemberDoc()
2210 t << "\\\\\n\\hline\n" << endl;
2213 void LatexGenerator::startLabels()
2215 t << "\\hspace{0.3cm}";
2218 void LatexGenerator::writeLabel(const char *l,bool isLast)
2220 t << "{\\ttfamily [" << l << "]}";
2221 if (!isLast) t << ", ";
2224 void LatexGenerator::endLabels()