19 #include <qfileinfo.h>
48 case '%': result+=
"\\%";
break;
49 case '|': result+=
"\\texttt{\"|}";
break;
50 case '!': result+=
"\"!";
break;
51 case '{': result+=
"\\lcurly{}";
break;
52 case '}': result+=
"\\rcurly{}";
break;
53 case '~': result+=
"````~";
break;
63 {
"section",
"subsection",
"subsubsection",
"paragraph",
"subparagraph" };
69 if (compactLatex) l++;
78 t <<
"\n\\begin{DoxyImage}\n";
82 t <<
"\n\\begin{DoxyImageNoCaption}\n"
86 t <<
"\\includegraphics";
87 if (!width.isEmpty() || !height.isEmpty())
93 t <<
"width=" << width;
95 if (!width.isEmpty() && !height.isEmpty())
99 if (!height.isEmpty())
101 t <<
"height=" << height;
103 if (width.isEmpty() && height.isEmpty())
106 t <<
"[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]";
113 t <<
"{" << name <<
"}";
117 t <<
"\n\\doxyfigcaption{";
128 t <<
"\\end{DoxyImage}\n";
131 t <<
"\\end{DoxyImageNoCaption}\n";
138 QListIterator<DocNode> cli(children);
140 for (cli.toFirst();(n=cli.current());++cli) n->
accept(parent);
147 char str[2]; str[1]=0;
155 case '!':
m_t <<
"\"!";
break;
156 case '"':
m_t <<
"\"\"";
break;
157 case '@':
m_t <<
"\"@";
break;
158 case '|':
m_t <<
"\\texttt{\"|}";
break;
159 case '[':
m_t <<
"[";
break;
160 case ']':
m_t <<
"]";
break;
161 case '{':
m_t <<
"\\lcurly{}";
break;
162 case '}':
m_t <<
"\\rcurly{}";
break;
163 default: str[0]=c;
filter(str);
break;
172 const char *langExt,
bool insideTabbing)
174 m_insideItem(FALSE), m_hide(FALSE), m_hideCaption(FALSE), m_insideTabbing(insideTabbing),
253 m_t <<
"~\\newline\n";
268 if (s->
enable())
m_t <<
"{\\bfseries ";
else m_t <<
"}";
274 if (s->
enable())
m_t <<
"{\\ttfamily ";
else m_t <<
"}";
277 if (s->
enable())
m_t <<
"\\textsubscript{";
else m_t <<
"}";
280 if (s->
enable())
m_t <<
"\\textsuperscript{";
else m_t <<
"}";
283 if (s->
enable())
m_t <<
"\\begin{center}";
else m_t <<
"\\end{center} ";
286 if (s->
enable())
m_t <<
"\n\\footnotesize ";
else m_t <<
"\n\\normalsize ";
291 m_t <<
"\n\\begin{DoxyPre}";
297 m_t <<
"\\end{DoxyPre}\n";
318 m_t <<
"\n\\begin{DoxyCode}\n";
322 m_t <<
"\\end{DoxyCode}\n";
326 m_t <<
"\\begin{DoxyVerb}";
328 m_t <<
"\\end{DoxyVerb}\n";
342 static int dotindex = 1;
343 QCString fileName(4096);
345 fileName.sprintf(
"%s%d%s",
350 QFile file(fileName);
351 if (!file.open(IO_WriteOnly))
353 err(
"Could not open file %s for writing\n",fileName.data());
357 file.writeBlock( s->
text(), s->
text().length() );
370 static int mscindex = 1;
371 QCString baseName(4096);
373 baseName.sprintf(
"%s%d",
377 QFile file(baseName+
".msc");
378 if (!file.open(IO_WriteOnly))
380 err(
"Could not open file %s.msc for writing\n",baseName.data());
384 QCString text =
"msc {";
387 file.writeBlock( text, text.length() );
426 m_t <<
"\n\\begin{DoxyCodeInclude}\n";
427 QFileInfo cfi( inc->
file() );
428 FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
442 m_t <<
"\\end{DoxyCodeInclude}" <<
endl;
446 m_t <<
"\n\\begin{DoxyCodeInclude}\n";
458 m_t <<
"\\end{DoxyCodeInclude}\n";
468 m_t <<
"\n\\begin{DoxyVerbInclude}\n";
470 m_t <<
"\\end{DoxyVerbInclude}\n";
474 m_t <<
"\n\\begin{DoxyCodeInclude}\n";
483 m_t <<
"\\end{DoxyCodeInclude}" <<
endl;
488 err(
"Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
489 "Please create a bug report\n",__FILE__);
500 if (!
m_hide)
m_t <<
"\n\\begin{DoxyCodeInclude}\n";
520 if (!
m_hide)
m_t <<
"\n\\end{DoxyCodeInclude}\n";
549 if (!cite->
file().isEmpty())
552 QCString anchor = cite->
anchor();
554 m_t <<
"\\cite{" << anchor <<
"}";
558 m_t <<
"{\\bfseries [";
573 m_t <<
"\n\\begin{DoxyEnumerate}";
577 m_t <<
"\n\\begin{DoxyItemize}";
586 m_t <<
"\n\\end{DoxyEnumerate}";
590 m_t <<
"\n\\end{DoxyItemize}";
632 m_t <<
"\\begin{DoxySeeAlso}{";
636 m_t <<
"\\begin{DoxyReturn}{";
640 m_t <<
"\\begin{DoxyAuthor}{";
644 m_t <<
"\\begin{DoxyAuthor}{";
648 m_t <<
"\\begin{DoxyVersion}{";
652 m_t <<
"\\begin{DoxySince}{";
656 m_t <<
"\\begin{DoxyDate}{";
660 m_t <<
"\\begin{DoxyNote}{";
664 m_t <<
"\\begin{DoxyWarning}{";
668 m_t <<
"\\begin{DoxyPrecond}{";
672 m_t <<
"\\begin{DoxyPostcond}{";
676 m_t <<
"\\begin{DoxyCopyright}{";
680 m_t <<
"\\begin{DoxyInvariant}{";
684 m_t <<
"\\begin{DoxyRemark}{";
688 m_t <<
"\\begin{DoxyAttention}{";
692 m_t <<
"\\begin{DoxyParagraph}{";
695 m_t <<
"\\begin{DoxyParagraph}{";
717 m_t <<
"\n\\end{DoxySeeAlso}\n";
720 m_t <<
"\n\\end{DoxyReturn}\n";
723 m_t <<
"\n\\end{DoxyAuthor}\n";
726 m_t <<
"\n\\end{DoxyAuthor}\n";
729 m_t <<
"\n\\end{DoxyVersion}\n";
732 m_t <<
"\n\\end{DoxySince}\n";
735 m_t <<
"\n\\end{DoxyDate}\n";
738 m_t <<
"\n\\end{DoxyNote}\n";
741 m_t <<
"\n\\end{DoxyWarning}\n";
744 m_t <<
"\n\\end{DoxyPrecond}\n";
747 m_t <<
"\n\\end{DoxyPostcond}\n";
750 m_t <<
"\n\\end{DoxyCopyright}\n";
753 m_t <<
"\n\\end{DoxyInvariant}\n";
756 m_t <<
"\n\\end{DoxyRemark}\n";
759 m_t <<
"\n\\end{DoxyAttention}\n";
762 m_t <<
"\n\\end{DoxyParagraph}\n";
765 m_t <<
"\n\\end{DoxyParagraph}\n";
786 m_t <<
"\\begin{DoxyItemize}" <<
endl;
792 m_t <<
"\\end{DoxyItemize}" <<
endl;
825 m_t <<
"\n\\begin{DoxyEnumerate}";
827 m_t <<
"\n\\begin{DoxyItemize}";
834 m_t <<
"\n\\end{DoxyEnumerate}";
836 m_t <<
"\n\\end{DoxyItemize}";
867 m_t <<
"\n\\begin{DoxyRefList}";
871 m_t <<
"\n\\begin{DoxyDescription}";
881 m_t <<
"\n\\end{DoxyRefList}";
885 m_t <<
"\n\\end{DoxyDescription}";
914 while (n && !isNested)
926 t <<
"\\begin{tabularx}{\\linewidth}{|*{" << cols <<
"}{>{\\raggedright\\arraybackslash}X|}}";
930 t <<
"\\tabulinesep=1mm\n\\begin{longtabu} spread 0pt [c]{*{" << cols <<
"}{|X[-1]}|}\n";
939 t <<
"\\end{tabularx}\n";
943 t <<
"\\end{longtabu}\n";
956 if (!c->
file().isEmpty() && pdfHyperLinks)
1012 if (r->
isHeading())
m_t <<
"\\rowcolor{\\tableheadbgcolor}";
1035 m_t <<
"\\multicolumn{" << span->
colSpan <<
"}{";
1036 m_t <<
"p{(\\linewidth-\\tabcolsep*"
1037 <<
numCols() <<
"-\\arrayrulewidth*"
1043 m_t <<
"\\multicolumn{1}{c|}{}";
1062 else if (span->
column>col)
1064 m_t <<
"\\cline{" << col <<
"-" << (span->
column-1) <<
"}";
1075 m_t <<
"\\cline{" << col <<
"-" <<
numCols() <<
"}";
1084 m_t <<
"\\endfirsthead" <<
endl;
1117 m_t <<
"\\multicolumn{" << span->
colSpan <<
"}{";
1122 m_t <<
"p{(\\linewidth-\\tabcolsep*"
1123 <<
numCols() <<
"-\\arrayrulewidth*"
1140 m_t <<
"\\multicolumn{" << cs <<
"}{";
1145 m_t <<
"p{(\\linewidth-\\tabcolsep*"
1146 <<
numCols() <<
"-\\arrayrulewidth*"
1148 << cs <<
"/"<<
numCols() <<
"}|}{";
1149 if (c->
isHeading())
m_t <<
"\\cellcolor{\\tableheadbgcolor}";
1159 m_t <<
"\\multirow{" << rs <<
"}{\\linewidth}{";
1164 m_t <<
"\\PBS\\centering ";
1168 m_t <<
"\\PBS\\raggedleft ";
1248 QCString gfxName = img->
name();
1249 if (gfxName.right(4)==
".eps" || gfxName.right(4)==
".pdf")
1251 gfxName=gfxName.left(gfxName.length()-4);
1354 m_t <<
"\\item \\contentsline{section}{";
1358 m_t <<
"\\hyperlink{" << ref->
file() <<
"_" << ref->
anchor() <<
"}{" ;
1376 m_t <<
"\\footnotesize" <<
endl;
1377 m_t <<
"\\begin{multicols}{2}" <<
endl;
1378 m_t <<
"\\begin{DoxyCompactList}" <<
endl;
1384 m_t <<
"\\end{DoxyCompactList}" <<
endl;
1385 m_t <<
"\\end{multicols}" <<
endl;
1386 m_t <<
"\\normalsize" <<
endl;
1397 m_t <<
"\n\\begin{DoxyParams}";
1398 if (hasInOutSpecs && hasTypeSpecs)
m_t <<
"[2]";
1399 else if (hasInOutSpecs || hasTypeSpecs)
m_t <<
"[1]";
1404 m_t <<
"\n\\begin{DoxyRetVals}{";
1408 m_t <<
"\n\\begin{DoxyExceptions}{";
1415 m_t <<
"\n\\begin{DoxyTemplParams}{";
1416 filter(
"Template Parameters");
1430 m_t <<
"\\end{DoxyParams}\n";
1433 m_t <<
"\\end{DoxyRetVals}\n";
1436 m_t <<
"\\end{DoxyExceptions}\n";
1439 m_t <<
"\\end{DoxyTemplParams}\n";
1468 m_t <<
"\\mbox{\\tt ";
1483 if (useTable)
m_t <<
" & ";
1490 for (li.toFirst();(type=li.current());++li)
1492 if (!first)
m_t <<
" | ";
else first=FALSE;
1502 if (useTable)
m_t <<
" & ";
1510 for (li.toFirst();(param=li.current());++li)
1512 if (!first)
m_t <<
",";
else first=FALSE;
1550 <<
"\\hline" <<
endl;
1557 if (x->
title().isEmpty())
return;
1558 m_t <<
"\\begin{DoxyRefDesc}{";
1561 bool anonymousEnum = x->
file()==
"@";
1580 if (x->
title().isEmpty())
return;
1581 m_t <<
"\\end{DoxyRefDesc}" <<
endl;
1615 m_t <<
"\\begin{quote}" <<
endl;
1621 m_t <<
"\\end{quote}" <<
endl;
1652 if (ref.isEmpty() && pdfHyperLinks)
1656 m_t <<
"\\doxytablelink{";
1660 m_t <<
"\\hyperlink{";
1663 if (!file.isEmpty() && !anchor.isEmpty())
m_t <<
"_";
1664 if (!anchor.isEmpty())
m_t << anchor;
1667 else if (ref.isEmpty() && refToTable)
1669 m_t <<
"\\doxytableref{";
1671 else if (ref.isEmpty())
1673 m_t <<
"\\doxyref{";
1685 if (ref.isEmpty() && !pdfHyperLinks)
1689 m_t <<
"}{" << file;
1690 if (!file.isEmpty() && !anchor.isEmpty())
m_t <<
"_";
1691 m_t << anchor <<
"}";
1709 const QCString &width,
1710 const QCString &height,
1714 QCString baseName=fileName;
1716 if ((i=baseName.findRev(
'/'))!=-1)
1718 baseName=baseName.right(baseName.length()-i-1);
1720 if ((i=baseName.find(
'.'))!=-1)
1722 baseName=baseName.left(i);
1724 baseName.prepend(
"dot_");
1726 QCString name = fileName;
1738 const QCString &width,
1739 const QCString &height,
1743 QCString baseName=fileName;
1745 if ((i=baseName.findRev(
'/'))!=-1)
1747 baseName=baseName.right(baseName.length()-i-1);
1749 if ((i=baseName.find(
'.'))!=-1)
1751 baseName=baseName.left(i);
1753 baseName.prepend(
"msc_");
1769 QCString shortName = baseName;
1771 if ((i=shortName.findRev(
'/'))!=-1)
1773 shortName=shortName.right(shortName.length()-i-1);
1784 const QCString &width,
1785 const QCString &height,
1789 QCString baseName=fileName;
1791 if ((i=baseName.findRev(
'/'))!=-1)
1793 baseName=baseName.right(baseName.length()-i-1);
1795 if ((i=baseName.find(
'.'))!=-1)
1797 baseName=baseName.left(i);
1799 baseName.prepend(
"dia_");
1815 QCString shortName = baseName;
1817 if ((i=shortName.findRev(
'/'))!=-1)
1819 shortName=shortName.right(shortName.length()-i-1);
1830 QCString shortName = baseName;
1832 if ((i=shortName.findRev(
'/'))!=-1)
1834 shortName=shortName.right(shortName.length()-i-1);