44 : m_relPath(relPath), m_sourceFileName(sourceFileName), m_col(0)
78 int spacesToNextTabStop;
80 const int maxLineLen = 108;
81 QCString result(4*maxLineLen+1);
89 case '\t': spacesToNextTabStop =
90 tabSize - (
m_col%tabSize);
92 m_col+=spacesToNextTabStop;
95 case '\n':
m_t <<
'\n';
m_col=0; p++;
102 #define COPYCHAR() do { \
103 result[i++]=c; p++; \
108 if (((uchar)c&0xE0)==0xE0) \
113 if (((uchar)c&0xF0)==0xF0) \
125 if (
m_col>=maxLineLen)
132 while (
m_col<maxLineLen && (c=*p) &&
133 c!=0x0c && c!=
'\t' && c!=
'\n' && c!=
' '
138 if (
m_col>=maxLineLen)
161 const char *anchor,
const char *name,
166 int l = qstrlen(name);
172 if (!ref && usePDFLatex && pdfHyperlinks)
174 m_t <<
"\\hyperlink{";
176 if (f && anchor)
m_t <<
"_";
177 if (anchor)
m_t << anchor;
196 lineNumber.sprintf(
"%05d",l);
201 lineAnchor.sprintf(
"_l%05d",l);
204 if (usePDFLatex && pdfHyperlinks)
206 m_t <<
"\\hypertarget{" <<
stripPath(lineAnchor) <<
"}{}";
235 m_t <<
"\\textcolor{" << name <<
"}{";
266 QCString fileName=dir+
"/Makefile";
267 QFile file(fileName);
268 if (!file.open(IO_WriteOnly))
270 err(
"Could not open file %s for writing\n",fileName.data());
280 t <<
"all: refman.dvi" <<
endl
282 <<
"ps: refman.ps" <<
endl
284 <<
"pdf: refman.pdf" <<
endl
286 <<
"ps_2on1: refman_2on1.ps" <<
endl
288 <<
"pdf_2on1: refman_2on1.pdf" <<
endl
290 <<
"refman.ps: refman.dvi" <<
endl
291 <<
"\tdvips -o refman.ps refman.dvi" <<
endl
293 t <<
"refman.pdf: refman.ps" <<
endl;
294 t <<
"\tps2pdf refman.ps refman.pdf" << endl <<
endl;
295 t <<
"refman.dvi: clean refman.tex doxygen.sty" << endl
296 <<
"\techo \"Running latex...\"" << endl
297 <<
"\t" << latex_command <<
" refman.tex" << endl
298 <<
"\techo \"Running makeindex...\"" << endl
299 <<
"\t" << mkidx_command <<
" refman.idx" <<
endl;
302 t <<
"\techo \"Running bibtex...\"" <<
endl;
303 t <<
"\tbibtex refman" <<
endl;
304 t <<
"\techo \"Rerunning latex....\"" <<
endl;
305 t <<
"\t" << latex_command <<
" refman.tex" <<
endl;
307 t <<
"\techo \"Rerunning latex....\"" << endl
308 <<
"\t" << latex_command <<
" refman.tex" << endl
309 <<
"\tlatex_count=8 ; \\" << endl
310 <<
"\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\" << endl
311 <<
"\t do \\" << endl
312 <<
"\t echo \"Rerunning latex....\" ;\\" << endl
313 <<
"\t " << latex_command <<
" refman.tex ;\\" << endl
314 <<
"\t latex_count=`expr $$latex_count - 1` ;\\" << endl
316 <<
"\t" << mkidx_command <<
" refman.idx" << endl
317 <<
"\t" << latex_command <<
" refman.tex" << endl << endl
318 <<
"refman_2on1.ps: refman.ps" << endl
319 <<
"\tpsnup -2 refman.ps >refman_2on1.ps" << endl
321 <<
"refman_2on1.pdf: refman_2on1.ps" << endl
322 <<
"\tps2pdf refman_2on1.ps refman_2on1.pdf" <<
endl;
326 t <<
"all: refman.pdf" <<
endl <<
endl
327 <<
"pdf: refman.pdf" <<
endl <<
endl;
328 t <<
"refman.pdf: clean refman.tex" <<
endl;
329 t <<
"\tpdflatex refman" <<
endl;
330 t <<
"\t" << mkidx_command <<
" refman.idx" <<
endl;
333 t <<
"\tbibtex refman" <<
endl;
334 t <<
"\tpdflatex refman" <<
endl;
336 t <<
"\tpdflatex refman" << endl
337 <<
"\tlatex_count=8 ; \\" << endl
338 <<
"\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\" << endl
339 <<
"\t do \\" << endl
340 <<
"\t echo \"Rerunning latex....\" ;\\" << endl
341 <<
"\t pdflatex refman ;\\" << endl
342 <<
"\t latex_count=`expr $$latex_count - 1` ;\\" << endl
344 <<
"\t" << mkidx_command <<
" refman.idx" << endl
345 <<
"\tpdflatex refman" << endl <<
endl;
351 <<
"*.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf" <<
endl;
356 #if defined(_MSC_VER)
358 QCString fileName=dir+
"/make.bat";
361 QFile file(fileName);
363 if (!file.open(IO_WriteOnly))
365 err(
"Could not open file %s for writing\n",fileName.data());
369 t <<
"set Dir_Old=%cd%\n";
370 t <<
"cd /D %~dp0\n\n";
371 t <<
"del /s /f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf\n\n";
374 t << latex_command <<
" refman.tex\n";
376 t << mkidx_command <<
" refman.idx\n";
379 t <<
"bibtex refman\n";
381 t << latex_command <<
" refman.tex\n";
383 t <<
"setlocal enabledelayedexpansion\n";
384 t <<
"set count=8\n";
386 t <<
"set content=X\n";
387 t <<
"for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\n";
388 t <<
"if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\n";
389 t <<
"if !content! == X goto :skip\n";
390 t <<
"set /a count-=1\n";
391 t <<
"if !count! EQU 0 goto :skip\n\n";
393 t << latex_command <<
" refman.tex\n";
394 t <<
"goto :repeat\n";
397 t << mkidx_command <<
" refman.idx\n";
398 t << latex_command <<
" refman.tex\n";
399 t <<
"dvips -o refman.ps refman.dvi\n";
400 t <<
"gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "
401 "-sOutputFile=refman.pdf -c save pop -f refman.ps\n";
405 t <<
"pdflatex refman\n";
407 t << mkidx_command <<
" refman.idx\n";
410 t <<
"bibtex refman" <<
endl;
411 t <<
"pdflatex refman" <<
endl;
414 t <<
"pdflatex refman\n\n";
415 t <<
"setlocal enabledelayedexpansion\n";
416 t <<
"set count=8\n";
418 t <<
"set content=X\n";
419 t <<
"for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\n";
420 t <<
"if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\n";
421 t <<
"if !content! == X goto :skip\n";
422 t <<
"set /a count-=1\n";
423 t <<
"if !count! EQU 0 goto :skip\n\n";
425 t <<
"pdflatex refman\n";
426 t <<
"goto :repeat\n";
429 t << mkidx_command <<
" refman.idx\n";
430 t <<
"pdflatex refman\n";
431 t <<
"cd /D %Dir_Old%\n";
432 t <<
"set Dir_Old=\n";
442 if (!d.exists() && !d.mkdir(dir))
444 err(
"Could not create output directory %s\n",dir.data());
460 t <<
"\\batchmode\n";
463 QCString documentClass;
465 documentClass =
"article";
467 documentClass =
"book";
468 t <<
"\\documentclass[twoside]{" << documentClass <<
"}\n"
472 t <<
"% Packages required by doxygen\n"
473 "\\usepackage{fixltx2e}\n"
474 "\\usepackage{calc}\n"
475 "\\usepackage{doxygen}\n"
476 "\\usepackage[export]{adjustbox} % also loads graphicx\n";
477 QStrList extraLatexStyle =
Config_getList(LATEX_EXTRA_STYLESHEET);
478 for (uint i=0; i<extraLatexStyle.count(); ++i)
480 QCString fileName(extraLatexStyle.at(i));
481 if (!fileName.isEmpty())
483 QFileInfo fi(fileName);
493 t <<
"\\usepackage{" << fi.fileName().utf8() <<
"}\n";
498 t <<
"\\usepackage{graphicx}\n"
499 "\\usepackage[utf8]{inputenc}\n"
500 "\\usepackage{makeidx}\n"
501 "\\usepackage{multicol}\n"
502 "\\usepackage{multirow}\n"
503 "\\PassOptionsToPackage{warn}{textcomp}\n"
504 "\\usepackage{textcomp}\n"
505 "\\usepackage[nointegrals]{wasysym}\n"
506 "\\usepackage[table]{xcolor}\n"
511 if (!languageSupport.isEmpty())
513 t <<
"% NLS support packages\n"
519 t <<
"% Font selection\n"
520 "\\usepackage[T1]{fontenc}\n"
521 "\\usepackage[scaled=.90]{helvet}\n"
522 "\\usepackage{courier}\n"
523 "\\usepackage{amssymb}\n"
524 "\\usepackage{sectsty}\n"
525 "\\renewcommand{\\familydefault}{\\sfdefault}\n"
526 "\\allsectionsfont{%\n"
527 " \\fontseries{bc}\\selectfont%\n"
528 " \\color{darkgray}%\n"
530 "\\renewcommand{\\DoxyLabelFont}{%\n"
531 " \\fontseries{bc}\\selectfont%\n"
532 " \\color{darkgray}%\n"
534 "\\newcommand{\\+}{\\discretionary{\\mbox{\\scriptsize$\\hookleftarrow$}}{}{}}\n"
540 t <<
"% Page & text layout\n"
541 "\\usepackage{geometry}\n"
543 " " << paperName <<
"paper,%\n"
551 t <<
"\\tolerance=750\n"
554 "\\setlength{\\emergencystretch}{15pt}\n"
555 "\\setlength{\\parindent}{0cm}\n"
556 "\\setlength{\\parskip}{3ex plus 2ex minus 2ex}\n";
558 t <<
"\\makeatletter\n"
559 "\\renewcommand{\\paragraph}{%\n"
560 " \\@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%\n"
561 " \\normalfont\\normalsize\\bfseries\\SS@parafont%\n"
564 "\\renewcommand{\\subparagraph}{%\n"
565 " \\@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{%\n"
566 " \\normalfont\\normalsize\\bfseries\\SS@subparafont%\n"
574 QCString generatedBy;
586 t <<
"% Headers & footers\n"
587 "\\usepackage{fancyhdr}\n"
588 "\\pagestyle{fancyplain}\n"
589 "\\fancyhead[LE]{\\fancyplain{}{\\bfseries\\thepage}}\n"
590 "\\fancyhead[CE]{\\fancyplain{}{}}\n"
591 "\\fancyhead[RE]{\\fancyplain{}{\\bfseries\\leftmark}}\n"
592 "\\fancyhead[LO]{\\fancyplain{}{\\bfseries\\rightmark}}\n"
593 "\\fancyhead[CO]{\\fancyplain{}{}}\n"
594 "\\fancyhead[RO]{\\fancyplain{}{\\bfseries\\thepage}}\n"
595 "\\fancyfoot[LE]{\\fancyplain{}{}}\n"
596 "\\fancyfoot[CE]{\\fancyplain{}{}}\n"
597 "\\fancyfoot[RE]{\\fancyplain{}{\\bfseries\\scriptsize " << genString <<
" Doxygen }}\n"
598 "\\fancyfoot[LO]{\\fancyplain{}{\\bfseries\\scriptsize " << genString <<
" Doxygen }}\n"
599 "\\fancyfoot[CO]{\\fancyplain{}{}}\n"
600 "\\fancyfoot[RO]{\\fancyplain{}{}}\n"
601 "\\renewcommand{\\footrulewidth}{0.4pt}\n";
604 t <<
"\\renewcommand{\\chaptermark}[1]{%\n"
605 " \\markboth{#1}{}%\n"
608 t <<
"\\renewcommand{\\sectionmark}[1]{%\n"
609 " \\markright{\\thesection\\ #1}%\n"
614 t <<
"% Indices & bibliography\n"
615 "\\usepackage{natbib}\n"
616 "\\usepackage[titles]{tocloft}\n"
617 "\\setcounter{tocdepth}{3}\n"
618 "\\setcounter{secnumdepth}{5}\n"
628 t <<
"% Hyperlinks (required, but should be loaded last)\n"
629 "\\usepackage{ifpdf}\n"
631 " \\usepackage[pdftex,pagebackref=true]{hyperref}\n"
633 " \\usepackage[ps2pdf,pagebackref=true]{hyperref}\n"
636 " colorlinks=true,%\n"
637 " linkcolor=blue,%\n"
638 " citecolor=blue,%\n"
645 t <<
"% Custom commands\n"
646 "\\newcommand{\\clearemptydoublepage}{%\n"
647 " \\newpage{\\pagestyle{empty}\\cleardoublepage}%\n"
652 t <<
"\\usepackage{caption}\n"
653 <<
"\\captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top}\n\n";
656 t <<
"%===== C O N T E N T S =====\n"
658 "\\begin{document}\n";
660 t <<
"\\selectlanguage{greek}\n";
664 t <<
"% Titlepage & ToC\n";
666 if (pdfHyperlinks && usePDFLatex)
670 t <<
"\\hypersetup{pageanchor=false,\n"
672 <<
" bookmarksnumbered=true,\n"
673 <<
" pdfencoding=unicode\n"
676 t <<
"\\pagenumbering{alph}\n"
677 "\\begin{titlepage}\n"
698 t <<
"\\vspace*{0.5cm}\n"
700 t <<
"\\end{center}\n"
701 "\\end{titlepage}\n";
704 t <<
"\\clearemptydoublepage\n";
705 t <<
"\\pagenumbering{roman}\n";
708 t <<
"\\tableofcontents\n";
710 t <<
"\\clearemptydoublepage\n";
711 t <<
"\\pagenumbering{arabic}\n";
714 if (pdfHyperlinks && usePDFLatex)
717 t <<
"\\hypersetup{pageanchor=true}\n";
720 "%--- Begin generated contents ---\n";
730 t <<
"%--- End generated contents ---\n"
746 t <<
"\\backmatter\n";
750 "\\clearemptydoublepage\n"
762 t <<
"Your title here";
789 if (fileName.right(4)!=
".tex" && fileName.right(4)!=
".sty") fileName+=
".tex";
809 t <<
"\\\\[1ex]\\large ";
820 if (latexHeader.isEmpty())
835 if (latexHeader.isEmpty())
841 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
849 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
853 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
857 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
861 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
865 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
869 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
873 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
881 for (gli.toFirst();(gd=gli.current()) && !found;++gli)
885 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
897 for (dli.toFirst();(dd=dli.current()) && !found;++dli)
901 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
913 for (nli.toFirst();(nd=nli.current()) && !found;++nli)
917 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
929 for (cli.toFirst();(cd=cli.current()) && !found;++cli)
936 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
948 for (fnli.toFirst();(fn=fnli.current());++fnli)
952 for (;(fd=fni.current());++fni)
958 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
970 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
976 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
998 if (latexHeader.isEmpty())
1006 QCString indexName=
"index";
1007 t <<
"}\n\\label{index}";
1009 t <<
"\\input{" << indexName <<
"}\n";
1013 t <<
"}\n\\input{modules}\n";
1016 t <<
"}\n\\input{dirs}\n";
1019 t <<
"}\n\\input{namespaces}\n";
1022 t <<
"}\n\\input{hierarchy}\n";
1025 t <<
"}\n\\input{annotated}\n";
1028 t <<
"}\n\\input{files}\n";
1031 t <<
"}\n\\input{pages}\n";
1038 for (gli.toFirst();(gd=gli.current()) && !found;++gli)
1046 for (;(gd=gli.current());++gli)
1062 for (dli.toFirst();(dd=dli.current()) && !found;++dli)
1070 for (;(dd=dli.current());++dli)
1086 for (nli.toFirst();(nd=nli.current()) && !found;++nli)
1094 while ((nd=nli.current()))
1111 for (cli.toFirst();(cd=cli.current()) && !found;++cli)
1122 for (;(cd=cli.current());++cli)
1141 for (fnli.toFirst();(fn=fnli.current());++fnli)
1145 for (;(fd=fni.current());++fni)
1184 for (++pdi;(pd=pdi.current());++pdi)
1199 for (pdi.toFirst();(pd=pdi.current());++pdi)
1203 if (compactLatex)
t <<
"\\section";
else t <<
"\\chapter";
1207 if (compactLatex || first)
t <<
"\\input" ;
else t <<
"\\include";
1218 if (latexFooter.isEmpty())
1240 t <<
"{" << name <<
"}\n";
1279 t <<
"\\contentsline{section}{";
1329 const char *path,
const char *name)
1331 t <<
"\\item\\contentsline{section}{\\bf ";
1344 t <<
"\\item\\contentsline{section}{";
1354 if (hasBrief)
t <<
"\\\\*";
1375 t <<
"\\hyperlink{";
1377 if (anchor)
t <<
"_" << anchor;
1392 const char *anchor,
const char *text)
1397 t <<
"\\hyperlink{";
1399 if (f && anchor)
t <<
"_";
1400 if (anchor)
t << anchor;
1415 t <<
" \\doxyref{}{";
1421 if (clname)
t << clname;
1422 if (anchor)
t <<
"_" << anchor;
1431 if (usePDFLatex && pdfHyperlinks && fileName)
1433 t <<
"\\hypertarget{" <<
stripPath(fileName) <<
"}{}";
1437 t <<
"\\subsection{";
1450 t <<
"\\label{" <<
stripPath(fileName) <<
"}\\index{";
1462 t <<
"\\subsection{";
1477 if (extraIndentLevel==3)
1479 t <<
"\\subparagraph*{";
1481 else if (extraIndentLevel==2)
1483 t <<
"\\paragraph{";
1485 else if (extraIndentLevel==1)
1487 t <<
"\\subsubsection{";
1491 t <<
"\\subsection{";
1506 t <<
"\\subsubsection*{";
1510 t <<
"\\subsection*{";
1522 const char *memname,
1529 if (memname && memname[0]!=
'@')
1559 static const char *levelLab[] = {
"subsubsection",
"paragraph",
"subparagraph",
"subparagraph" };
1563 if (showInline) level+=2;
1564 if (compactLatex) level++;
1565 t <<
"\\" << levelLab[level];
1570 t <<
"\\texorpdfstring{";
1579 t <<
"\\hspace{0.1cm}{\\footnotesize\\ttfamily [" << memCount <<
"/" << memTotal <<
"]}";
1582 t <<
"\n{\\footnotesize\\ttfamily ";
1594 const char *anchor,
const char *,
1599 if (usePDFLatex && pdfHyperlinks)
1601 t <<
"\\hypertarget{";
1603 if (anchor)
t <<
"_" << anchor;
1608 if (anchor)
t <<
"_" << anchor;
1622 if (usePDFLatex && pdfHyperlinks)
1667 if (usePDFLatex && pdfHyperlinks)
1669 t <<
"\\hypertarget{" <<
stripPath(lab) <<
"}{}";
1681 default: ASSERT(0);
break;
1694 default: ASSERT(0);
break;
1702 t <<
"}\\label{" << lab <<
"}" <<
endl;
1726 const char *fileName,
const char *)
1736 t <<
"\\begin{tabbing}" <<
endl;
1737 t <<
"xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=\\kill" <<
endl;
1747 t <<
endl <<
"\\end{tabbing}";
1757 t <<
"{\\footnotesize ";
1774 t <<
"\\item " <<
endl;
1793 t <<
"\\begin{DoxyCompactList}\\small\\item\\em ";
1797 for (
int i=0;i<
m_indent+2;i++)
t <<
"\\>";
1807 t <<
"\\end{DoxyCompactList}";
1845 t <<
"\\begin{DoxyEnumFields}{" << title <<
"}" <<
endl;
1850 t <<
"\\end{DoxyEnumFields}" <<
endl;
1857 t <<
"\\raisebox{\\heightof{T}}[0pt][0pt]{";
1880 t <<
"\\\\\n\\hline\n" <<
endl;
1892 t <<
"\\begin{DoxyCompactItemize}" <<
endl;
1901 t <<
"\\end{DoxyCompactItemize}" <<
endl;
1908 if (hasHeader)
t <<
"\\begin{Indent}";
1924 t <<
"}\\par" <<
endl;
1944 if (hasHeader)
t <<
"\\end{Indent}";
1996 t <<
"\\begin{description}" <<
endl;
2001 t <<
"\\end{description}" <<
endl;
2025 const char *anchor,
const char *title)
2027 t <<
"\\begin{Desc}\n\\item[";
2041 t <<
"\\end{Desc}" <<
endl;
2046 t <<
"\\begin{Desc}\n\\item[";
2053 t <<
"\\end{Desc}" <<
endl;
2059 if (openBracket)
t <<
"(";
2060 t <<
"\\begin{DoxyParamCaption}";
2070 if (!first && key)
t << key;
2088 t <<
"\\end{DoxyParamCaption}";
2089 if (closeBracket)
t <<
")";
2097 else if (closeBracket)
2112 t <<
"\\begin{Desc}\n\\item[";
2115 t <<
"\\begin{description}" <<
endl;
2120 t <<
"\\item[{\\em ";
2147 t <<
"\\end{description}" <<
endl;
2148 t <<
"\\end{Desc}" <<
endl;
2153 t <<
"\n\\begin{DoxyCode}\n";
2158 t <<
"\\end{DoxyCode}\n";
2165 t <<
"\\paragraph*{";
2169 t <<
"\\subsubsection*{";
2194 t <<
"\\begin{DoxyEnumFields}{";
2199 t <<
"\\begin{DoxyFields}{";
2209 t <<
"\\end{DoxyEnumFields}" <<
endl;
2213 t <<
"\\end{DoxyFields}" <<
endl;
2241 t <<
"\\\\\n\\hline\n" <<
endl;
2246 t <<
"\\hspace{0.3cm}";
2251 t <<
"{\\ttfamily [" << l <<
"]}";
2252 if (!isLast)
t <<
", ";