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