Doxygen
Loading...
Searching...
No Matches
latexdocvisitor.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2022 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16#include <algorithm>
17#include <array>
18
19#include "htmlattrib.h"
20#include "latexdocvisitor.h"
21#include "latexgen.h"
22#include "docparser.h"
23#include "language.h"
24#include "doxygen.h"
25#include "outputgen.h"
26#include "outputlist.h"
27#include "dot.h"
28#include "util.h"
29#include "message.h"
30#include "parserintf.h"
31#include "msc.h"
32#include "dia.h"
33#include "cite.h"
34#include "filedef.h"
35#include "config.h"
36#include "htmlentity.h"
37#include "emoji.h"
38#include "plantuml.h"
39#include "fileinfo.h"
40#include "regex.h"
41#include "portable.h"
42#include "codefragment.h"
43
44static const int g_maxLevels = 7;
45static const std::array<const char *,g_maxLevels> g_secLabels =
46{ "doxysection",
47 "doxysubsection",
48 "doxysubsubsection",
49 "doxysubsubsubsection",
50 "doxysubsubsubsubsection",
51 "doxysubsubsubsubsubsection",
52 "doxysubsubsubsubsubsubsection"
53};
54
55static const char *g_paragraphLabel = "doxyparagraph";
56static const char *g_subparagraphLabel = "doxysubparagraph";
57
58const char *LatexDocVisitor::getSectionName(int level) const
59{
60 bool compactLatex = Config_getBool(COMPACT_LATEX);
61 int l = level;
62 if (compactLatex) l++;
63
64 if (l < g_maxLevels)
65 {
66 l += m_hierarchyLevel; /* May be -1 if generating main page */
67 // Sections get special treatment because they inherit the parent's level
68 if (l >= g_maxLevels)
69 {
70 l = g_maxLevels - 1;
71 }
72 else if (l < 0)
73 {
74 /* Should not happen; level is always >= 1 and hierarchyLevel >= -1 */
75 l = 0;
76 }
77 return g_secLabels[l];
78 }
79 else if (l == 7)
80 {
81 return g_paragraphLabel;
82 }
83 else
84 {
86 }
87}
88
89static void insertDimension(TextStream &t, QCString dimension, const char *orientationString)
90{
91 // dimensions for latex images can be a percentage, in this case they need some extra
92 // handling as the % symbol is used for comments
93 static const reg::Ex re(R"((\d+)%)");
94 std::string s = dimension.str();
95 reg::Match match;
96 if (reg::search(s,match,re))
97 {
98 bool ok = false;
99 double percent = QCString(match[1].str()).toInt(&ok);
100 if (ok)
101 {
102 t << percent/100.0 << "\\text" << orientationString;
103 return;
104 }
105 }
106 t << dimension;
107}
108
109static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage = FALSE)
110{
111 if (inlineImage)
112 {
113 t << "\n\\begin{DoxyInlineImage}\n";
114 }
115 else
116 {
117 if (hasCaption)
118 {
119 t << "\n\\begin{DoxyImage}\n";
120 }
121 else
122 {
123 t << "\n\\begin{DoxyImageNoCaption}\n"
124 " \\mbox{";
125 }
126 }
127
128 t << "\\includegraphics";
129 if (!width.isEmpty() || !height.isEmpty())
130 {
131 t << "[";
132 }
133 if (!width.isEmpty())
134 {
135 t << "width=";
136 insertDimension(t, width, "width");
137 }
138 if (!width.isEmpty() && !height.isEmpty())
139 {
140 t << ",";
141 }
142 if (!height.isEmpty())
143 {
144 t << "height=";
145 insertDimension(t, height, "height");
146 }
147 if (width.isEmpty() && height.isEmpty())
148 {
149 /* default setting */
150 if (inlineImage)
151 {
152 t << "[height=\\baselineskip,keepaspectratio=true]";
153 }
154 else
155 {
156 t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]";
157 }
158 }
159 else
160 {
161 t << "]";
162 }
163
164 t << "{" << name << "}";
165
166 if (hasCaption)
167 {
168 if (!inlineImage)
169 {
170 if (Config_getBool(PDF_HYPERLINKS))
171 {
172 t << "\n\\doxyfigcaption{";
173 }
174 else
175 {
176 t << "\n\\doxyfigcaptionnolink{";
177 }
178 }
179 else
180 {
181 t << "%"; // to catch the caption
182 }
183 }
184}
185
186
187
188static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage = FALSE)
189{
190 if (inlineImage)
191 {
192 t << "\n\\end{DoxyInlineImage}\n";
193 }
194 else
195 {
196 t << "}\n"; // end mbox or caption
197 if (hasCaption)
198 {
199 t << "\\end{DoxyImage}\n";
200 }
201 else
202 {
203 t << "\\end{DoxyImageNoCaption}\n";
204 }
205 }
206}
207
208static QCString makeShortName(const QCString &name)
209{
210 QCString shortName = name;
211 int i = shortName.findRev('/');
212 if (i!=-1)
213 {
214 shortName=shortName.mid(i+1);
215 }
216 return shortName;
217}
218
219static QCString makeBaseName(const QCString &name)
220{
221 QCString baseName = makeShortName(name);
222 int i=baseName.find('.');
223 if (i!=-1)
224 {
225 baseName=baseName.left(i);
226 }
227 return baseName;
228}
229
230
232{
233 for (const auto &n : children)
234 {
235 std::visit(*this,n);
236 }
237}
238
240{
241 QCString result;
242 const char *p=s;
243 char str[2]; str[1]=0;
244 char c = 0;
245 if (p)
246 {
247 while ((c=*p++))
248 {
249 switch (c)
250 {
251 case '!': m_t << "\"!"; break;
252 case '"': m_t << "\"\""; break;
253 case '@': m_t << "\"@"; break;
254 case '|': m_t << "\\texttt{\"|}"; break;
255 case '[': m_t << "["; break;
256 case ']': m_t << "]"; break;
257 case '{': m_t << "\\lcurly{}"; break;
258 case '}': m_t << "\\rcurly{}"; break;
259 default: str[0]=c; filter(str); break;
260 }
261 }
262 }
263 return result;
264}
265
266
268 const QCString &langExt, int hierarchyLevel)
269 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(FALSE),
271 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
272{
273}
274
275 //--------------------------------------
276 // visitor functions for leaf nodes
277 //--------------------------------------
278
280{
281 if (m_hide) return;
282 filter(w.word());
283}
284
286{
287 if (m_hide) return;
288 startLink(w.ref(),w.file(),w.anchor());
289 filter(w.word());
290 endLink(w.ref(),w.file(),w.anchor());
291}
292
294{
295 if (m_hide) return;
296 if (m_insidePre)
297 {
298 m_t << w.chars();
299 }
300 else
301 {
302 m_t << " ";
303 }
304}
305
307{
308 if (m_hide) return;
309 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
310 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
311 if (res)
312 {
314 {
315 if (pdfHyperlinks)
316 {
317 m_t << "\\texorpdfstring{$<$}{<}";
318 }
319 else
320 {
321 m_t << "$<$";
322 }
323 }
325 {
326 if (pdfHyperlinks)
327 {
328 m_t << "\\texorpdfstring{$>$}{>}";
329 }
330 else
331 {
332 m_t << "$>$";
333 }
334 }
335 else
336 {
337 m_t << res;
338 }
339 }
340 else
341 {
342 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
343 }
344}
345
347{
348 if (m_hide) return;
350 if (!emojiName.isEmpty())
351 {
352 QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
353 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
354 filter(emojiName);
355 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
356 }
357 else
358 {
359 m_t << s.name();
360 }
361}
362
364{
365 if (m_hide) return;
366 if (Config_getBool(PDF_HYPERLINKS))
367 {
368 m_t << "\\href{";
369 if (u.isEmail()) m_t << "mailto:";
370 m_t << latexFilterURL(u.url()) << "}";
371 }
372 m_t << "{\\texttt{ ";
373 filter(u.url());
374 m_t << "}}";
375}
376
378{
379 if (m_hide) return;
380 m_t << "~\\newline\n";
381}
382
384{
385 if (m_hide) return;
386 if (insideTable())
387 m_t << "\\DoxyHorRuler{1}\n";
388 else
389 m_t << "\\DoxyHorRuler{0}\n";
390}
391
393{
394 if (m_hide) return;
395 switch (s.style())
396 {
398 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
399 break;
403 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
404 break;
407 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
408 break;
410 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
411 break;
415 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
416 break;
418 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
419 break;
421 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
422 break;
424 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
425 break;
427 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
428 break;
430 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
431 break;
433 if (s.enable())
434 {
435 m_t << "\n\\begin{DoxyPre}";
437 }
438 else
439 {
441 m_t << "\\end{DoxyPre}\n";
442 }
443 break;
444 case DocStyleChange::Div: /* HTML only */ break;
445 case DocStyleChange::Span: /* HTML only */ break;
446 }
447}
448
450{
451 if (m_hide) return;
452 QCString lang = m_langExt;
453 if (!s.language().isEmpty()) // explicit language setting
454 {
455 lang = s.language();
456 }
457 SrcLangExt langExt = getLanguageFromCodeLang(lang);
458 switch(s.type())
459 {
461 {
462 m_ci.startCodeFragment("DoxyCode");
463 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
464 Config_getBool(STRIP_CODE_COMMENTS),
465 s.isExample(),s.exampleFile());
466 m_ci.endCodeFragment("DoxyCode");
467 }
468 break;
470 filter(s.text(), true);
471 break;
473 m_t << "{\\ttfamily ";
474 filter(s.text(), true);
475 m_t << "}";
476 break;
478 m_t << "\\begin{DoxyVerb}";
479 m_t << s.text();
480 m_t << "\\end{DoxyVerb}\n";
481 break;
487 /* nothing */
488 break;
490 m_t << s.text();
491 break;
492 case DocVerbatim::Dot:
493 {
494 static int dotindex = 1;
495 QCString fileName(4096, QCString::ExplicitSize);
496
497 fileName.sprintf("%s%d%s",
498 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_"),
499 dotindex++,
500 ".dot"
501 );
502 std::ofstream file = Portable::openOutputStream(fileName);
503 if (!file.is_open())
504 {
505 err("Could not open file {} for writing\n",fileName);
506 }
507 else
508 {
509 file.write( s.text().data(), s.text().length() );
510 file.close();
511
512 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine());
513 visitChildren(s);
515
516 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
517 }
518 }
519 break;
520 case DocVerbatim::Msc:
521 {
522 static int mscindex = 1;
523 QCString baseName(4096, QCString::ExplicitSize);
524
525 baseName.sprintf("%s%d",
526 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_"),
527 mscindex++
528 );
529 QCString fileName = baseName+".msc";
530 std::ofstream file = Portable::openOutputStream(fileName);
531 if (!file.is_open())
532 {
533 err("Could not open file {} for writing\n",fileName);
534 }
535 else
536 {
537 QCString text = "msc {";
538 text+=s.text();
539 text+="}";
540 file.write( text.data(), text.length() );
541 file.close();
542
543 writeMscFile(baseName, s);
544
545 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
546 }
547 }
548 break;
550 {
551 QCString latexOutput = Config_getString(LATEX_OUTPUT);
553 latexOutput,s.exampleFile(),s.text(),
555 s.engine(),s.srcFile(),s.srcLine(),true);
556
557 writePlantUMLFile(baseName, s);
558 }
559 break;
560 }
561}
562
564{
565 if (m_hide) return;
566 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
567 if (!anc.file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
568 {
569 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
570 << "}%\n";
571 }
572}
573
575{
576 if (m_hide) return;
578 switch(inc.type())
579 {
581 {
582 m_ci.startCodeFragment("DoxyCodeInclude");
583 FileInfo cfi( inc.file().str() );
584 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
586 inc.text(),
587 langExt,
588 inc.stripCodeComments(),
589 inc.isExample(),
590 inc.exampleFile(),
591 fd.get(), // fileDef,
592 -1, // start line
593 -1, // end line
594 FALSE, // inline fragment
595 nullptr, // memberDef
596 TRUE // show line numbers
597 );
598 m_ci.endCodeFragment("DoxyCodeInclude");
599 }
600 break;
602 {
603 m_ci.startCodeFragment("DoxyCodeInclude");
605 inc.text(),langExt,
606 inc.stripCodeComments(),
607 inc.isExample(),
608 inc.exampleFile(),
609 nullptr, // fileDef
610 -1, // startLine
611 -1, // endLine
612 TRUE, // inlineFragment
613 nullptr, // memberDef
614 FALSE
615 );
616 m_ci.endCodeFragment("DoxyCodeInclude");
617 }
618 break;
626 break;
628 m_t << inc.text();
629 break;
631 m_t << "\n\\begin{DoxyVerbInclude}\n";
632 m_t << inc.text();
633 m_t << "\\end{DoxyVerbInclude}\n";
634 break;
637 {
638 m_ci.startCodeFragment("DoxyCodeInclude");
640 inc.file(),
641 inc.blockId(),
642 inc.context(),
644 inc.trimLeft(),
646 );
647 m_ci.endCodeFragment("DoxyCodeInclude");
648 }
649 break;
650 }
651}
652
654{
655 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
656 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
657 if (op.isFirst())
658 {
659 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
661 m_hide = TRUE;
662 }
664 if (locLangExt.isEmpty()) locLangExt = m_langExt;
665 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
666 if (op.type()!=DocIncOperator::Skip)
667 {
668 m_hide = popHidden();
669 if (!m_hide)
670 {
671 std::unique_ptr<FileDef> fd;
672 if (!op.includeFileName().isEmpty())
673 {
674 FileInfo cfi( op.includeFileName().str() );
675 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
676 }
677
678 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
680 op.isExample(),op.exampleFile(),
681 fd.get(), // fileDef
682 op.line(), // startLine
683 -1, // endLine
684 FALSE, // inline fragment
685 nullptr, // memberDef
686 op.showLineNo() // show line numbers
687 );
688 }
690 m_hide=TRUE;
691 }
692 if (op.isLast())
693 {
695 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
696 }
697 else
698 {
699 if (!m_hide) m_t << "\n";
700 }
701}
702
704{
705 if (m_hide) return;
706 QCString s = f.text();
707 const char *p = s.data();
708 char c = 0;
709 if (p)
710 {
711 while ((c=*p++))
712 {
713 switch (c)
714 {
715 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
716 default: m_t << c; break;
717 }
718 }
719 }
720}
721
723{
724 if (m_hide) return;
725 m_t << "\\index{";
727 m_t << "@{";
729 m_t << "}}";
730}
731
735
737{
738 if (m_hide) return;
739 if (!cite.file().isEmpty())
740 {
741 //startLink(cite.ref(),cite.file(),cite.anchor());
742 QCString anchor = cite.anchor();
744 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
745 m_t << "\\cite{" << anchor << "}";
746 }
747 else
748 {
749 m_t << "{\\bfseries [";
750 filter(cite.text());
751 m_t << "]}";
752 }
753}
754
755//--------------------------------------
756// visitor functions for compound nodes
757//--------------------------------------
758
760{
761 if (m_hide) return;
762 if (m_indentLevel>=maxIndentLevels-1) return;
763 if (l.isEnumList())
764 {
765 m_t << "\n\\begin{DoxyEnumerate}";
766 m_listItemInfo[indentLevel()].isEnum = true;
767 }
768 else
769 {
770 m_listItemInfo[indentLevel()].isEnum = false;
771 m_t << "\n\\begin{DoxyItemize}";
772 }
773 visitChildren(l);
774 if (l.isEnumList())
775 {
776 m_t << "\n\\end{DoxyEnumerate}";
777 }
778 else
779 {
780 m_t << "\n\\end{DoxyItemize}";
781 }
782}
783
785{
786 if (m_hide) return;
787 switch (li.itemNumber())
788 {
789 case DocAutoList::Unchecked: // unchecked
790 m_t << "\n\\item[\\DoxyUnchecked] ";
791 break;
792 case DocAutoList::Checked_x: // checked with x
793 case DocAutoList::Checked_X: // checked with X
794 m_t << "\n\\item[\\DoxyChecked] ";
795 break;
796 default:
797 m_t << "\n\\item ";
798 break;
799 }
801 visitChildren(li);
803}
804
806{
807 if (m_hide) return;
808 visitChildren(p);
809 if (!p.isLast() && // omit <p> for last paragraph
810 !(p.parent() && // and for parameter sections
811 std::get_if<DocParamSect>(p.parent())
812 )
813 ) m_t << "\n\n";
814}
815
817{
818 visitChildren(r);
819}
820
822{
823 if (m_hide) return;
824 switch(s.type())
825 {
827 m_t << "\\begin{DoxySeeAlso}{";
828 filter(theTranslator->trSeeAlso());
829 break;
831 m_t << "\\begin{DoxyReturn}{";
832 filter(theTranslator->trReturns());
833 break;
835 m_t << "\\begin{DoxyAuthor}{";
836 filter(theTranslator->trAuthor(TRUE,TRUE));
837 break;
839 m_t << "\\begin{DoxyAuthor}{";
840 filter(theTranslator->trAuthor(TRUE,FALSE));
841 break;
843 m_t << "\\begin{DoxyVersion}{";
844 filter(theTranslator->trVersion());
845 break;
847 m_t << "\\begin{DoxySince}{";
848 filter(theTranslator->trSince());
849 break;
851 m_t << "\\begin{DoxyDate}{";
852 filter(theTranslator->trDate());
853 break;
855 m_t << "\\begin{DoxyNote}{";
856 filter(theTranslator->trNote());
857 break;
859 m_t << "\\begin{DoxyWarning}{";
860 filter(theTranslator->trWarning());
861 break;
863 m_t << "\\begin{DoxyPrecond}{";
864 filter(theTranslator->trPrecondition());
865 break;
867 m_t << "\\begin{DoxyPostcond}{";
868 filter(theTranslator->trPostcondition());
869 break;
871 m_t << "\\begin{DoxyCopyright}{";
872 filter(theTranslator->trCopyright());
873 break;
875 m_t << "\\begin{DoxyInvariant}{";
876 filter(theTranslator->trInvariant());
877 break;
879 m_t << "\\begin{DoxyRemark}{";
880 filter(theTranslator->trRemarks());
881 break;
883 m_t << "\\begin{DoxyAttention}{";
884 filter(theTranslator->trAttention());
885 break;
887 m_t << "\\begin{DoxyImportant}{";
888 filter(theTranslator->trImportant());
889 break;
891 m_t << "\\begin{DoxyParagraph}{";
892 break;
894 m_t << "\\begin{DoxyParagraph}{";
895 break;
896 case DocSimpleSect::Unknown: break;
897 }
898
899 if (s.title())
900 {
902 std::visit(*this,*s.title());
904 }
905 m_t << "}\n";
907 visitChildren(s);
908 switch(s.type())
909 {
911 m_t << "\n\\end{DoxySeeAlso}\n";
912 break;
914 m_t << "\n\\end{DoxyReturn}\n";
915 break;
917 m_t << "\n\\end{DoxyAuthor}\n";
918 break;
920 m_t << "\n\\end{DoxyAuthor}\n";
921 break;
923 m_t << "\n\\end{DoxyVersion}\n";
924 break;
926 m_t << "\n\\end{DoxySince}\n";
927 break;
929 m_t << "\n\\end{DoxyDate}\n";
930 break;
932 m_t << "\n\\end{DoxyNote}\n";
933 break;
935 m_t << "\n\\end{DoxyWarning}\n";
936 break;
938 m_t << "\n\\end{DoxyPrecond}\n";
939 break;
941 m_t << "\n\\end{DoxyPostcond}\n";
942 break;
944 m_t << "\n\\end{DoxyCopyright}\n";
945 break;
947 m_t << "\n\\end{DoxyInvariant}\n";
948 break;
950 m_t << "\n\\end{DoxyRemark}\n";
951 break;
953 m_t << "\n\\end{DoxyAttention}\n";
954 break;
956 m_t << "\n\\end{DoxyImportant}\n";
957 break;
959 m_t << "\n\\end{DoxyParagraph}\n";
960 break;
962 m_t << "\n\\end{DoxyParagraph}\n";
963 break;
964 default:
965 break;
966 }
968}
969
971{
972 if (m_hide) return;
973 visitChildren(t);
974}
975
977{
978 if (m_hide) return;
979 m_t << "\\begin{DoxyItemize}\n";
980 m_listItemInfo[indentLevel()].isEnum = false;
981 visitChildren(l);
982 m_t << "\\end{DoxyItemize}\n";
983}
984
986{
987 if (m_hide) return;
988 m_t << "\\item ";
990 if (li.paragraph())
991 {
992 visit(*this,*li.paragraph());
993 }
995}
996
998{
999 if (m_hide) return;
1000 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1001 if (pdfHyperlinks)
1002 {
1003 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1004 }
1005 m_t << "\\" << getSectionName(s.level()) << "{";
1006 if (pdfHyperlinks)
1007 {
1008 m_t << "\\texorpdfstring{";
1009 }
1010 if (s.title())
1011 {
1012 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1013 std::visit(*this,*s.title());
1015 }
1016 if (pdfHyperlinks)
1017 {
1018 m_t << "}{";
1019 if (s.title())
1020 {
1021 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1022 std::visit(*this,*s.title());
1024 }
1025 m_t << "}";
1026 }
1027 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1028 visitChildren(s);
1029}
1030
1032{
1033 if (m_hide) return;
1034 if (m_indentLevel>=maxIndentLevels-1) return;
1036 if (s.type()==DocHtmlList::Ordered)
1037 {
1038 bool first = true;
1039 m_t << "\n\\begin{DoxyEnumerate}";
1040 for (const auto &opt : s.attribs())
1041 {
1042 if (opt.name=="type")
1043 {
1044 if (opt.value=="1")
1045 {
1046 m_t << (first ? "[": ",");
1047 m_t << "label=\\arabic*";
1048 first = false;
1049 }
1050 else if (opt.value=="a")
1051 {
1052 m_t << (first ? "[": ",");
1053 m_t << "label=\\enumalphalphcnt*";
1054 first = false;
1055 }
1056 else if (opt.value=="A")
1057 {
1058 m_t << (first ? "[": ",");
1059 m_t << "label=\\enumAlphAlphcnt*";
1060 first = false;
1061 }
1062 else if (opt.value=="i")
1063 {
1064 m_t << (first ? "[": ",");
1065 m_t << "label=\\roman*";
1066 first = false;
1067 }
1068 else if (opt.value=="I")
1069 {
1070 m_t << (first ? "[": ",");
1071 m_t << "label=\\Roman*";
1072 first = false;
1073 }
1074 }
1075 else if (opt.name=="start")
1076 {
1077 m_t << (first ? "[": ",");
1078 bool ok = false;
1079 int val = opt.value.toInt(&ok);
1080 if (ok) m_t << "start=" << val;
1081 first = false;
1082 }
1083 }
1084 if (!first) m_t << "]\n";
1085 }
1086 else
1087 {
1088 m_t << "\n\\begin{DoxyItemize}";
1089 }
1090 visitChildren(s);
1091 if (m_indentLevel>=maxIndentLevels-1) return;
1092 if (s.type()==DocHtmlList::Ordered)
1093 m_t << "\n\\end{DoxyEnumerate}";
1094 else
1095 m_t << "\n\\end{DoxyItemize}";
1096}
1097
1099{
1100 if (m_hide) return;
1101 if (m_listItemInfo[indentLevel()].isEnum)
1102 {
1103 for (const auto &opt : l.attribs())
1104 {
1105 if (opt.name=="value")
1106 {
1107 bool ok = false;
1108 int val = opt.value.toInt(&ok);
1109 if (ok)
1110 {
1111 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1112 }
1113 }
1114 }
1115 }
1116 m_t << "\n\\item ";
1118 visitChildren(l);
1120}
1121
1122
1124{
1125 HtmlAttribList attrs = dl.attribs();
1126 auto it = std::find_if(attrs.begin(),attrs.end(),
1127 [](const auto &att) { return att.name=="class"; });
1128 if (it!=attrs.end() && it->value == "reflist") return true;
1129 return false;
1130}
1131
1132static bool listIsNested(const DocHtmlDescList &dl)
1133{
1134 bool isNested=false;
1135 const DocNodeVariant *n = dl.parent();
1136 while (n && !isNested)
1137 {
1138 if (std::get_if<DocHtmlDescList>(n))
1139 {
1140 isNested = !classEqualsReflist(std::get<DocHtmlDescList>(*n));
1141 }
1142 n = ::parent(n);
1143 }
1144 return isNested;
1145}
1146
1148{
1149 if (m_hide) return;
1150 bool eq = classEqualsReflist(dl);
1151 if (eq)
1152 {
1153 m_t << "\n\\begin{DoxyRefList}";
1154 }
1155 else
1156 {
1157 if (listIsNested(dl)) m_t << "\n\\hfill";
1158 m_t << "\n\\begin{DoxyDescription}";
1159 }
1160 visitChildren(dl);
1161 if (eq)
1162 {
1163 m_t << "\n\\end{DoxyRefList}";
1164 }
1165 else
1166 {
1167 m_t << "\n\\end{DoxyDescription}";
1168 }
1169}
1170
1172{
1173 if (m_hide) return;
1174 m_t << "\n\\item[";
1176 visitChildren(dt);
1178 m_t << "]";
1179}
1180
1182{
1184 if (!m_insideItem) m_t << "\\hfill";
1185 m_t << " \\\\\n";
1186 visitChildren(dd);
1188}
1189
1190static bool tableIsNested(const DocNodeVariant *n)
1191{
1192 bool isNested=FALSE;
1193 while (n && !isNested)
1194 {
1196 n = ::parent(n);
1197 }
1198 return isNested;
1199}
1200
1201static void writeStartTableCommand(TextStream &t,const DocNodeVariant *n,size_t cols)
1202{
1203 if (tableIsNested(n))
1204 {
1205 t << "{\\begin{tabularx}{\\linewidth}{|*{" << cols << "}{>{\\raggedright\\arraybackslash}X|}}";
1206 }
1207 else
1208 {
1209 t << "\\tabulinesep=1mm\n\\begin{longtabu}spread 0pt [c]{*{" << cols << "}{|X[-1]}|}\n";
1210 }
1211 //return isNested ? "TabularNC" : "TabularC";
1212}
1213
1215{
1216 if (tableIsNested(n))
1217 {
1218 t << "\\end{tabularx}}\n";
1219 }
1220 else
1221 {
1222 t << "\\end{longtabu}\n";
1223 }
1224 //return isNested ? "TabularNC" : "TabularC";
1225}
1226
1228{
1229 if (m_hide) return;
1231 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1232 if (c)
1233 {
1234 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1235 if (!c->file().isEmpty() && pdfHyperLinks)
1236 {
1237 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1238 << "}{}";
1239 }
1240 m_t << "\n";
1241 }
1242
1244
1245 if (c)
1246 {
1247 m_t << "\\caption{";
1248 std::visit(*this, *t.caption());
1249 m_t << "}";
1250 m_t << "\\label{" << stripPath(c->file()) << "_" << c->anchor() << "}";
1251 m_t << "\\\\\n";
1252 }
1253
1255 m_t << "\\hline\n";
1256
1257 // check if first row is a heading and then render the row already here
1258 // and end it with \endfirsthead (triggered via m_firstRow==TRUE)
1259 // then repeat the row as normal and end it with \endhead (m_firstRow==FALSE)
1260 const DocHtmlRow *firstRow = std::get_if<DocHtmlRow>(t.firstRow());
1261 if (firstRow && firstRow->isHeading())
1262 {
1264 if (!tableIsNested(t.parent()))
1265 {
1266 std::visit(*this,*t.firstRow());
1267 }
1269 }
1270 visitChildren(t);
1272 popTableState();
1273}
1274
1276{
1277 if (m_hide) return;
1278 visitChildren(c);
1279}
1280
1282{
1283 if (m_hide) return;
1285
1286 visitChildren(row);
1287
1288 size_t c=currentColumn();
1289 while (c<=numCols()) // end of row while inside a row span?
1290 {
1291 for (const auto &span : rowSpans())
1292 {
1293 //printf(" found row span: column=%d rs=%d cs=%d rowIdx=%d cell->rowIdx=%d i=%d c=%d\n",
1294 // span->column, span->rowSpan,span->colSpan,row.rowIndex(),span->cell->rowIndex(),i,c);
1295 if (span.rowSpan>0 && span.column==c && // we are at a cell in a row span
1296 row.rowIndex()>span.cell.rowIndex() // but not the row that started the span
1297 )
1298 {
1299 m_t << "&";
1300 if (span.colSpan>1) // row span is also part of a column span
1301 {
1302 m_t << "\\multicolumn{" << span.colSpan << "}{";
1303 m_t << "}|}{}";
1304 }
1305 else // solitary row span
1306 {
1307 m_t << "\\multicolumn{1}{c|}{}";
1308 }
1309 }
1310 }
1311 c++;
1312 }
1313
1314 m_t << "\\\\";
1315
1316 size_t col = 1;
1317 for (auto &span : rowSpans())
1318 {
1319 if (span.rowSpan>0) span.rowSpan--;
1320 if (span.rowSpan<=0)
1321 {
1322 // inactive span
1323 }
1324 else if (span.column>col)
1325 {
1326 m_t << "\\cline{" << col << "-" << (span.column-1) << "}";
1327 col = span.column+span.colSpan;
1328 }
1329 else
1330 {
1331 col = span.column+span.colSpan;
1332 }
1333 }
1334
1335 if (col <= numCols())
1336 {
1337 m_t << "\\cline{" << col << "-" << numCols() << "}";
1338 }
1339
1340 m_t << "\n";
1341
1342 const DocNodeVariant *n = ::parent(row.parent());
1343 if (row.isHeading() && row.rowIndex()==1 && !tableIsNested(n))
1344 {
1345 if (firstRow())
1346 {
1347 m_t << "\\endfirsthead\n";
1348 m_t << "\\hline\n";
1349 m_t << "\\endfoot\n";
1350 m_t << "\\hline\n";
1351 }
1352 else
1353 {
1354 m_t << "\\endhead\n";
1355 }
1356 }
1357}
1358
1360{
1361 if (m_hide) return;
1362
1363 const DocHtmlRow *row = std::get_if<DocHtmlRow>(c.parent());
1364
1366
1367 //Skip columns that span from above.
1368 for (const auto &span : rowSpans())
1369 {
1370 if (span.rowSpan>0 && span.column==currentColumn())
1371 {
1372 if (row && span.colSpan>1)
1373 {
1374 m_t << "\\multicolumn{" << span.colSpan << "}{";
1375 if (currentColumn() /*c.columnIndex()*/==1) // add extra | for first column
1376 {
1377 m_t << "|";
1378 }
1379 m_t << "l|}{" << (c.isHeading()? "\\columncolor{\\tableheadbgcolor}" : "") << "}"; // alignment not relevant, empty column
1380 setCurrentColumn(currentColumn()+span.colSpan);
1381 }
1382 else
1383 {
1385 }
1386 m_t << "&";
1387 }
1388 }
1389
1390 int cs = c.colSpan();
1391 int a = c.alignment();
1392 if (cs>1 && row)
1393 {
1395 m_t << "\\multicolumn{" << cs << "}{";
1396 if (c.columnIndex()==1) // add extra | for first column
1397 {
1398 m_t << "|";
1399 }
1400 switch (a)
1401 {
1402 case DocHtmlCell::Right:
1403 m_t << "r|}{";
1404 break;
1406 m_t << "c|}{";
1407 break;
1408 default:
1409 m_t << "l|}{";
1410 break;
1411 }
1412 }
1413 int rs = c.rowSpan();
1414 int va = c.valignment();
1415 if (rs>0)
1416 {
1418 m_t << "\\multirow";
1419 switch(va)
1420 {
1421 case DocHtmlCell::Top:
1422 m_t << "[t]";
1423 break;
1425 m_t << "[b]";
1426 break;
1428 break; // No alignment option needed
1429 default:
1430 break;
1431 }
1432 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%d\n",
1433 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1434 // currentColumn());
1436 m_t << "{" << rs << "}{*}{";
1437 }
1438 if (a==DocHtmlCell::Center)
1439 {
1440 m_t << "\\PBS\\centering ";
1441 }
1442 else if (a==DocHtmlCell::Right)
1443 {
1444 m_t << "\\PBS\\raggedleft ";
1445 }
1446 if (c.isHeading())
1447 {
1448 m_t << "\\cellcolor{\\tableheadbgcolor}\\textbf{ ";
1449 }
1450 if (cs>1)
1451 {
1453 }
1454
1455 visitChildren(c);
1456
1457 if (c.isHeading())
1458 {
1459 m_t << "}";
1460 }
1461 if (inRowSpan())
1462 {
1464 m_t << "}";
1465 }
1466 if (inColSpan())
1467 {
1469 m_t << "}";
1470 }
1471 if (!c.isLast()) m_t << "&";
1472}
1473
1475{
1476 if (m_hide) return;
1477 visitChildren(i);
1478}
1479
1481{
1482 if (m_hide) return;
1483 if (Config_getBool(PDF_HYPERLINKS))
1484 {
1485 m_t << "\\href{";
1486 m_t << latexFilterURL(href.url());
1487 m_t << "}";
1488 }
1489 m_t << "{\\texttt{ ";
1490 visitChildren(href);
1491 m_t << "}}";
1492}
1493
1495{
1496 if (m_hide) return;
1497 m_t << "{\\bfseries{";
1498 visitChildren(d);
1499 m_t << "}}";
1500}
1501
1503{
1504 if (m_hide) return;
1505 m_t << "\n\n";
1506 auto summary = d.summary();
1507 if (summary)
1508 {
1509 std::visit(*this,*summary);
1510 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1511 }
1512 visitChildren(d);
1513 if (summary)
1514 {
1515 m_t << "\\end{adjustwidth}\n";
1516 }
1517 else
1518 {
1519 m_t << "\n\n";
1520 }
1521}
1522
1524{
1525 if (m_hide) return;
1526 m_t << "\\" << getSectionName(header.level()) << "*{";
1527 visitChildren(header);
1528 m_t << "}";
1529}
1530
1532{
1533 if (img.type()==DocImage::Latex)
1534 {
1535 if (m_hide) return;
1536 QCString gfxName = img.name();
1537 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1538 {
1539 gfxName=gfxName.left(gfxName.length()-4);
1540 }
1541
1542 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1543 visitChildren(img);
1545 }
1546 else // other format -> skip
1547 {
1548 }
1549}
1550
1552{
1553 if (m_hide) return;
1554 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1555 startDotFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1556 visitChildren(df);
1557 endDotFile(df.hasCaption());
1558}
1559
1561{
1562 if (m_hide) return;
1563 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1564 startMscFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1565 visitChildren(df);
1566 endMscFile(df.hasCaption());
1567}
1568
1570{
1571 if (m_hide) return;
1572 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1573 startDiaFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1574 visitChildren(df);
1575 endDiaFile(df.hasCaption());
1576}
1577
1579{
1580 if (m_hide) return;
1581 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1582 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1583 visitChildren(df);
1585}
1586
1588{
1589 if (m_hide) return;
1590 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1591 visitChildren(lnk);
1592 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1593}
1594
1596{
1597 if (m_hide) return;
1598 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1599 // ref.anchor() for LaTeX/RTF
1600 if (ref.isSubPage())
1601 {
1602 startLink(ref.ref(),QCString(),ref.anchor());
1603 }
1604 else
1605 {
1606 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1607 }
1608 if (!ref.hasLinkText())
1609 {
1610 filter(ref.targetTitle());
1611 }
1612 visitChildren(ref);
1613 if (ref.isSubPage())
1614 {
1615 endLink(ref.ref(),QCString(),ref.anchor());
1616 }
1617 else
1618 {
1619 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1620 }
1621}
1622
1624{
1625 if (m_hide) return;
1626 m_t << "\\item \\contentsline{section}{";
1627 if (ref.isSubPage())
1628 {
1629 startLink(ref.ref(),QCString(),ref.anchor());
1630 }
1631 else
1632 {
1633 if (!ref.file().isEmpty())
1634 {
1635 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1636 }
1637 }
1638 visitChildren(ref);
1639 if (ref.isSubPage())
1640 {
1641 endLink(ref.ref(),QCString(),ref.anchor());
1642 }
1643 else
1644 {
1645 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1646 }
1647 m_t << "}{\\ref{";
1648 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1649 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1650 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1651 m_t << "}}{}\n";
1652}
1653
1655{
1656 if (m_hide) return;
1657 m_t << "\\footnotesize\n";
1658 m_t << "\\begin{multicols}{2}\n";
1659 m_t << "\\begin{DoxyCompactList}\n";
1661 visitChildren(l);
1663 m_t << "\\end{DoxyCompactList}\n";
1664 m_t << "\\end{multicols}\n";
1665 m_t << "\\normalsize\n";
1666}
1667
1669{
1670 if (m_hide) return;
1671 bool hasInOutSpecs = s.hasInOutSpecifier();
1672 bool hasTypeSpecs = s.hasTypeSpecifier();
1673 m_lcg.incUsedTableLevel();
1674 switch(s.type())
1675 {
1677 m_t << "\n\\begin{DoxyParams}";
1678 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1679 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1680 m_t << "{";
1681 filter(theTranslator->trParameters());
1682 break;
1684 m_t << "\n\\begin{DoxyRetVals}{";
1685 filter(theTranslator->trReturnValues());
1686 break;
1688 m_t << "\n\\begin{DoxyExceptions}{";
1689 filter(theTranslator->trExceptions());
1690 break;
1692 m_t << "\n\\begin{DoxyTemplParams}{";
1693 filter(theTranslator->trTemplateParameters());
1694 break;
1695 default:
1696 ASSERT(0);
1698 }
1699 m_t << "}\n";
1700 visitChildren(s);
1701 m_lcg.decUsedTableLevel();
1702 switch(s.type())
1703 {
1705 m_t << "\\end{DoxyParams}\n";
1706 break;
1708 m_t << "\\end{DoxyRetVals}\n";
1709 break;
1711 m_t << "\\end{DoxyExceptions}\n";
1712 break;
1714 m_t << "\\end{DoxyTemplParams}\n";
1715 break;
1716 default:
1717 ASSERT(0);
1719 }
1720}
1721
1723{
1724 m_t << " " << sep.chars() << " ";
1725}
1726
1728{
1729 if (m_hide) return;
1731 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1732 if (sect)
1733 {
1734 parentType = sect->type();
1735 }
1736 bool useTable = parentType==DocParamSect::Param ||
1737 parentType==DocParamSect::RetVal ||
1738 parentType==DocParamSect::Exception ||
1739 parentType==DocParamSect::TemplateParam;
1740 if (!useTable)
1741 {
1742 m_t << "\\item[";
1743 }
1744 if (sect && sect->hasInOutSpecifier())
1745 {
1747 {
1748 m_t << "\\mbox{\\texttt{ ";
1749 if (pl.direction()==DocParamSect::In)
1750 {
1751 m_t << "in";
1752 }
1753 else if (pl.direction()==DocParamSect::Out)
1754 {
1755 m_t << "out";
1756 }
1757 else if (pl.direction()==DocParamSect::InOut)
1758 {
1759 m_t << "in,out";
1760 }
1761 m_t << "}} ";
1762 }
1763 if (useTable) m_t << " & ";
1764 }
1765 if (sect && sect->hasTypeSpecifier())
1766 {
1767 for (const auto &type : pl.paramTypes())
1768 {
1769 std::visit(*this,type);
1770 }
1771 if (useTable) m_t << " & ";
1772 }
1773 m_t << "{\\em ";
1774 bool first=TRUE;
1775 for (const auto &param : pl.parameters())
1776 {
1777 if (!first) m_t << ","; else first=FALSE;
1779 std::visit(*this,param);
1781 }
1782 m_t << "}";
1783 if (useTable)
1784 {
1785 m_t << " & ";
1786 }
1787 else
1788 {
1789 m_t << "]";
1790 }
1791 for (const auto &par : pl.paragraphs())
1792 {
1793 std::visit(*this,par);
1794 }
1795 if (useTable)
1796 {
1797 m_t << "\\\\\n"
1798 << "\\hline\n";
1799 }
1800}
1801
1803{
1804 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1805 if (m_hide) return;
1806 if (x.title().isEmpty()) return;
1808 m_t << "\\begin{DoxyRefDesc}{";
1809 filter(x.title());
1810 m_t << "}\n";
1811 bool anonymousEnum = x.file()=="@";
1812 m_t << "\\item[";
1813 if (pdfHyperlinks && !anonymousEnum)
1814 {
1815 m_t << "\\mbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1816 }
1817 else
1818 {
1819 m_t << "\\textbf{ ";
1820 }
1822 filter(x.title());
1824 if (pdfHyperlinks && !anonymousEnum)
1825 {
1826 m_t << "}";
1827 }
1828 m_t << "}]";
1829 visitChildren(x);
1830 if (x.title().isEmpty()) return;
1832 m_t << "\\end{DoxyRefDesc}\n";
1833}
1834
1836{
1837 if (m_hide) return;
1838 startLink(QCString(),ref.file(),ref.anchor());
1839 visitChildren(ref);
1840 endLink(QCString(),ref.file(),ref.anchor());
1841}
1842
1844{
1845 if (m_hide) return;
1846 visitChildren(t);
1847}
1848
1850{
1851 if (m_hide) return;
1852 m_t << "\\begin{quote}\n";
1854 visitChildren(q);
1855 m_t << "\\end{quote}\n";
1857}
1858
1862
1864{
1865 if (m_hide) return;
1866 visitChildren(pb);
1867}
1868
1869void LatexDocVisitor::filter(const QCString &str, const bool retainNewLine)
1870{
1871 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d\n",qPrint(str),m_ci.insideTabbing());
1873 m_lcg.insideTabbing(),
1876 m_lcg.usedTableLevel()>0, // insideTable
1877 false, // keepSpaces
1878 retainNewLine
1879 );
1880}
1881
1882void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,
1883 bool refToTable,bool refToSection)
1884{
1885 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1886 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1887 {
1888 if (refToTable)
1889 {
1890 m_t << "\\doxytablelink{";
1891 }
1892 else if (refToSection)
1893 {
1894 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1895 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1896 }
1897 else
1898 {
1899 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1900 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1901 }
1902 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1903 {
1904 if (!file.isEmpty()) m_t << stripPath(file);
1905 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1906 if (!anchor.isEmpty()) m_t << anchor;
1907 m_t << "}";
1908 }
1909 m_t << "{";
1910 }
1911 else if (ref.isEmpty() && refToSection)
1912 {
1913 m_t << "\\doxysectref{";
1914 }
1915 else if (ref.isEmpty() && refToTable)
1916 {
1917 m_t << "\\doxytableref{";
1918 }
1919 else if (ref.isEmpty()) // internal non-PDF link
1920 {
1921 m_t << "\\doxyref{";
1922 }
1923 else // external link
1924 {
1925 m_t << "\\textbf{ ";
1926 }
1927}
1928
1929void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool /*refToTable*/,bool refToSection, SectionType sectionType)
1930{
1931 m_t << "}";
1932 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1933 if (ref.isEmpty() && !pdfHyperLinks)
1934 {
1935 m_t << "{";
1936 filter(theTranslator->trPageAbbreviation());
1937 m_t << "}{" << file;
1938 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1939 m_t << anchor << "}";
1940 if (refToSection)
1941 {
1942 m_t << "{" << sectionType.level() << "}";
1943 }
1944 }
1945 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1946 {
1947 if (refToSection)
1948 {
1949 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1950 }
1951 }
1952}
1953
1955 const QCString &width,
1956 const QCString &height,
1957 bool hasCaption,
1958 const QCString &srcFile,
1959 int srcLine
1960 )
1961{
1962 QCString baseName=makeBaseName(fileName);
1963 baseName.prepend("dot_");
1964 QCString outDir = Config_getString(LATEX_OUTPUT);
1965 QCString name = fileName;
1966 writeDotGraphFromFile(name,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
1967 visitPreStart(m_t,hasCaption, baseName, width, height);
1968}
1969
1970void LatexDocVisitor::endDotFile(bool hasCaption)
1971{
1972 if (m_hide) return;
1973 visitPostEnd(m_t,hasCaption);
1974}
1975
1977 const QCString &width,
1978 const QCString &height,
1979 bool hasCaption,
1980 const QCString &srcFile,
1981 int srcLine
1982 )
1983{
1984 QCString baseName=makeBaseName(fileName);
1985 baseName.prepend("msc_");
1986
1987 QCString outDir = Config_getString(LATEX_OUTPUT);
1988 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
1989 visitPreStart(m_t,hasCaption, baseName, width, height);
1990}
1991
1992void LatexDocVisitor::endMscFile(bool hasCaption)
1993{
1994 if (m_hide) return;
1995 visitPostEnd(m_t,hasCaption);
1996}
1997
1998
2000{
2001 QCString shortName = makeShortName(baseName);
2002 QCString outDir = Config_getString(LATEX_OUTPUT);
2003 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
2004 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
2007}
2008
2009
2011 const QCString &width,
2012 const QCString &height,
2013 bool hasCaption,
2014 const QCString &srcFile,
2015 int srcLine
2016 )
2017{
2018 QCString baseName=makeBaseName(fileName);
2019 baseName.prepend("dia_");
2020
2021 QCString outDir = Config_getString(LATEX_OUTPUT);
2022 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
2023 visitPreStart(m_t,hasCaption, baseName, width, height);
2024}
2025
2026void LatexDocVisitor::endDiaFile(bool hasCaption)
2027{
2028 if (m_hide) return;
2029 visitPostEnd(m_t,hasCaption);
2030}
2031
2032
2034{
2035 QCString shortName = makeShortName(baseName);
2036 QCString outDir = Config_getString(LATEX_OUTPUT);
2037 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::EPS,s.srcFile(),s.srcLine());
2038 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2041}
2042
2044{
2045 QCString shortName = makeShortName(baseName);
2046 if (s.useBitmap())
2047 {
2048 if (shortName.find('.')==-1) shortName += ".png";
2049 }
2050 QCString outDir = Config_getString(LATEX_OUTPUT);
2053 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2056}
2057
2059 const QCString &width,
2060 const QCString &height,
2061 bool hasCaption,
2062 const QCString &srcFile,
2063 int srcLine
2064 )
2065{
2066 QCString outDir = Config_getString(LATEX_OUTPUT);
2067 std::string inBuf;
2068 readInputFile(fileName,inBuf);
2069
2070 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2072 outDir,QCString(),inBuf.c_str(),
2074 QCString(),srcFile,srcLine,false);
2075 baseName=makeBaseName(baseName);
2076 QCString shortName = makeShortName(baseName);
2077 if (useBitmap)
2078 {
2079 if (shortName.find('.')==-1) shortName += ".png";
2080 }
2083 visitPreStart(m_t,hasCaption, shortName, width, height);
2084}
2085
2087{
2088 if (m_hide) return;
2089 visitPostEnd(m_t,hasCaption);
2090}
2091
2093{
2094 return std::min(m_indentLevel,maxIndentLevels-1);
2095}
2096
2098{
2099 m_indentLevel++;
2101 {
2102 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2103 }
2104}
2105
2107{
2108 if (m_indentLevel>0)
2109 {
2110 m_indentLevel--;
2111 }
2112}
2113
QCString anchorPrefix() const
Definition cite.cpp:122
static CitationManager & instance()
Definition cite.cpp:80
void parseCodeFragment(OutputCodeList &codeOutList, const QCString &fileName, const QCString &blockId, const QCString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
static CodeFragmentManager & instance()
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool stripCodeComments, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=nullptr, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=nullptr, bool showLineNumbers=TRUE, const Definition *searchCtx=nullptr, bool collectXRefs=TRUE)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
Class representing a directory in the file system.
Definition dir.h:75
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition dir.cpp:314
Node representing an anchor.
Definition docnode.h:228
QCString anchor() const
Definition docnode.h:231
QCString file() const
Definition docnode.h:232
Node representing an auto List.
Definition docnode.h:567
bool isEnumList() const
Definition docnode.h:576
Node representing an item of a auto list.
Definition docnode.h:591
int itemNumber() const
Definition docnode.h:594
Node representing a citation of some bibliographic reference.
Definition docnode.h:244
QCString text() const
Definition docnode.h:251
QCString anchor() const
Definition docnode.h:250
QCString file() const
Definition docnode.h:247
Node representing a dia file.
Definition docnode.h:726
QCString height() const
Definition docnode.h:684
QCString srcFile() const
Definition docnode.h:686
QCString file() const
Definition docnode.h:680
int srcLine() const
Definition docnode.h:687
bool hasCaption() const
Definition docnode.h:682
QCString width() const
Definition docnode.h:683
Node representing a dot file.
Definition docnode.h:708
Node representing an emoji.
Definition docnode.h:337
int index() const
Definition docnode.h:341
QCString name() const
Definition docnode.h:340
Node representing an item of a cross-referenced list.
Definition docnode.h:525
QCString text() const
Definition docnode.h:529
Node representing a Hypertext reference.
Definition docnode.h:818
QCString url() const
Definition docnode.h:825
Node representing a horizontal ruler.
Definition docnode.h:215
Node representing an HTML blockquote.
Definition docnode.h:1286
Node representing a HTML table caption.
Definition docnode.h:1223
QCString anchor() const
Definition docnode.h:1230
QCString file() const
Definition docnode.h:1229
Node representing a HTML table cell.
Definition docnode.h:1188
Valignment valignment() const
Definition docnode.cpp:1876
uint32_t columnIndex() const
Definition docnode.h:1204
uint32_t rowSpan() const
Definition docnode.cpp:1814
Alignment alignment() const
Definition docnode.cpp:1838
bool isLast() const
Definition docnode.h:1197
bool isHeading() const
Definition docnode.h:1195
uint32_t colSpan() const
Definition docnode.cpp:1826
Node representing a HTML description data.
Definition docnode.h:1176
Node representing a Html description list.
Definition docnode.h:896
const HtmlAttribList & attribs() const
Definition docnode.h:900
Node representing a Html description item.
Definition docnode.h:883
Node Html details.
Definition docnode.h:852
const DocNodeVariant * summary() const
Definition docnode.h:859
Node Html heading.
Definition docnode.h:868
int level() const
Definition docnode.h:872
Node representing a Html list.
Definition docnode.h:995
const HtmlAttribList & attribs() const
Definition docnode.h:1001
Type type() const
Definition docnode.h:1000
Node representing a HTML list item.
Definition docnode.h:1160
const HtmlAttribList & attribs() const
Definition docnode.h:1165
Node representing a HTML table row.
Definition docnode.h:1241
bool isHeading() const
Definition docnode.cpp:1898
uint32_t rowIndex() const
Definition docnode.h:1253
Node Html summary.
Definition docnode.h:839
Node representing a HTML table.
Definition docnode.h:1264
size_t numColumns() const
Definition docnode.h:1273
const DocNodeVariant * caption() const
Definition docnode.cpp:2044
const DocNodeVariant * firstRow() const
Definition docnode.cpp:2049
Node representing an image.
Definition docnode.h:637
QCString name() const
Definition docnode.h:643
QCString height() const
Definition docnode.h:646
Type type() const
Definition docnode.h:642
QCString width() const
Definition docnode.h:645
bool isInlineImage() const
Definition docnode.h:649
bool hasCaption() const
Definition docnode.h:644
Node representing a include/dontinclude operator block.
Definition docnode.h:473
bool stripCodeComments() const
Definition docnode.h:502
bool isLast() const
Definition docnode.h:499
QCString includeFileName() const
Definition docnode.h:505
QCString text() const
Definition docnode.h:495
QCString context() const
Definition docnode.h:497
QCString exampleFile() const
Definition docnode.h:504
int line() const
Definition docnode.h:493
Type type() const
Definition docnode.h:481
bool isFirst() const
Definition docnode.h:498
bool showLineNo() const
Definition docnode.h:494
bool isExample() const
Definition docnode.h:503
Node representing an included text block from file.
Definition docnode.h:431
QCString blockId() const
Definition docnode.h:450
QCString extension() const
Definition docnode.h:446
bool stripCodeComments() const
Definition docnode.h:451
@ LatexInclude
Definition docnode.h:433
@ SnippetWithLines
Definition docnode.h:434
@ DontIncWithLines
Definition docnode.h:435
@ IncWithLines
Definition docnode.h:434
@ HtmlInclude
Definition docnode.h:433
@ VerbInclude
Definition docnode.h:433
@ DontInclude
Definition docnode.h:433
@ DocbookInclude
Definition docnode.h:435
Type type() const
Definition docnode.h:447
QCString exampleFile() const
Definition docnode.h:453
QCString text() const
Definition docnode.h:448
QCString file() const
Definition docnode.h:445
bool trimLeft() const
Definition docnode.h:455
bool isExample() const
Definition docnode.h:452
QCString context() const
Definition docnode.h:449
Node representing an entry in the index.
Definition docnode.h:548
QCString entry() const
Definition docnode.h:555
Node representing an internal section of documentation.
Definition docnode.h:964
Node representing an internal reference to some item.
Definition docnode.h:802
QCString file() const
Definition docnode.h:806
QCString anchor() const
Definition docnode.h:808
Node representing a line break.
Definition docnode.h:201
Node representing a word that can be linked to something.
Definition docnode.h:164
QCString file() const
Definition docnode.h:170
QCString ref() const
Definition docnode.h:172
QCString word() const
Definition docnode.h:169
QCString anchor() const
Definition docnode.h:173
Node representing a msc file.
Definition docnode.h:717
DocNodeVariant * parent()
Definition docnode.h:89
Node representing an block of paragraphs.
Definition docnode.h:974
Node representing a paragraph in the documentation tree.
Definition docnode.h:1075
bool isLast() const
Definition docnode.h:1083
Node representing a parameter list.
Definition docnode.h:1120
const DocNodeList & parameters() const
Definition docnode.h:1124
const DocNodeList & paramTypes() const
Definition docnode.h:1125
DocParamSect::Direction direction() const
Definition docnode.h:1128
const DocNodeList & paragraphs() const
Definition docnode.h:1126
Node representing a parameter section.
Definition docnode.h:1048
bool hasInOutSpecifier() const
Definition docnode.h:1064
bool hasTypeSpecifier() const
Definition docnode.h:1065
Type type() const
Definition docnode.h:1063
Node representing a uml file.
Definition docnode.h:735
Node representing a reference to some item.
Definition docnode.h:773
QCString anchor() const
Definition docnode.h:780
SectionType sectionType() const
Definition docnode.h:782
QCString targetTitle() const
Definition docnode.h:781
bool isSubPage() const
Definition docnode.h:787
bool refToTable() const
Definition docnode.h:786
QCString file() const
Definition docnode.h:777
QCString ref() const
Definition docnode.h:779
bool refToSection() const
Definition docnode.h:785
bool hasLinkText() const
Definition docnode.h:783
Root node of documentation tree.
Definition docnode.h:1308
Node representing a reference to a section.
Definition docnode.h:930
bool refToTable() const
Definition docnode.h:938
QCString file() const
Definition docnode.h:934
QCString anchor() const
Definition docnode.h:935
QCString ref() const
Definition docnode.h:937
bool isSubPage() const
Definition docnode.h:939
Node representing a list of section references.
Definition docnode.h:954
Node representing a normal section.
Definition docnode.h:909
QCString file() const
Definition docnode.h:917
int level() const
Definition docnode.h:913
QCString anchor() const
Definition docnode.h:915
const DocNodeVariant * title() const
Definition docnode.h:914
Node representing a separator.
Definition docnode.h:361
QCString chars() const
Definition docnode.h:365
Node representing a simple list.
Definition docnode.h:985
Node representing a simple list item.
Definition docnode.h:1148
const DocNodeVariant * paragraph() const
Definition docnode.h:1152
Node representing a simple section.
Definition docnode.h:1012
Type type() const
Definition docnode.h:1021
const DocNodeVariant * title() const
Definition docnode.h:1028
Node representing a separator between two simple sections of the same type.
Definition docnode.h:1039
Node representing a style change.
Definition docnode.h:264
Style style() const
Definition docnode.h:303
bool enable() const
Definition docnode.h:305
Node representing a special symbol.
Definition docnode.h:324
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:328
Root node of a text fragment.
Definition docnode.h:1299
Node representing a simple section title.
Definition docnode.h:604
Node representing a URL (or email address)
Definition docnode.h:187
QCString url() const
Definition docnode.h:191
bool isEmail() const
Definition docnode.h:192
Node representing a verbatim, unparsed text fragment.
Definition docnode.h:372
QCString srcFile() const
Definition docnode.h:393
int srcLine() const
Definition docnode.h:394
QCString height() const
Definition docnode.h:388
bool hasCaption() const
Definition docnode.h:386
QCString language() const
Definition docnode.h:384
const DocNodeList & children() const
Definition docnode.h:391
bool isExample() const
Definition docnode.h:381
QCString context() const
Definition docnode.h:380
Type type() const
Definition docnode.h:378
QCString text() const
Definition docnode.h:379
QCString exampleFile() const
Definition docnode.h:382
QCString engine() const
Definition docnode.h:389
bool useBitmap() const
Definition docnode.h:390
@ JavaDocLiteral
Definition docnode.h:374
QCString width() const
Definition docnode.h:387
Node representing a VHDL flow chart.
Definition docnode.h:744
CodeParserInterface & getCodeParser(const QCString &langExt)
void pushHidden(bool hide)
bool popHidden()
Node representing some amount of white space.
Definition docnode.h:350
QCString chars() const
Definition docnode.h:354
Node representing a word.
Definition docnode.h:152
QCString word() const
Definition docnode.h:155
Node representing an item of a cross-referenced list.
Definition docnode.h:616
QCString anchor() const
Definition docnode.h:620
QCString file() const
Definition docnode.h:619
QCString title() const
Definition docnode.h:621
const char * name(int index) const
Access routine to the name of the Emoji entity.
Definition emoji.cpp:2026
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
std::string fileName() const
Definition fileinfo.cpp:118
std::string dirPath(bool absPath=true) const
Definition fileinfo.cpp:137
Class representing a list of HTML attributes.
Definition htmlattrib.h:33
const char * latex(SymType symb) const
Access routine to the LaTeX code of the HTML entity.
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
Generator for LaTeX code fragments.
Definition latexgen.h:28
QCString escapeMakeIndexChars(const char *s)
void writeDiaFile(const QCString &fileName, const DocVerbatim &s)
void setFirstRow(bool b)
RowSpanList & rowSpans()
void setCurrentColumn(size_t col)
static const int maxIndentLevels
void endLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)
bool firstRow() const
void endDotFile(bool hasCaption)
void operator()(const DocWord &)
void setInColSpan(bool b)
void visitCaption(const DocNodeList &children)
void addRowSpan(ActiveRowSpan &&span)
void setNumCols(size_t num)
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false)
OutputCodeList & m_ci
LatexDocVisitor(TextStream &t, OutputCodeList &ci, LatexCodeGenerator &lcg, const QCString &langExt, int hierarchyLevel=0)
size_t currentColumn() const
bool inRowSpan() const
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void filter(const QCString &str, const bool retainNewLine=false)
void endMscFile(bool hasCaption)
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void startPlantUmlFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
LatexListItemInfo m_listItemInfo[maxIndentLevels]
bool insideTable() const
void endDiaFile(bool hasCaption)
bool inColSpan() const
const char * getSectionName(int level) const
void writeMscFile(const QCString &fileName, const DocVerbatim &s)
void endPlantUmlFile(bool hasCaption)
void startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void setInRowSpan(bool b)
void visitChildren(const T &t)
LatexCodeGenerator & m_lcg
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
size_t numCols() const
Class representing a list of different code generators.
Definition outputlist.h:164
QCString writePlantUMLSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine, bool inlineCode)
Write a PlantUML compatible file.
Definition plantuml.cpp:28
static PlantumlManager & instance()
Definition plantuml.cpp:157
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:128
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString & prepend(const char *s)
Definition qcstring.h:407
int toInt(bool *ok=nullptr, int base=10) const
Definition qcstring.cpp:249
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
bool endsWith(const char *s) const
Definition qcstring.h:509
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
const std::string & str() const
Definition qcstring.h:537
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
@ ExplicitSize
Definition qcstring.h:133
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:91
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:159
QCString left(size_t len) const
Definition qcstring.h:214
constexpr int level() const
Definition section.h:45
Text streaming class that buffers data.
Definition textstream.h:36
Class representing a regular expression.
Definition regex.h:39
Object representing the matching results.
Definition regex.h:153
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26
static QCString makeBaseName(const QCString &name)
static QCString makeShortName(const QCString &baseName)
std::variant< DocWord, DocLinkedWord, DocURL, DocLineBreak, DocHorRuler, DocAnchor, DocCite, DocStyleChange, DocSymbol, DocEmoji, DocWhiteSpace, DocSeparator, DocVerbatim, DocInclude, DocIncOperator, DocFormula, DocIndexEntry, DocAutoList, DocAutoListItem, DocTitle, DocXRefItem, DocImage, DocDotFile, DocMscFile, DocDiaFile, DocVhdlFlow, DocLink, DocRef, DocInternalRef, DocHRef, DocHtmlHeader, DocHtmlDescTitle, DocHtmlDescList, DocSection, DocSecRefItem, DocSecRefList, DocInternal, DocParBlock, DocSimpleList, DocHtmlList, DocSimpleSect, DocSimpleSectSep, DocParamSect, DocPara, DocParamList, DocSimpleListItem, DocHtmlListItem, DocHtmlDescData, DocHtmlCell, DocHtmlCaption, DocHtmlRow, DocHtmlTable, DocHtmlBlockQuote, DocText, DocRoot, DocHtmlDetails, DocHtmlSummary, DocPlantUmlFile > DocNodeVariant
Definition docnode.h:66
constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
returns true iff v holds one of types passed as template parameters
Definition docnode.h:1361
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
Definition docnode.h:1325
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition dot.cpp:230
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:268
Translator * theTranslator
Definition language.cpp:71
static void writeStartTableCommand(TextStream &t, const DocNodeVariant *n, size_t cols)
static const char * g_subparagraphLabel
static const int g_maxLevels
static bool tableIsNested(const DocNodeVariant *n)
static QCString makeBaseName(const QCString &name)
static const std::array< const char *, g_maxLevels > g_secLabels
static bool listIsNested(const DocHtmlDescList &dl)
static void insertDimension(TextStream &t, QCString dimension, const char *orientationString)
static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage=FALSE)
static const char * g_paragraphLabel
static bool classEqualsReflist(const DocHtmlDescList &dl)
static QCString makeShortName(const QCString &name)
static void writeEndTableCommand(TextStream &t, const DocNodeVariant *n)
static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)
@ TEX
called through texorpdf as TeX (first) part
@ PDF
called through texorpdf as PDF (second) part
@ NO
not called through texorpdf
QCString latexFilterURL(const QCString &s)
void filterLatexString(TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces, const bool retainNewline)
QCString latexEscapeIndexChars(const QCString &s)
QCString latexEscapeLabelName(const QCString &s)
#define err(fmt,...)
Definition message.h:127
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:157
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:665
bool search(std::string_view str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
Definition regex.cpp:748
Portable versions of functions that are platform dependent.
const char * qPrint(const char *s)
Definition qcstring.h:672
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5721
QCString integerToRoman(int n, bool upper)
Definition util.cpp:7175
QCString stripPath(const QCString &s)
Definition util.cpp:5464
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
Definition util.cpp:6013
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5739
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Definition util.cpp:6336
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5763
A bunch of utility functions.