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 "mermaid.h"
40#include "fileinfo.h"
41#include "regex.h"
42#include "portable.h"
43#include "codefragment.h"
44#include "md5.h"
45
46static const int g_maxLevels = 7;
47static const std::array<const char *,g_maxLevels> g_secLabels =
48{ "doxysection",
49 "doxysubsection",
50 "doxysubsubsection",
51 "doxysubsubsubsection",
52 "doxysubsubsubsubsection",
53 "doxysubsubsubsubsubsection",
54 "doxysubsubsubsubsubsubsection"
55};
56
57static const char *g_paragraphLabel = "doxyparagraph";
58static const char *g_subparagraphLabel = "doxysubparagraph";
59
60const char *LatexDocVisitor::getSectionName(int level) const
61{
62 bool compactLatex = Config_getBool(COMPACT_LATEX);
63 int l = level;
64 if (compactLatex) l++;
65
66 if (l < g_maxLevels)
67 {
68 l += m_hierarchyLevel; /* May be -1 if generating main page */
69 // Sections get special treatment because they inherit the parent's level
70 if (l >= g_maxLevels)
71 {
72 l = g_maxLevels - 1;
73 }
74 else if (l < 0)
75 {
76 /* Should not happen; level is always >= 1 and hierarchyLevel >= -1 */
77 l = 0;
78 }
79 return g_secLabels[l];
80 }
81 else if (l == 7)
82 {
83 return g_paragraphLabel;
84 }
85 else
86 {
88 }
89}
90
91static void insertDimension(TextStream &t, QCString dimension, const char *orientationString)
92{
93 // dimensions for latex images can be a percentage, in this case they need some extra
94 // handling as the % symbol is used for comments
95 static const reg::Ex re(R"((\d+)%)");
96 std::string s = dimension.str();
97 reg::Match match;
98 if (reg::search(s,match,re))
99 {
100 bool ok = false;
101 double percent = QCString(match[1].str()).toInt(&ok);
102 if (ok)
103 {
104 t << percent/100.0 << "\\text" << orientationString;
105 return;
106 }
107 }
108 t << dimension;
109}
110
111static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage = FALSE)
112{
113 if (inlineImage)
114 {
115 t << "\n\\begin{DoxyInlineImage}%\n";
116 }
117 else
118 {
119 if (hasCaption)
120 {
121 t << "\n\\begin{DoxyImage}%\n";
122 }
123 else
124 {
125 t << "\n\\begin{DoxyImageNoCaption}%\n"
126 " \\doxymbox{";
127 }
128 }
129
130 t << "\\includegraphics";
131 if (!width.isEmpty() || !height.isEmpty())
132 {
133 t << "[";
134 }
135 if (!width.isEmpty())
136 {
137 t << "width=";
138 insertDimension(t, width, "width");
139 }
140 if (!width.isEmpty() && !height.isEmpty())
141 {
142 t << ",";
143 }
144 if (!height.isEmpty())
145 {
146 t << "height=";
147 insertDimension(t, height, "height");
148 }
149 if (width.isEmpty() && height.isEmpty())
150 {
151 /* default setting */
152 if (inlineImage)
153 {
154 t << "[height=\\baselineskip,keepaspectratio=true]";
155 }
156 else
157 {
158 t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]";
159 }
160 }
161 else
162 {
163 t << "]";
164 }
165
166 t << "{" << name << "}";
167
168 if (hasCaption)
169 {
170 if (!inlineImage)
171 {
172 if (Config_getBool(PDF_HYPERLINKS))
173 {
174 t << "%\n\\doxyfigcaption{";
175 }
176 else
177 {
178 t << "%\n\\doxyfigcaptionnolink{";
179 }
180 }
181 else
182 {
183 t << "%"; // to catch the caption
184 }
185 }
186}
187
188
189
190static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage = FALSE)
191{
192 if (inlineImage)
193 {
194 t << "%\n\\end{DoxyInlineImage}\n";
195 }
196 else
197 {
198 t << "}%\n"; // end doxymbox or caption
199 if (hasCaption)
200 {
201 t << "\\end{DoxyImage}\n";
202 }
203 else
204 {
205 t << "\\end{DoxyImageNoCaption}\n";
206 }
207 }
208}
209
211{
212 for (const auto &n : children)
213 {
214 std::visit(*this,n);
215 }
216}
217
219 const QCString &langExt, int hierarchyLevel)
220 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(FALSE),
222 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
223{
224}
225
226 //--------------------------------------
227 // visitor functions for leaf nodes
228 //--------------------------------------
229
231{
232 if (m_hide) return;
233 filter(w.word());
234}
235
237{
238 if (m_hide) return;
239 startLink(w.ref(),w.file(),w.anchor());
240 filter(w.word());
241 endLink(w.ref(),w.file(),w.anchor());
242}
243
245{
246 if (m_hide) return;
247 if (m_insidePre)
248 {
249 m_t << w.chars();
250 }
251 else
252 {
253 m_t << " ";
254 }
255}
256
258{
259 if (m_hide) return;
260 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
261 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
262 if (res)
263 {
265 {
266 if (pdfHyperlinks)
267 {
268 m_t << "\\texorpdfstring{$<$}{<}";
269 }
270 else
271 {
272 m_t << "$<$";
273 }
274 }
276 {
277 if (pdfHyperlinks)
278 {
279 m_t << "\\texorpdfstring{$>$}{>}";
280 }
281 else
282 {
283 m_t << "$>$";
284 }
285 }
286 else
287 {
288 m_t << res;
289 }
290 }
291 else
292 {
293 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
294 }
295}
296
298{
299 if (m_hide) return;
301 if (!emojiName.isEmpty())
302 {
303 QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
304 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
305 filter(emojiName);
306 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
307 }
308 else
309 {
310 m_t << s.name();
311 }
312}
313
315{
316 if (m_hide) return;
317 if (Config_getBool(PDF_HYPERLINKS))
318 {
319 m_t << "\\href{";
320 if (u.isEmail()) m_t << "mailto:";
321 m_t << latexFilterURL(u.url()) << "}";
322 }
323 m_t << "{\\texttt{";
324 filter(u.url());
325 m_t << "}}";
326}
327
329{
330 if (m_hide) return;
331 if (m_insideItem)
332 {
333 m_t << "\\\\\n";
334 }
335 else
336 {
337 m_t << "~\\newline\n";
338 }
339}
340
342{
343 if (m_hide) return;
344 if (insideTable())
345 m_t << "\\DoxyHorRuler{1}\n";
346 else
347 m_t << "\\DoxyHorRuler{0}\n";
348}
349
351{
352 if (m_hide) return;
353 switch (s.style())
354 {
356 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
357 break;
361 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
362 break;
365 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
366 break;
368 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
369 break;
373 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
374 break;
376 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
377 break;
379 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
380 break;
382 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
383 break;
385 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
386 break;
388 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
389 break;
391 if (s.enable())
392 {
393 m_t << "\n\\begin{DoxyPre}";
395 }
396 else
397 {
399 m_t << "\\end{DoxyPre}\n";
400 }
401 break;
402 case DocStyleChange::Div: /* HTML only */ break;
403 case DocStyleChange::Span: /* HTML only */ break;
404 }
405}
406
408{
409 if (m_hide) return;
410 QCString lang = m_langExt;
411 if (!s.language().isEmpty()) // explicit language setting
412 {
413 lang = s.language();
414 }
415 SrcLangExt langExt = getLanguageFromCodeLang(lang);
416 switch(s.type())
417 {
419 {
420 m_ci.startCodeFragment("DoxyCode");
421 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
422 Config_getBool(STRIP_CODE_COMMENTS),
423 CodeParserOptions().setExample(s.isExample(),s.exampleFile()));
424 m_ci.endCodeFragment("DoxyCode");
425 }
426 break;
428 filter(s.text(), true);
429 break;
431 m_t << "{\\ttfamily ";
432 filter(s.text(), true);
433 m_t << "}";
434 break;
436 if (isTableNested(s.parent())) // in table
437 {
438 m_t << "\\begin{DoxyCode}{0}";
439 filter(s.text(), true);
440 m_t << "\\end{DoxyCode}\n";
441 }
442 else
443 {
444 m_t << "\\begin{DoxyVerb}";
445 m_t << s.text();
446 m_t << "\\end{DoxyVerb}\n";
447 }
448 break;
454 /* nothing */
455 break;
457 m_t << s.text();
458 break;
459 case DocVerbatim::Dot:
460 {
461 bool exists = false;
462 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_", // baseName
463 ".dot", // extension
464 s.text(), // contents
465 exists);
466 if (!fileName.isEmpty())
467 {
468 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine(),!exists);
469 visitChildren(s);
471 }
472 }
473 break;
474 case DocVerbatim::Msc:
475 {
476 bool exists = false;
477 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_", // baseName
478 ".msc", // extension
479 "msc {"+s.text()+"}", // contents
480 exists);
481 if (!fileName.isEmpty())
482 {
483 writeMscFile(fileName, s, !exists);
484 }
485 }
486 break;
488 {
489 QCString latexOutput = Config_getString(LATEX_OUTPUT);
490 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
491 latexOutput,s.exampleFile(),s.text(),
493 s.engine(),s.srcFile(),s.srcLine(),true);
494
495 for (const auto &baseName: baseNameVector)
496 {
497 writePlantUMLFile(baseName, s);
498 }
499 }
500 break;
502 if (Config_getBool(MERMAID_RENDER_MODE)!=MERMAID_RENDER_MODE_t::CLIENT_SIDE)
503 {
504 auto latexOutput = Config_getString(LATEX_OUTPUT);
505 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
506 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
508 latexOutput,s.exampleFile(),s.text(),imageFormat,
509 s.srcFile(),s.srcLine());
510 writeMermaidFile(baseName, s);
511 }
512 break;
513 }
514}
515
517{
518 if (m_hide) return;
519 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
520 if (!anc.file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
521 {
522 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
523 << "}%\n";
524 }
525}
526
528{
529 if (m_hide) return;
531 switch(inc.type())
532 {
534 {
535 m_ci.startCodeFragment("DoxyCodeInclude");
536 FileInfo cfi( inc.file().str() );
537 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
539 inc.text(),
540 langExt,
541 inc.stripCodeComments(),
543 .setExample(inc.isExample(), inc.exampleFile())
544 .setFileDef(fd.get())
545 .setInlineFragment(true)
546 );
547 m_ci.endCodeFragment("DoxyCodeInclude");
548 }
549 break;
551 {
552 m_ci.startCodeFragment("DoxyCodeInclude");
554 inc.text(),langExt,
555 inc.stripCodeComments(),
557 .setExample(inc.isExample(), inc.exampleFile())
558 .setInlineFragment(true)
559 .setShowLineNumbers(false)
560 );
561 m_ci.endCodeFragment("DoxyCodeInclude");
562 }
563 break;
571 break;
573 m_t << inc.text();
574 break;
576 if (isTableNested(inc.parent())) // in table
577 {
578 m_t << "\\begin{DoxyCode}{0}";
579 filter(inc.text(), true);
580 m_t << "\\end{DoxyCode}\n";
581 }
582 else
583 {
584 m_t << "\n\\begin{DoxyVerbInclude}\n";
585 m_t << inc.text();
586 m_t << "\\end{DoxyVerbInclude}\n";
587 }
588 break;
591 {
592 m_ci.startCodeFragment("DoxyCodeInclude");
594 inc.file(),
595 inc.blockId(),
596 inc.context(),
598 inc.trimLeft(),
600 );
601 m_ci.endCodeFragment("DoxyCodeInclude");
602 }
603 break;
604 }
605}
606
608{
609 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
610 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
611 if (op.isFirst())
612 {
613 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
615 m_hide = TRUE;
616 }
618 if (locLangExt.isEmpty()) locLangExt = m_langExt;
619 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
620 if (op.type()!=DocIncOperator::Skip)
621 {
622 m_hide = popHidden();
623 if (!m_hide)
624 {
625 std::unique_ptr<FileDef> fd;
626 if (!op.includeFileName().isEmpty())
627 {
628 FileInfo cfi( op.includeFileName().str() );
629 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
630 }
631
632 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
635 .setExample(op.isExample(),op.exampleFile())
636 .setFileDef(fd.get())
637 .setStartLine(op.line())
639 );
640 }
642 m_hide=TRUE;
643 }
644 if (op.isLast())
645 {
647 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
648 }
649 else
650 {
651 if (!m_hide) m_t << "\n";
652 }
653}
654
656{
657 if (m_hide) return;
658 QCString s = f.text();
659 const char *p = s.data();
660 char c = 0;
661 if (p)
662 {
663 while ((c=*p++))
664 {
665 switch (c)
666 {
667 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
668 default: m_t << c; break;
669 }
670 }
671 }
672}
673
675{
676 if (m_hide) return;
678}
679
683
685{
686 if (m_hide) return;
687 auto opt = cite.option();
688 QCString txt;
689 if (opt.noCite())
690 {
691 if (!cite.file().isEmpty())
692 {
693 txt = cite.getText();
694 }
695 else
696 {
697 if (!opt.noPar()) txt += "[";
698 txt += cite.target();
699 if (!opt.noPar()) txt += "]";
700 }
701 m_t << "{\\bfseries ";
702 filter(txt);
703 m_t << "}";
704 }
705 else
706 {
707 if (!cite.file().isEmpty())
708 {
709 QCString anchor = cite.anchor();
711 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
712
713 txt = "\\DoxyCite{" + anchor + "}";
714 if (opt.isNumber())
715 {
716 txt += "{number}";
717 }
718 else if (opt.isShortAuthor())
719 {
720 txt += "{shortauthor}";
721 }
722 else if (opt.isYear())
723 {
724 txt += "{year}";
725 }
726 if (!opt.noPar()) txt += "{1}";
727 else txt += "{0}";
728
729 m_t << txt;
730 }
731 else
732 {
733 if (!opt.noPar()) txt += "[";
734 txt += cite.target();
735 if (!opt.noPar()) txt += "]";
736 m_t << "{\\bfseries ";
737 filter(txt);
738 m_t << "}";
739 }
740 }
741}
742
743//--------------------------------------
744// visitor functions for compound nodes
745//--------------------------------------
746
748{
749 if (m_hide) return;
750 if (m_indentLevel>=maxIndentLevels-1) return;
751 if (l.isEnumList())
752 {
753 m_t << "\n\\begin{DoxyEnumerate}";
754 m_listItemInfo[indentLevel()].isEnum = true;
755 }
756 else
757 {
758 m_listItemInfo[indentLevel()].isEnum = false;
759 m_t << "\n\\begin{DoxyItemize}";
760 }
761 visitChildren(l);
762 if (l.isEnumList())
763 {
764 m_t << "\n\\end{DoxyEnumerate}";
765 }
766 else
767 {
768 m_t << "\n\\end{DoxyItemize}";
769 }
770}
771
773{
774 if (m_hide) return;
775 switch (li.itemNumber())
776 {
777 case DocAutoList::Unchecked: // unchecked
778 m_t << "\n\\item[\\DoxyUnchecked] ";
779 break;
780 case DocAutoList::Checked_x: // checked with x
781 case DocAutoList::Checked_X: // checked with X
782 m_t << "\n\\item[\\DoxyChecked] ";
783 break;
784 default:
785 m_t << "\n\\item ";
786 break;
787 }
789 visitChildren(li);
791}
792
794{
795 if (m_hide) return;
796 visitChildren(p);
797 if (!p.isLast() && // omit <p> for last paragraph
798 !(p.parent() && // and for parameter sections
799 std::get_if<DocParamSect>(p.parent())
800 )
801 )
802 {
803 if (insideTable())
804 {
805 m_t << "~\\newline\n";
806 }
807 else
808 {
809 m_t << "\n\n";
810 }
811 }
812}
813
815{
816 visitChildren(r);
817}
818
820{
821 if (m_hide) return;
822 switch(s.type())
823 {
825 m_t << "\\begin{DoxySeeAlso}{";
826 filter(theTranslator->trSeeAlso());
827 break;
829 m_t << "\\begin{DoxyReturn}{";
830 filter(theTranslator->trReturns());
831 break;
833 m_t << "\\begin{DoxyAuthor}{";
834 filter(theTranslator->trAuthor(TRUE,TRUE));
835 break;
837 m_t << "\\begin{DoxyAuthor}{";
838 filter(theTranslator->trAuthor(TRUE,FALSE));
839 break;
841 m_t << "\\begin{DoxyVersion}{";
842 filter(theTranslator->trVersion());
843 break;
845 m_t << "\\begin{DoxySince}{";
846 filter(theTranslator->trSince());
847 break;
849 m_t << "\\begin{DoxyDate}{";
850 filter(theTranslator->trDate());
851 break;
853 m_t << "\\begin{DoxyNote}{";
854 filter(theTranslator->trNote());
855 break;
857 m_t << "\\begin{DoxyWarning}{";
858 filter(theTranslator->trWarning());
859 break;
861 m_t << "\\begin{DoxyPrecond}{";
862 filter(theTranslator->trPrecondition());
863 break;
865 m_t << "\\begin{DoxyPostcond}{";
866 filter(theTranslator->trPostcondition());
867 break;
869 m_t << "\\begin{DoxyCopyright}{";
870 filter(theTranslator->trCopyright());
871 break;
873 m_t << "\\begin{DoxyInvariant}{";
874 filter(theTranslator->trInvariant());
875 break;
877 m_t << "\\begin{DoxyRemark}{";
878 filter(theTranslator->trRemarks());
879 break;
881 m_t << "\\begin{DoxyAttention}{";
882 filter(theTranslator->trAttention());
883 break;
885 m_t << "\\begin{DoxyImportant}{";
886 filter(theTranslator->trImportant());
887 break;
889 m_t << "\\begin{DoxyParagraph}{";
890 break;
892 m_t << "\\begin{DoxyParagraph}{";
893 break;
894 case DocSimpleSect::Unknown: break;
895 }
896
897 if (s.title())
898 {
900 std::visit(*this,*s.title());
902 }
903 m_t << "}\n";
905 visitChildren(s);
906 switch(s.type())
907 {
909 m_t << "\n\\end{DoxySeeAlso}\n";
910 break;
912 m_t << "\n\\end{DoxyReturn}\n";
913 break;
915 m_t << "\n\\end{DoxyAuthor}\n";
916 break;
918 m_t << "\n\\end{DoxyAuthor}\n";
919 break;
921 m_t << "\n\\end{DoxyVersion}\n";
922 break;
924 m_t << "\n\\end{DoxySince}\n";
925 break;
927 m_t << "\n\\end{DoxyDate}\n";
928 break;
930 m_t << "\n\\end{DoxyNote}\n";
931 break;
933 m_t << "\n\\end{DoxyWarning}\n";
934 break;
936 m_t << "\n\\end{DoxyPrecond}\n";
937 break;
939 m_t << "\n\\end{DoxyPostcond}\n";
940 break;
942 m_t << "\n\\end{DoxyCopyright}\n";
943 break;
945 m_t << "\n\\end{DoxyInvariant}\n";
946 break;
948 m_t << "\n\\end{DoxyRemark}\n";
949 break;
951 m_t << "\n\\end{DoxyAttention}\n";
952 break;
954 m_t << "\n\\end{DoxyImportant}\n";
955 break;
957 m_t << "\n\\end{DoxyParagraph}\n";
958 break;
960 m_t << "\n\\end{DoxyParagraph}\n";
961 break;
962 default:
963 break;
964 }
966}
967
969{
970 if (m_hide) return;
971 visitChildren(t);
972}
973
975{
976 if (m_hide) return;
977 m_t << "\\begin{DoxyItemize}\n";
978 m_listItemInfo[indentLevel()].isEnum = false;
979 visitChildren(l);
980 m_t << "\\end{DoxyItemize}\n";
981}
982
984{
985 if (m_hide) return;
986 m_t << "\\item ";
988 if (li.paragraph())
989 {
990 visit(*this,*li.paragraph());
991 }
993}
994
996{
997 if (m_hide) return;
998 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
999 if (pdfHyperlinks)
1000 {
1001 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1002 }
1003 m_t << "\\" << getSectionName(s.level()) << "{";
1004 if (pdfHyperlinks)
1005 {
1006 m_t << "\\texorpdfstring{";
1007 }
1008 if (s.title())
1009 {
1010 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1011 std::visit(*this,*s.title());
1013 }
1014 if (pdfHyperlinks)
1015 {
1016 m_t << "}{";
1017 if (s.title())
1018 {
1019 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1020 std::visit(*this,*s.title());
1022 }
1023 m_t << "}";
1024 }
1025 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1026 visitChildren(s);
1027}
1028
1030{
1031 if (m_hide) return;
1032 if (m_indentLevel>=maxIndentLevels-1) return;
1034 if (s.type()==DocHtmlList::Ordered)
1035 {
1036 bool first = true;
1037 m_t << "\n\\begin{DoxyEnumerate}";
1038 for (const auto &opt : s.attribs())
1039 {
1040 if (opt.name=="type")
1041 {
1042 if (opt.value=="1")
1043 {
1044 m_t << (first ? "[": ",");
1045 m_t << "label=\\arabic*";
1046 first = false;
1047 }
1048 else if (opt.value=="a")
1049 {
1050 m_t << (first ? "[": ",");
1051 m_t << "label=\\enumalphalphcnt*";
1052 first = false;
1053 }
1054 else if (opt.value=="A")
1055 {
1056 m_t << (first ? "[": ",");
1057 m_t << "label=\\enumAlphAlphcnt*";
1058 first = false;
1059 }
1060 else if (opt.value=="i")
1061 {
1062 m_t << (first ? "[": ",");
1063 m_t << "label=\\roman*";
1064 first = false;
1065 }
1066 else if (opt.value=="I")
1067 {
1068 m_t << (first ? "[": ",");
1069 m_t << "label=\\Roman*";
1070 first = false;
1071 }
1072 }
1073 else if (opt.name=="start")
1074 {
1075 m_t << (first ? "[": ",");
1076 bool ok = false;
1077 int val = opt.value.toInt(&ok);
1078 if (ok) m_t << "start=" << val;
1079 first = false;
1080 }
1081 }
1082 if (!first) m_t << "]\n";
1083 }
1084 else
1085 {
1086 m_t << "\n\\begin{DoxyItemize}";
1087 }
1088 visitChildren(s);
1089 if (m_indentLevel>=maxIndentLevels-1) return;
1090 if (s.type()==DocHtmlList::Ordered)
1091 m_t << "\n\\end{DoxyEnumerate}";
1092 else
1093 m_t << "\n\\end{DoxyItemize}";
1094}
1095
1097{
1098 if (m_hide) return;
1099 if (m_listItemInfo[indentLevel()].isEnum)
1100 {
1101 for (const auto &opt : l.attribs())
1102 {
1103 if (opt.name=="value")
1104 {
1105 bool ok = false;
1106 int val = opt.value.toInt(&ok);
1107 if (ok)
1108 {
1109 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1110 }
1111 }
1112 }
1113 }
1114 m_t << "\n\\item ";
1116 visitChildren(l);
1118}
1119
1120
1122{
1123 HtmlAttribList attrs = dl.attribs();
1124 auto it = std::find_if(attrs.begin(),attrs.end(),
1125 [](const auto &att) { return att.name=="class"; });
1126 if (it!=attrs.end() && it->value == "reflist") return true;
1127 return false;
1128}
1129
1130static bool listIsNested(const DocHtmlDescList &dl)
1131{
1132 bool isNested=false;
1133 const DocNodeVariant *n = dl.parent();
1134 while (n && !isNested)
1135 {
1136 if (std::get_if<DocHtmlDescList>(n))
1137 {
1138 isNested = !classEqualsReflist(std::get<DocHtmlDescList>(*n));
1139 }
1140 n = ::parent(n);
1141 }
1142 return isNested;
1143}
1144
1146{
1147 if (m_hide) return;
1148 bool eq = classEqualsReflist(dl);
1149 if (eq)
1150 {
1151 m_t << "\n\\begin{DoxyRefList}";
1152 }
1153 else
1154 {
1155 if (listIsNested(dl)) m_t << "\n\\hfill";
1156 m_t << "\n\\begin{DoxyDescription}";
1157 }
1158 visitChildren(dl);
1159 if (eq)
1160 {
1161 m_t << "\n\\end{DoxyRefList}";
1162 }
1163 else
1164 {
1165 m_t << "\n\\end{DoxyDescription}";
1166 }
1167}
1168
1170{
1171 if (m_hide) return;
1172 m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
1174 visitChildren(dt);
1176 m_t << "}}]";
1177}
1178
1180{
1182 if (!m_insideItem) m_t << "\\hfill";
1183 m_t << " \\\\\n";
1184 visitChildren(dd);
1186}
1187
1189{
1190 bool isNested=m_lcg.usedTableLevel()>0;
1191 while (n && !isNested)
1192 {
1194 n = ::parent(n);
1195 }
1196 return isNested;
1197}
1198
1200{
1201 if (isTableNested(n))
1202 {
1203 m_t << "\\begin{DoxyTableNested}{" << cols << "}";
1204 }
1205 else
1206 {
1207 m_t << "\n\\begin{DoxyTable}{" << cols << "}";
1208 }
1209}
1210
1212{
1213 if (isTableNested(n))
1214 {
1215 m_t << "\\end{DoxyTableNested}\n";
1216 }
1217 else
1218 {
1219 m_t << "\\end{DoxyTable}\n";
1220 }
1221}
1222
1224{
1225 if (m_hide) return;
1227 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1228 if (c)
1229 {
1230 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1231 if (!c->file().isEmpty() && pdfHyperLinks)
1232 {
1233 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1234 << "}{}";
1235 }
1236 m_t << "\n";
1237 }
1238
1240 if (!isTableNested(t.parent()))
1241 {
1242 // write caption
1243 m_t << "{";
1244 if (c)
1245 {
1246 std::visit(*this, *t.caption());
1247 }
1248 m_t << "}";
1249 // write label
1250 m_t << "{";
1251 if (c && (!stripPath(c->file()).isEmpty() || !c->anchor().isEmpty()))
1252 {
1253 m_t << stripPath(c->file()) << "_" << c->anchor();
1254 }
1255 m_t << "}";
1256 }
1257
1258 // write head row(s)
1259 m_t << "{" << t.numberHeaderRows() << "}\n";
1260
1262
1263 visitChildren(t);
1265 popTableState();
1266}
1267
1269{
1270 if (m_hide) return;
1271 visitChildren(c);
1272}
1273
1275{
1276 if (m_hide) return;
1278
1279 visitChildren(row);
1280
1281 m_t << "\\\\";
1282
1283 size_t col = 1;
1284 for (auto &span : rowSpans())
1285 {
1286 if (span.rowSpan>0) span.rowSpan--;
1287 if (span.rowSpan<=0)
1288 {
1289 // inactive span
1290 }
1291 else if (span.column>col)
1292 {
1293 col = span.column+span.colSpan;
1294 }
1295 else
1296 {
1297 col = span.column+span.colSpan;
1298 }
1299 }
1300
1301 m_t << "\n";
1302}
1303
1305{
1306 if (m_hide) return;
1307 //printf("Cell(r=%u,c=%u) rowSpan=%d colSpan=%d currentColumn()=%zu\n",c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),currentColumn());
1308
1310
1311 QCString cellOpts;
1312 QCString cellSpec;
1313 auto appendOpt = [&cellOpts](const QCString &s)
1314 {
1315 if (!cellOpts.isEmpty()) cellOpts+=",";
1316 cellOpts+=s;
1317 };
1318 auto appendSpec = [&cellSpec](const QCString &s)
1319 {
1320 if (!cellSpec.isEmpty()) cellSpec+=",";
1321 cellSpec+=s;
1322 };
1323 auto writeCell = [this,&cellOpts,&cellSpec]()
1324 {
1325 if (!cellOpts.isEmpty() || !cellSpec.isEmpty())
1326 {
1327 m_t << "\\SetCell";
1328 if (!cellOpts.isEmpty())
1329 {
1330 m_t << "[" << cellOpts << "]";
1331 }
1332 m_t << "{" << cellSpec << "}";
1333 }
1334 };
1335
1336 // skip over columns that have a row span starting at an earlier row
1337 for (const auto &span : rowSpans())
1338 {
1339 //printf("span(r=%u,c=%u): column=%zu colSpan=%zu,rowSpan=%zu currentColumn()=%zu\n",
1340 // span.cell.rowIndex(),span.cell.columnIndex(),
1341 // span.column,span.colSpan,span.rowSpan,
1342 // currentColumn());
1343 if (span.rowSpan>0 && span.column==currentColumn())
1344 {
1345 setCurrentColumn(currentColumn()+span.colSpan);
1346 for (size_t i=0;i<span.colSpan;i++)
1347 {
1348 m_t << "&";
1349 }
1350 }
1351 }
1352
1353 int cs = c.colSpan();
1354 int ha = c.alignment();
1355 int rs = c.rowSpan();
1356 int va = c.valignment();
1357
1358 switch (ha) // horizontal alignment
1359 {
1360 case DocHtmlCell::Right:
1361 appendSpec("r");
1362 break;
1364 appendSpec("c");
1365 break;
1366 default:
1367 // default
1368 break;
1369 }
1370 if (rs>0) // row span
1371 {
1372 appendOpt("r="+QCString().setNum(rs));
1373 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%zu\n",
1374 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1375 // currentColumn());
1377 }
1378 if (cs>1) // column span
1379 {
1380 // update column to the end of the span, needs to be done *after* calling addRowSpan()
1382 appendOpt("c="+QCString().setNum(cs));
1383 }
1384 if (c.isHeading())
1385 {
1386 appendSpec("bg=\\tableheadbgcolor");
1387 appendSpec("font=\\bfseries");
1388 }
1389 switch(va) // vertical alignment
1390 {
1391 case DocHtmlCell::Top:
1392 appendSpec("h");
1393 break;
1395 appendSpec("f");
1396 break;
1398 // default
1399 break;
1400 }
1401 writeCell();
1402
1403 visitChildren(c);
1404
1405 for (int i=0;i<cs-1;i++)
1406 {
1407 m_t << "&"; // placeholder for invisible cell
1408 }
1409
1410 if (!c.isLast()) m_t << "&";
1411}
1412
1414{
1415 if (m_hide) return;
1416 visitChildren(i);
1417}
1418
1420{
1421 if (m_hide) return;
1422 if (Config_getBool(PDF_HYPERLINKS))
1423 {
1424 m_t << "\\href{";
1425 m_t << latexFilterURL(href.url());
1426 m_t << "}";
1427 }
1428 m_t << "{\\texttt{";
1429 visitChildren(href);
1430 m_t << "}}";
1431}
1432
1434{
1435 if (m_hide) return;
1436 m_t << "{\\bfseries{";
1437 visitChildren(d);
1438 m_t << "}}";
1439}
1440
1442{
1443 if (m_hide) return;
1444 m_t << "\n\n";
1445 auto summary = d.summary();
1446 if (summary)
1447 {
1448 std::visit(*this,*summary);
1449 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1450 }
1451 visitChildren(d);
1452 if (summary)
1453 {
1454 m_t << "\\end{adjustwidth}\n";
1455 }
1456 else
1457 {
1458 m_t << "\n\n";
1459 }
1460}
1461
1463{
1464 if (m_hide) return;
1465 m_t << "\\" << getSectionName(header.level()) << "*{";
1466 visitChildren(header);
1467 m_t << "}";
1468}
1469
1471{
1472 if (img.type()==DocImage::Latex)
1473 {
1474 if (m_hide) return;
1475 QCString gfxName = img.name();
1476 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1477 {
1478 gfxName=gfxName.left(gfxName.length()-4);
1479 }
1480
1481 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1482 visitChildren(img);
1484 }
1485 else // other format -> skip
1486 {
1487 }
1488}
1489
1491{
1492 if (m_hide) return;
1493 bool exists = false;
1494 std::string inBuf;
1495 if (readInputFile(df.file(),inBuf))
1496 {
1497 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1498 ".dot", // extension
1499 inBuf, // contents
1500 exists);
1501 if (!fileName.isEmpty())
1502 {
1503 startDotFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1504 visitChildren(df);
1505 endDotFile(df.hasCaption());
1506 }
1507 }
1508}
1509
1511{
1512 if (m_hide) return;
1513 bool exists = false;
1514 std::string inBuf;
1515 if (readInputFile(df.file(),inBuf))
1516 {
1517 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1518 ".msc", // extension
1519 inBuf, // contents
1520 exists);
1521 if (!fileName.isEmpty())
1522 {
1523 startMscFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1524 visitChildren(df);
1525 endMscFile(df.hasCaption());
1526 }
1527 }
1528}
1529
1531{
1532 if (m_hide) return;
1533 bool exists = false;
1534 std::string inBuf;
1535 if (readInputFile(df.file(),inBuf))
1536 {
1537 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1538 ".dia", // extension
1539 inBuf, // contents
1540 exists);
1541 if (!fileName.isEmpty())
1542 {
1543 startDiaFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1544 visitChildren(df);
1545 endDiaFile(df.hasCaption());
1546 }
1547 }
1548}
1549
1551{
1552 if (m_hide) return;
1553 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1554 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1555 visitChildren(df);
1557}
1558
1560{
1561 if (m_hide) return;
1562 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
1563 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1564 startMermaidFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1565 visitChildren(df);
1567}
1568
1570{
1571 if (m_hide) return;
1572 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1573 visitChildren(lnk);
1574 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1575}
1576
1578{
1579 if (m_hide) return;
1580 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1581 // ref.anchor() for LaTeX/RTF
1582 if (ref.isSubPage())
1583 {
1584 startLink(ref.ref(),QCString(),ref.anchor());
1585 }
1586 else
1587 {
1588 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1589 }
1590 if (!ref.hasLinkText())
1591 {
1592 filter(ref.targetTitle());
1593 }
1594 visitChildren(ref);
1595 if (ref.isSubPage())
1596 {
1597 endLink(ref.ref(),QCString(),ref.anchor());
1598 }
1599 else
1600 {
1601 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1602 }
1603}
1604
1606{
1607 if (m_hide) return;
1608 m_t << "\\item \\contentsline{section}{";
1609 if (ref.isSubPage())
1610 {
1611 startLink(ref.ref(),QCString(),ref.anchor());
1612 }
1613 else
1614 {
1615 if (!ref.file().isEmpty())
1616 {
1617 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1618 }
1619 }
1620 visitChildren(ref);
1621 if (ref.isSubPage())
1622 {
1623 endLink(ref.ref(),QCString(),ref.anchor());
1624 }
1625 else
1626 {
1627 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1628 }
1629 m_t << "}{\\ref{";
1630 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1631 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1632 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1633 m_t << "}}{}\n";
1634}
1635
1637{
1638 if (m_hide) return;
1639 m_t << "\\footnotesize\n";
1640 m_t << "\\begin{multicols}{2}\n";
1641 m_t << "\\begin{DoxyCompactList}\n";
1643 visitChildren(l);
1645 m_t << "\\end{DoxyCompactList}\n";
1646 m_t << "\\end{multicols}\n";
1647 m_t << "\\normalsize\n";
1648}
1649
1651{
1652 if (m_hide) return;
1653 bool hasInOutSpecs = s.hasInOutSpecifier();
1654 bool hasTypeSpecs = s.hasTypeSpecifier();
1655 m_lcg.incUsedTableLevel();
1656 switch(s.type())
1657 {
1659 m_t << "\n\\begin{DoxyParams}";
1660 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1661 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1662 m_t << "{";
1663 filter(theTranslator->trParameters());
1664 break;
1666 m_t << "\n\\begin{DoxyRetVals}{";
1667 filter(theTranslator->trReturnValues());
1668 break;
1670 m_t << "\n\\begin{DoxyExceptions}{";
1671 filter(theTranslator->trExceptions());
1672 break;
1674 m_t << "\n\\begin{DoxyTemplParams}{";
1675 filter(theTranslator->trTemplateParameters());
1676 break;
1677 default:
1678 ASSERT(0);
1680 }
1681 m_t << "}\n";
1682 visitChildren(s);
1683 m_lcg.decUsedTableLevel();
1684 switch(s.type())
1685 {
1687 m_t << "\\end{DoxyParams}\n";
1688 break;
1690 m_t << "\\end{DoxyRetVals}\n";
1691 break;
1693 m_t << "\\end{DoxyExceptions}\n";
1694 break;
1696 m_t << "\\end{DoxyTemplParams}\n";
1697 break;
1698 default:
1699 ASSERT(0);
1701 }
1702}
1703
1705{
1706 m_t << " " << sep.chars() << " ";
1707}
1708
1710{
1711 if (m_hide) return;
1713 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1714 if (sect)
1715 {
1716 parentType = sect->type();
1717 }
1718 bool useTable = parentType==DocParamSect::Param ||
1719 parentType==DocParamSect::RetVal ||
1720 parentType==DocParamSect::Exception ||
1721 parentType==DocParamSect::TemplateParam;
1722 if (!useTable)
1723 {
1724 m_t << "\\item[";
1725 }
1726 if (sect && sect->hasInOutSpecifier())
1727 {
1729 {
1730 m_t << "\\doxymbox{\\texttt{";
1731 if (pl.direction()==DocParamSect::In)
1732 {
1733 m_t << "in";
1734 }
1735 else if (pl.direction()==DocParamSect::Out)
1736 {
1737 m_t << "out";
1738 }
1739 else if (pl.direction()==DocParamSect::InOut)
1740 {
1741 m_t << "in,out";
1742 }
1743 m_t << "}} ";
1744 }
1745 if (useTable) m_t << " & ";
1746 }
1747 if (sect && sect->hasTypeSpecifier())
1748 {
1749 for (const auto &type : pl.paramTypes())
1750 {
1751 std::visit(*this,type);
1752 }
1753 if (useTable) m_t << " & ";
1754 }
1755 m_t << "{\\em ";
1756 bool first=TRUE;
1757 for (const auto &param : pl.parameters())
1758 {
1759 if (!first) m_t << ","; else first=FALSE;
1761 std::visit(*this,param);
1763 }
1764 m_t << "}";
1765 if (useTable)
1766 {
1767 m_t << " & ";
1768 }
1769 else
1770 {
1771 m_t << "]";
1772 }
1773 for (const auto &par : pl.paragraphs())
1774 {
1775 std::visit(*this,par);
1776 }
1777 if (useTable)
1778 {
1779 m_t << "\\\\\n"
1780 << "\\hline\n";
1781 }
1782}
1783
1785{
1786 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1787 if (m_hide) return;
1788 if (x.title().isEmpty()) return;
1790 m_t << "\\begin{DoxyRefDesc}{";
1791 filter(x.title());
1792 m_t << "}\n";
1793 bool anonymousEnum = x.file()=="@";
1794 m_t << "\\item[";
1795 if (pdfHyperlinks && !anonymousEnum)
1796 {
1797 m_t << "\\doxymbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1798 }
1799 else
1800 {
1801 m_t << "\\textbf{ ";
1802 }
1804 filter(x.title());
1806 if (pdfHyperlinks && !anonymousEnum)
1807 {
1808 m_t << "}";
1809 }
1810 m_t << "}]";
1811 visitChildren(x);
1812 if (x.title().isEmpty()) return;
1814 m_t << "\\end{DoxyRefDesc}\n";
1815}
1816
1818{
1819 if (m_hide) return;
1820 startLink(QCString(),ref.file(),ref.anchor());
1821 visitChildren(ref);
1822 endLink(QCString(),ref.file(),ref.anchor());
1823}
1824
1826{
1827 if (m_hide) return;
1828 visitChildren(t);
1829}
1830
1832{
1833 if (m_hide) return;
1834 m_t << "\\begin{quote}\n";
1836 visitChildren(q);
1837 m_t << "\\end{quote}\n";
1839}
1840
1844
1846{
1847 if (m_hide) return;
1848 visitChildren(pb);
1849}
1850
1851void LatexDocVisitor::filter(const QCString &str, const bool retainNewLine)
1852{
1853 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1855 m_lcg.insideTabbing(),
1858 m_lcg.usedTableLevel()>0, // insideTable
1859 false, // keepSpaces
1860 retainNewLine
1861 );
1862}
1863
1864void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,
1865 bool refToTable,bool refToSection)
1866{
1867 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1868 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1869 {
1870 if (refToTable)
1871 {
1872 m_t << "\\doxytablelink{";
1873 }
1874 else if (refToSection)
1875 {
1876 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1877 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1878 }
1879 else
1880 {
1881 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1882 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1883 }
1884 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1885 {
1886 if (!file.isEmpty()) m_t << stripPath(file);
1887 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1888 if (!anchor.isEmpty()) m_t << anchor;
1889 m_t << "}";
1890 }
1891 m_t << "{";
1892 }
1893 else if (ref.isEmpty() && refToSection)
1894 {
1895 m_t << "\\doxysectref{";
1896 }
1897 else if (ref.isEmpty() && refToTable)
1898 {
1899 m_t << "\\doxytableref{";
1900 }
1901 else if (ref.isEmpty()) // internal non-PDF link
1902 {
1903 m_t << "\\doxyref{";
1904 }
1905 else // external link
1906 {
1907 m_t << "\\textbf{ ";
1908 }
1909}
1910
1911void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool /*refToTable*/,bool refToSection, SectionType sectionType)
1912{
1913 m_t << "}";
1914 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1915 if (ref.isEmpty() && !pdfHyperLinks)
1916 {
1917 m_t << "{";
1918 filter(theTranslator->trPageAbbreviation());
1919 m_t << "}{" << file;
1920 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1921 m_t << anchor << "}";
1922 if (refToSection)
1923 {
1924 m_t << "{" << sectionType.level() << "}";
1925 }
1926 }
1927 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1928 {
1929 if (refToSection)
1930 {
1931 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1932 }
1933 }
1934}
1935
1937 const QCString &width,
1938 const QCString &height,
1939 bool hasCaption,
1940 const QCString &srcFile,
1941 int srcLine, bool newFile
1942 )
1943{
1944 QCString baseName=makeBaseName(fileName,".dot");
1945 baseName.prepend("dot_");
1946 QCString outDir = Config_getString(LATEX_OUTPUT);
1947 if (newFile) writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine,false);
1948 visitPreStart(m_t,hasCaption, baseName, width, height);
1949}
1950
1951void LatexDocVisitor::endDotFile(bool hasCaption)
1952{
1953 if (m_hide) return;
1954 visitPostEnd(m_t,hasCaption);
1955}
1956
1958 const QCString &width,
1959 const QCString &height,
1960 bool hasCaption,
1961 const QCString &srcFile,
1962 int srcLine, bool newFile
1963 )
1964{
1965 QCString baseName=makeBaseName(fileName,".msc");
1966 baseName.prepend("msc_");
1967
1968 QCString outDir = Config_getString(LATEX_OUTPUT);
1969 if (newFile) writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine,false);
1970 visitPreStart(m_t,hasCaption, baseName, width, height);
1971}
1972
1973void LatexDocVisitor::endMscFile(bool hasCaption)
1974{
1975 if (m_hide) return;
1976 visitPostEnd(m_t,hasCaption);
1977}
1978
1979
1980void LatexDocVisitor::writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile)
1981{
1982 QCString shortName=makeBaseName(fileName,".msc");
1983 QCString outDir = Config_getString(LATEX_OUTPUT);
1984 if (newFile) writeMscGraphFromFile(fileName,outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine(),false);
1985 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
1988}
1989
1991 const QCString &width,
1992 const QCString &height,
1993 bool hasCaption,
1994 const QCString &srcFile,
1995 int srcLine, bool newFile
1996 )
1997{
1998 QCString baseName=makeBaseName(fileName,".dia");
1999 baseName.prepend("dia_");
2000
2001 QCString outDir = Config_getString(LATEX_OUTPUT);
2002 if (newFile) writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine,false);
2003 visitPreStart(m_t,hasCaption, baseName, width, height);
2004}
2005
2006void LatexDocVisitor::endDiaFile(bool hasCaption)
2007{
2008 if (m_hide) return;
2009 visitPostEnd(m_t,hasCaption);
2010}
2011
2013{
2014 QCString shortName = stripPath(baseName);
2015 if (s.useBitmap())
2016 {
2017 if (shortName.find('.')==-1) shortName += ".png";
2018 }
2019 QCString outDir = Config_getString(LATEX_OUTPUT);
2022 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2025}
2026
2028 const QCString &width,
2029 const QCString &height,
2030 bool hasCaption,
2031 const QCString &srcFile,
2032 int srcLine
2033 )
2034{
2035 QCString outDir = Config_getString(LATEX_OUTPUT);
2036 std::string inBuf;
2037 readInputFile(fileName,inBuf);
2038
2039 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2040 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
2041 outDir,QCString(),inBuf,
2043 QCString(),srcFile,srcLine,false);
2044 bool first = true;
2045 for (const auto &bName: baseNameVector)
2046 {
2047 QCString baseName = makeBaseName(bName,".pu");
2048 QCString shortName = stripPath(baseName);
2049 if (useBitmap)
2050 {
2051 if (shortName.find('.')==-1) shortName += ".png";
2052 }
2055 if (!first) endPlantUmlFile(hasCaption);
2056 first = false;
2057 visitPreStart(m_t,hasCaption, shortName, width, height);
2058 }
2059}
2060
2062{
2063 if (m_hide) return;
2064 visitPostEnd(m_t,hasCaption);
2065}
2066
2068{
2069 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2070 auto shortName = stripPath(baseName);
2071 auto outDir = Config_getString(LATEX_OUTPUT);
2072 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
2073 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
2074 auto imgExt = MermaidManager::imageExtension(imageFormat);
2075 if (shortName.find('.')==-1) shortName += "." + imgExt;
2076 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
2077 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2080}
2081
2083 const QCString &width,
2084 const QCString &height,
2085 bool hasCaption,
2086 const QCString &srcFile,
2087 int srcLine
2088 )
2089{
2090 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2091 QCString outDir = Config_getString(LATEX_OUTPUT);
2092 std::string inBuf;
2093 readInputFile(fileName,inBuf);
2094 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
2095 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
2096 auto imgExt = MermaidManager::imageExtension(imageFormat);
2098 outDir,QCString(),inBuf,imageFormat,
2099 srcFile,srcLine);
2100 auto shortName = stripPath(baseName);
2101 if (shortName.find('.')==-1) shortName += "." + imgExt;
2102 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
2103 visitPreStart(m_t,hasCaption, shortName, width, height);
2104}
2105
2107{
2108 if (m_hide) return;
2109 visitPostEnd(m_t,hasCaption);
2110}
2111
2113{
2114 return std::min(m_indentLevel,maxIndentLevels-1);
2115}
2116
2118{
2119 m_indentLevel++;
2121 {
2122 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2123 }
2124}
2125
2127{
2128 if (m_indentLevel>0)
2129 {
2130 m_indentLevel--;
2131 }
2132}
2133
QCString anchorPrefix() const
Definition cite.cpp:126
static CitationManager & instance()
Definition cite.cpp:85
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, const CodeParserOptions &options)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
Node representing an anchor.
Definition docnode.h:229
QCString anchor() const
Definition docnode.h:232
QCString file() const
Definition docnode.h:233
Node representing an auto List.
Definition docnode.h:571
bool isEnumList() const
Definition docnode.h:580
Node representing an item of a auto list.
Definition docnode.h:595
int itemNumber() const
Definition docnode.h:598
Node representing a citation of some bibliographic reference.
Definition docnode.h:245
QCString getText() const
Definition docnode.cpp:974
CiteInfoOption option() const
Definition docnode.h:253
QCString target() const
Definition docnode.h:252
QCString anchor() const
Definition docnode.h:251
QCString file() const
Definition docnode.h:248
Node representing a dia file.
Definition docnode.h:731
QCString height() const
Definition docnode.h:689
QCString srcFile() const
Definition docnode.h:691
QCString file() const
Definition docnode.h:685
int srcLine() const
Definition docnode.h:692
bool hasCaption() const
Definition docnode.h:687
QCString width() const
Definition docnode.h:688
Node representing a dot file.
Definition docnode.h:713
Node representing an emoji.
Definition docnode.h:341
int index() const
Definition docnode.h:345
QCString name() const
Definition docnode.h:344
Node representing an item of a cross-referenced list.
Definition docnode.h:529
QCString text() const
Definition docnode.h:533
Node representing a Hypertext reference.
Definition docnode.h:832
QCString url() const
Definition docnode.h:839
Node representing a horizontal ruler.
Definition docnode.h:216
Node representing an HTML blockquote.
Definition docnode.h:1297
Node representing a HTML table caption.
Definition docnode.h:1234
QCString anchor() const
Definition docnode.h:1241
QCString file() const
Definition docnode.h:1240
Node representing a HTML table cell.
Definition docnode.h:1199
Valignment valignment() const
Definition docnode.cpp:1980
uint32_t rowSpan() const
Definition docnode.cpp:1918
Alignment alignment() const
Definition docnode.cpp:1942
bool isLast() const
Definition docnode.h:1208
bool isHeading() const
Definition docnode.h:1206
uint32_t colSpan() const
Definition docnode.cpp:1930
Node representing a HTML description data.
Definition docnode.h:1187
Node representing a Html description list.
Definition docnode.h:910
const HtmlAttribList & attribs() const
Definition docnode.h:914
Node representing a Html description item.
Definition docnode.h:897
Node Html details.
Definition docnode.h:866
const DocNodeVariant * summary() const
Definition docnode.h:873
Node Html heading.
Definition docnode.h:882
int level() const
Definition docnode.h:886
Node representing a Html list.
Definition docnode.h:1009
const HtmlAttribList & attribs() const
Definition docnode.h:1015
Type type() const
Definition docnode.h:1014
Node representing a HTML list item.
Definition docnode.h:1171
const HtmlAttribList & attribs() const
Definition docnode.h:1176
Node representing a HTML table row.
Definition docnode.h:1252
Node Html summary.
Definition docnode.h:853
Node representing a HTML table.
Definition docnode.h:1275
size_t numberHeaderRows() const
Definition docnode.cpp:2255
size_t numColumns() const
Definition docnode.h:1284
const DocNodeVariant * caption() const
Definition docnode.cpp:2250
Node representing an image.
Definition docnode.h:642
QCString name() const
Definition docnode.h:648
QCString height() const
Definition docnode.h:651
Type type() const
Definition docnode.h:647
QCString width() const
Definition docnode.h:650
bool isInlineImage() const
Definition docnode.h:654
bool hasCaption() const
Definition docnode.h:649
Node representing a include/dontinclude operator block.
Definition docnode.h:477
bool stripCodeComments() const
Definition docnode.h:506
bool isLast() const
Definition docnode.h:503
QCString includeFileName() const
Definition docnode.h:509
QCString text() const
Definition docnode.h:499
QCString context() const
Definition docnode.h:501
QCString exampleFile() const
Definition docnode.h:508
int line() const
Definition docnode.h:497
Type type() const
Definition docnode.h:485
bool isFirst() const
Definition docnode.h:502
bool showLineNo() const
Definition docnode.h:498
bool isExample() const
Definition docnode.h:507
Node representing an included text block from file.
Definition docnode.h:435
QCString blockId() const
Definition docnode.h:454
QCString extension() const
Definition docnode.h:450
bool stripCodeComments() const
Definition docnode.h:455
@ LatexInclude
Definition docnode.h:437
@ SnippetWithLines
Definition docnode.h:438
@ DontIncWithLines
Definition docnode.h:439
@ IncWithLines
Definition docnode.h:438
@ HtmlInclude
Definition docnode.h:437
@ VerbInclude
Definition docnode.h:437
@ DontInclude
Definition docnode.h:437
@ DocbookInclude
Definition docnode.h:439
Type type() const
Definition docnode.h:451
QCString exampleFile() const
Definition docnode.h:457
QCString text() const
Definition docnode.h:452
QCString file() const
Definition docnode.h:449
bool trimLeft() const
Definition docnode.h:459
bool isExample() const
Definition docnode.h:456
QCString context() const
Definition docnode.h:453
Node representing an entry in the index.
Definition docnode.h:552
QCString entry() const
Definition docnode.h:559
Node representing an internal section of documentation.
Definition docnode.h:978
Node representing an internal reference to some item.
Definition docnode.h:816
QCString file() const
Definition docnode.h:820
QCString anchor() const
Definition docnode.h:822
Node representing a line break.
Definition docnode.h:202
Node representing a word that can be linked to something.
Definition docnode.h:165
QCString file() const
Definition docnode.h:171
QCString ref() const
Definition docnode.h:173
QCString word() const
Definition docnode.h:170
QCString anchor() const
Definition docnode.h:174
Node representing a mermaid file.
Definition docnode.h:749
Node representing a msc file.
Definition docnode.h:722
DocNodeVariant * parent()
Definition docnode.h:90
Node representing an block of paragraphs.
Definition docnode.h:988
Node representing a paragraph in the documentation tree.
Definition docnode.h:1089
bool isLast() const
Definition docnode.h:1097
Node representing a parameter list.
Definition docnode.h:1131
const DocNodeList & parameters() const
Definition docnode.h:1135
const DocNodeList & paramTypes() const
Definition docnode.h:1136
DocParamSect::Direction direction() const
Definition docnode.h:1139
const DocNodeList & paragraphs() const
Definition docnode.h:1137
Node representing a parameter section.
Definition docnode.h:1062
bool hasInOutSpecifier() const
Definition docnode.h:1078
bool hasTypeSpecifier() const
Definition docnode.h:1079
Type type() const
Definition docnode.h:1077
Node representing a uml file.
Definition docnode.h:740
Node representing a reference to some item.
Definition docnode.h:787
QCString anchor() const
Definition docnode.h:794
SectionType sectionType() const
Definition docnode.h:796
QCString targetTitle() const
Definition docnode.h:795
bool isSubPage() const
Definition docnode.h:801
bool refToTable() const
Definition docnode.h:800
QCString file() const
Definition docnode.h:791
QCString ref() const
Definition docnode.h:793
bool refToSection() const
Definition docnode.h:799
bool hasLinkText() const
Definition docnode.h:797
Root node of documentation tree.
Definition docnode.h:1319
Node representing a reference to a section.
Definition docnode.h:944
bool refToTable() const
Definition docnode.h:952
QCString file() const
Definition docnode.h:948
QCString anchor() const
Definition docnode.h:949
QCString ref() const
Definition docnode.h:951
bool isSubPage() const
Definition docnode.h:953
Node representing a list of section references.
Definition docnode.h:968
Node representing a normal section.
Definition docnode.h:923
QCString file() const
Definition docnode.h:931
int level() const
Definition docnode.h:927
QCString anchor() const
Definition docnode.h:929
const DocNodeVariant * title() const
Definition docnode.h:928
Node representing a separator.
Definition docnode.h:365
QCString chars() const
Definition docnode.h:369
Node representing a simple list.
Definition docnode.h:999
Node representing a simple list item.
Definition docnode.h:1159
const DocNodeVariant * paragraph() const
Definition docnode.h:1163
Node representing a simple section.
Definition docnode.h:1026
Type type() const
Definition docnode.h:1035
const DocNodeVariant * title() const
Definition docnode.h:1042
Node representing a separator between two simple sections of the same type.
Definition docnode.h:1053
Node representing a style change.
Definition docnode.h:268
Style style() const
Definition docnode.h:307
bool enable() const
Definition docnode.h:309
Node representing a special symbol.
Definition docnode.h:328
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:332
Root node of a text fragment.
Definition docnode.h:1310
Node representing a simple section title.
Definition docnode.h:608
Node representing a URL (or email address).
Definition docnode.h:188
QCString url() const
Definition docnode.h:192
bool isEmail() const
Definition docnode.h:193
Node representing a verbatim, unparsed text fragment.
Definition docnode.h:376
QCString srcFile() const
Definition docnode.h:397
int srcLine() const
Definition docnode.h:398
QCString height() const
Definition docnode.h:392
bool hasCaption() const
Definition docnode.h:390
QCString language() const
Definition docnode.h:388
const DocNodeList & children() const
Definition docnode.h:395
bool isExample() const
Definition docnode.h:385
QCString context() const
Definition docnode.h:384
Type type() const
Definition docnode.h:382
QCString text() const
Definition docnode.h:383
QCString exampleFile() const
Definition docnode.h:386
QCString engine() const
Definition docnode.h:393
bool useBitmap() const
Definition docnode.h:394
@ JavaDocLiteral
Definition docnode.h:378
QCString width() const
Definition docnode.h:391
Node representing a VHDL flow chart.
Definition docnode.h:758
CodeParserInterface & getCodeParser(const QCString &langExt)
void pushHidden(bool hide)
bool popHidden()
Node representing some amount of white space.
Definition docnode.h:354
QCString chars() const
Definition docnode.h:358
Node representing a word.
Definition docnode.h:153
QCString word() const
Definition docnode.h:156
Node representing an item of a cross-referenced list.
Definition docnode.h:621
QCString anchor() const
Definition docnode.h:625
QCString file() const
Definition docnode.h:624
QCString title() const
Definition docnode.h:626
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
void startMermaidFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
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)
void startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
void writeMermaidFile(const QCString &baseName, const DocVerbatim &s)
void endDotFile(bool hasCaption)
void operator()(const DocWord &)
void visitCaption(const DocNodeList &children)
void addRowSpan(ActiveRowSpan &&span)
void setNumCols(size_t num)
void writeStartTableCommand(const DocNodeVariant *n, size_t cols)
void writeEndTableCommand(const DocNodeVariant *n)
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
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void filter(const QCString &str, const bool retainNewLine=false)
void endMscFile(bool hasCaption)
bool isTableNested(const DocNodeVariant *n) const
void startPlantUmlFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
LatexListItemInfo m_listItemInfo[maxIndentLevels]
bool insideTable() const
void endDiaFile(bool hasCaption)
void endMermaidFile(bool hasCaption)
const char * getSectionName(int level) const
void endPlantUmlFile(bool hasCaption)
void writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile=true)
void visitChildren(const T &t)
LatexCodeGenerator & m_lcg
void generateMermaidOutput(const QCString &baseName, const QCString &outDir, ImageFormat format, bool toIndex)
Register a generated Mermaid image with the index.
Definition mermaid.cpp:117
static QCString imageExtension(ImageFormat imageFormat)
Definition mermaid.cpp:43
static MermaidManager & instance()
Definition mermaid.cpp:33
static ImageFormat convertToImageFormat(OutputFormat outputFormat)
Definition mermaid.cpp:54
QCString writeMermaidSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, ImageFormat format, const QCString &srcFile, int srcLine)
Write a Mermaid source file and register it for CLI rendering.
Definition mermaid.cpp:70
Class representing a list of different code generators.
Definition outputlist.h:165
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format, bool toIndex)
Convert a PlantUML file to an image.
Definition plantuml.cpp:202
StringVector 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:31
static PlantumlManager & instance()
Definition plantuml.cpp:232
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:422
int toInt(bool *ok=nullptr, int base=10) const
Definition qcstring.cpp:254
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
bool endsWith(const char *s) const
Definition qcstring.h:524
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
const std::string & str() const
Definition qcstring.h:552
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:172
QCString left(size_t len) const
Definition qcstring.h:229
constexpr int level() const
Definition section.h:46
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:151
#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, bool toIndex)
Definition dia.cpp:28
constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
returns true iff v holds one of types passed as template parameters
Definition docnode.h:1372
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, DocMermaidFile > DocNodeVariant
Definition docnode.h:67
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:1336
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine, bool toIndex)
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 const char * g_subparagraphLabel
static const int g_maxLevels
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 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)
void latexWriteIndexItem(TextStream &m_t, const QCString &s1, const QCString &s2)
#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, bool toIndex)
Definition msc.cpp:157
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:844
Portable versions of functions that are platform dependent.
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
Options to configure the code parser.
Definition parserintf.h:78
CodeParserOptions & setStartLine(int lineNr)
Definition parserintf.h:101
CodeParserOptions & setInlineFragment(bool enable)
Definition parserintf.h:107
CodeParserOptions & setShowLineNumbers(bool enable)
Definition parserintf.h:113
CodeParserOptions & setFileDef(const FileDef *fd)
Definition parserintf.h:98
SrcLangExt
Definition types.h:207
QCString writeFileContents(const QCString &baseName, const QCString &extension, const QCString &content, bool &exists)
Thread-safe function to write a string to a file.
Definition util.cpp:6977
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5231
QCString integerToRoman(int n, bool upper)
Definition util.cpp:6716
QCString stripPath(const QCString &s)
Definition util.cpp:4969
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:5570
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5249
QCString makeBaseName(const QCString &name, const QCString &ext)
Definition util.cpp:4985
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:5875
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5273
A bunch of utility functions.