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#include <array>
22
23// other includes
24#include "cite.h"
25#include "codefragment.h"
26#include "config.h"
27#include "dia.h"
28#include "docparser.h"
29#include "dot.h"
30#include "doxygen.h"
31#include "emoji.h"
32#include "filedef.h"
33#include "fileinfo.h"
34#include "htmlattrib.h"
35#include "htmlentity.h"
36#include "language.h"
37#include "latexgen.h"
38#include "mermaid.h"
39#include "message.h"
40#include "msc.h"
41#include "outputlist.h"
42#include "parserintf.h"
43#include "plantuml.h"
44#include "portable.h"
45#include "regex.h"
46#include "util.h"
47
48static const int g_maxLevels = 7;
49static const std::array<const char *,g_maxLevels> g_secLabels =
50{ "doxysection",
51 "doxysubsection",
52 "doxysubsubsection",
53 "doxysubsubsubsection",
54 "doxysubsubsubsubsection",
55 "doxysubsubsubsubsubsection",
56 "doxysubsubsubsubsubsubsection"
57};
58
59static const char *g_paragraphLabel = "doxyparagraph";
60static const char *g_subparagraphLabel = "doxysubparagraph";
61
62const char *LatexDocVisitor::getSectionName(int level) const
63{
64 bool compactLatex = Config_getBool(COMPACT_LATEX);
65 int l = level;
66 if (compactLatex) l++;
67
68 if (l < g_maxLevels)
69 {
70 l += m_hierarchyLevel; /* May be -1 if generating main page */
71 // Sections get special treatment because they inherit the parent's level
72 if (l >= g_maxLevels)
73 {
74 l = g_maxLevels - 1;
75 }
76 else if (l < 0)
77 {
78 /* Should not happen; level is always >= 1 and hierarchyLevel >= -1 */
79 l = 0;
80 }
81 return g_secLabels[l];
82 }
83 else if (l == 7)
84 {
85 return g_paragraphLabel;
86 }
87 else
88 {
90 }
91}
92
93static void insertDimension(TextStream &t, DString dimension, const char *orientationString)
94{
95 // dimensions for latex images can be a percentage, in this case they need some extra
96 // handling as the % symbol is used for comments
97 static const reg::Ex re(R"((\d+)%)");
98 std::string s = dimension.str();
99 reg::Match match;
100 if (reg::search(s,match,re))
101 {
102 bool ok = false;
103 double percent = DString(match[1].str()).toInt(&ok);
104 if (ok)
105 {
106 t << percent/100.0 << "\\text" << orientationString;
107 return;
108 }
109 }
110 t << dimension;
111}
112
113static void visitPreStart(TextStream &t, bool hasCaption, DString name, DString width, DString height, bool inlineImage = false)
114{
115 if (inlineImage)
116 {
117 t << "\n\\begin{DoxyInlineImage}%\n";
118 }
119 else
120 {
121 if (hasCaption)
122 {
123 t << "\n\\begin{DoxyImage}%\n";
124 }
125 else
126 {
127 t << "\n\\begin{DoxyImageNoCaption}%\n"
128 " \\doxymbox{";
129 }
130 }
131
132 t << "\\includegraphics";
133 if (!width.empty() || !height.empty())
134 {
135 t << "[";
136 }
137 if (!width.empty())
138 {
139 t << "width=";
140 insertDimension(t, width, "width");
141 }
142 if (!width.empty() && !height.empty())
143 {
144 t << ",";
145 }
146 if (!height.empty())
147 {
148 t << "height=";
149 insertDimension(t, height, "height");
150 }
151 if (width.empty() && height.empty())
152 {
153 /* default setting */
154 if (inlineImage)
155 {
156 t << "[height=\\baselineskip,keepaspectratio=true]";
157 }
158 else
159 {
160 t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]";
161 }
162 }
163 else
164 {
165 t << "]";
166 }
167
168 t << "{" << name << "}";
169
170 if (hasCaption)
171 {
172 if (!inlineImage)
173 {
174 if (Config_getBool(PDF_HYPERLINKS))
175 {
176 t << "%\n\\doxyfigcaption{";
177 }
178 else
179 {
180 t << "%\n\\doxyfigcaptionnolink{";
181 }
182 }
183 else
184 {
185 t << "%"; // to catch the caption
186 }
187 }
188}
189
190
191
192static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage = false)
193{
194 if (inlineImage)
195 {
196 t << "%\n\\end{DoxyInlineImage}\n";
197 }
198 else
199 {
200 t << "}%\n"; // end doxymbox or caption
201 if (hasCaption)
202 {
203 t << "\\end{DoxyImage}\n";
204 }
205 else
206 {
207 t << "\\end{DoxyImageNoCaption}\n";
208 }
209 }
210}
211
213{
214 for (const auto &n : children)
215 {
216 std::visit(*this,n);
217 }
218}
219
221 const DString &langExt, int hierarchyLevel)
222 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(false),
223 m_insideItem(false), m_hide(false), m_captionTable(false),
224 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
225{
226}
227
228 //--------------------------------------
229 // visitor functions for leaf nodes
230 //--------------------------------------
231
233{
234 if (m_hide) return;
235 filter(w.word());
236}
237
239{
240 if (m_hide) return;
241 startLink(w.ref(),w.file(),w.anchor());
242 filter(w.word());
243 endLink(w.ref(),w.file(),w.anchor());
244}
245
247{
248 if (m_hide) return;
249 if (m_insidePre)
250 {
251 m_t << w.chars();
252 }
253 else
254 {
255 m_t << " ";
256 }
257}
258
260{
261 if (m_hide) return;
262 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
263 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
264 if (res)
265 {
267 {
268 if (pdfHyperlinks)
269 {
270 m_t << "\\texorpdfstring{$<$}{<}";
271 }
272 else
273 {
274 m_t << "$<$";
275 }
276 }
278 {
279 if (pdfHyperlinks)
280 {
281 m_t << "\\texorpdfstring{$>$}{>}";
282 }
283 else
284 {
285 m_t << "$>$";
286 }
287 }
288 else
289 {
290 m_t << res;
291 }
292 }
293 else
294 {
295 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),true));
296 }
297}
298
300{
301 if (m_hide) return;
303 if (!emojiName.empty())
304 {
305 DString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
306 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
307 filter(emojiName);
308 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
309 }
310 else
311 {
312 m_t << s.name();
313 }
314}
315
317{
318 if (m_hide) return;
319 if (Config_getBool(PDF_HYPERLINKS))
320 {
321 m_t << "\\href{";
322 if (u.isEmail()) m_t << "mailto:";
323 m_t << latexFilterURL(u.url()) << "}";
324 }
325 m_t << "{\\texttt{";
326 filter(u.url());
327 m_t << "}}";
328}
329
331{
332 if (m_hide) return;
333 if (m_insideItem)
334 {
335 m_t << "\\\\\n";
336 }
337 else if (m_captionTable)
338 {
339 m_t << "\\hspace{\\textwidth minus \\textwidth}\\mbox{}\\\\ ";
340 }
341 else
342 {
343 m_t << "~\\newline\n";
344 }
345}
346
348{
349 if (m_hide) return;
350 if (insideTable())
351 m_t << "\\DoxyHorRuler{1}\n";
352 else
353 m_t << "\\DoxyHorRuler{0}\n";
354}
355
357{
358 if (m_hide) return;
359 switch (s.style())
360 {
362 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
363 break;
367 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
368 break;
371 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
372 break;
374 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
375 break;
379 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
380 break;
382 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
383 break;
385 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
386 break;
388 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
389 break;
391 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
392 break;
394 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
395 break;
397 if (s.enable())
398 {
399 m_t << "\n\\begin{DoxyPre}";
400 m_insidePre=true;
401 }
402 else
403 {
404 m_insidePre=false;
405 m_t << "\\end{DoxyPre}\n";
406 }
407 break;
408 case DocStyleChange::Div: /* HTML only */ break;
409 case DocStyleChange::Span: /* HTML only */ break;
410 }
411}
412
414{
415 if (m_hide) return;
416 DString lang = m_langExt;
417 if (!s.language().empty()) // explicit language setting
418 {
419 lang = s.language();
420 }
421 SrcLangExt langExt = getLanguageFromCodeLang(lang);
422 switch(s.type())
423 {
425 {
426 m_ci.startCodeFragment("DoxyCode");
427 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
428 Config_getBool(STRIP_CODE_COMMENTS),
429 CodeParserOptions().setExample(s.isExample(),s.exampleFile()));
430 m_ci.endCodeFragment("DoxyCode");
431 }
432 break;
434 filter(s.text(), true);
435 break;
437 m_t << "{\\ttfamily ";
438 filter(s.text(), true);
439 m_t << "}";
440 break;
442 if (isTableNested(s.parent())) // in table
443 {
444 m_t << "\\begin{DoxyCode}{0}";
445 filter(s.text(), true);
446 m_t << "\\end{DoxyCode}\n";
447 }
448 else
449 {
450 m_t << "\\begin{DoxyVerb}";
451 m_t << s.text();
452 m_t << "\\end{DoxyVerb}\n";
453 }
454 break;
460 /* nothing */
461 break;
463 m_t << s.text();
464 break;
465 case DocVerbatim::Dot:
466 {
467 bool exists = false;
468 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_", // baseName
469 ".dot", // extension
470 s.text(), // contents
471 exists);
472 if (!fileName.empty())
473 {
474 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine(),!exists);
475 visitChildren(s);
477 }
478 }
479 break;
480 case DocVerbatim::Msc:
481 {
482 bool exists = false;
483 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_", // baseName
484 ".msc", // extension
485 "msc {"+s.text()+"}", // contents
486 exists);
487 if (!fileName.empty())
488 {
489 writeMscFile(fileName, s, !exists);
490 }
491 }
492 break;
494 {
495 DString latexOutput = Config_getString(LATEX_OUTPUT);
496 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
497 latexOutput,s.exampleFile(),s.text(),
499 s.engine(),s.srcFile(),s.srcLine(),true);
500
501 for (const auto &baseName: baseNameVector)
502 {
503 writePlantUMLFile(baseName, s);
504 }
505 }
506 break;
508 if (Config_getBool(MERMAID_RENDER_MODE)!=MERMAID_RENDER_MODE_t::CLIENT_SIDE)
509 {
510 auto latexOutput = Config_getString(LATEX_OUTPUT);
511 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
512 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
514 latexOutput,s.exampleFile(),s.text(),imageFormat,
515 s.srcFile(),s.srcLine());
516 writeMermaidFile(baseName, s);
517 }
518 break;
519 }
520}
521
523{
524 if (m_hide) return;
525 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
526 if (!anc.file().empty() && Config_getBool(PDF_HYPERLINKS))
527 {
528 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
529 << "}%\n";
530 }
531}
532
534{
535 if (m_hide) return;
537 switch(inc.type())
538 {
540 {
541 m_ci.startCodeFragment("DoxyCodeInclude");
542 FileInfo cfi( inc.file().str() );
543 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
545 inc.text(),
546 langExt,
547 inc.stripCodeComments(),
549 .setExample(inc.isExample(), inc.exampleFile())
550 .setFileDef(fd.get())
551 .setInlineFragment(true)
552 );
553 m_ci.endCodeFragment("DoxyCodeInclude");
554 }
555 break;
557 {
558 m_ci.startCodeFragment("DoxyCodeInclude");
560 inc.text(),langExt,
561 inc.stripCodeComments(),
563 .setExample(inc.isExample(), inc.exampleFile())
564 .setInlineFragment(true)
565 .setShowLineNumbers(false)
566 );
567 m_ci.endCodeFragment("DoxyCodeInclude");
568 }
569 break;
577 break;
579 m_t << inc.text();
580 break;
582 if (isTableNested(inc.parent())) // in table
583 {
584 m_t << "\\begin{DoxyCode}{0}";
585 filter(inc.text(), true);
586 m_t << "\\end{DoxyCode}\n";
587 }
588 else
589 {
590 m_t << "\n\\begin{DoxyVerbInclude}\n";
591 m_t << inc.text();
592 m_t << "\\end{DoxyVerbInclude}\n";
593 }
594 break;
597 {
598 m_ci.startCodeFragment("DoxyCodeInclude");
600 inc.file(),
601 inc.blockId(),
602 inc.context(),
604 inc.trimLeft(),
606 );
607 m_ci.endCodeFragment("DoxyCodeInclude");
608 }
609 break;
610 }
611}
612
614{
615 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
616 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
617 if (op.isFirst())
618 {
619 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
621 m_hide = true;
622 }
624 if (locLangExt.empty()) locLangExt = m_langExt;
625 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
626 if (op.type()!=DocIncOperator::Skip)
627 {
628 m_hide = popHidden();
629 if (!m_hide)
630 {
631 std::unique_ptr<FileDef> fd;
632 if (!op.includeFileName().empty())
633 {
634 FileInfo cfi( op.includeFileName().str() );
635 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
636 }
637
638 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
641 .setExample(op.isExample(),op.exampleFile())
642 .setFileDef(fd.get())
643 .setStartLine(op.line())
645 );
646 }
648 m_hide=true;
649 }
650 if (op.isLast())
651 {
653 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
654 }
655 else
656 {
657 if (!m_hide) m_t << "\n";
658 }
659}
660
662{
663 if (m_hide) return;
664 DString s = f.text();
665 const char *p = s.data();
666 char c = 0;
667 if (p)
668 {
669 while ((c=*p++))
670 {
671 switch (c)
672 {
673 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
674 default: m_t << c; break;
675 }
676 }
677 }
678}
679
681{
682 if (m_hide) return;
684}
685
689
691{
692 if (m_hide) return;
693 auto opt = cite.option();
694 DString txt;
695 if (m_texOrPdf == TexOrPdf::PDF || opt.noCite())
696 {
697 if (!cite.file().empty())
698 {
699 txt = cite.getText();
700 }
701 else
702 {
703 if (!opt.noPar()) txt += "[";
704 txt += cite.target();
705 if (!opt.noPar()) txt += "]";
706 }
707 m_t << "{\\bfseries ";
708 filter(txt);
709 m_t << "}";
710 }
711 else
712 {
713 if (!cite.file().empty())
714 {
715 DString anchor = cite.anchor();
717 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
718
719 if (m_texOrPdf == TexOrPdf::TEX) txt = "\\protect";
720 txt += "\\DoxyCite{" + anchor + "}";
721 if (opt.isNumber())
722 {
723 txt += "{number}";
724 }
725 else if (opt.isShortAuthor())
726 {
727 txt += "{shortauthor}";
728 }
729 else if (opt.isYear())
730 {
731 txt += "{year}";
732 }
733 if (!opt.noPar()) txt += "{1}";
734 else txt += "{0}";
735 m_t << txt;
736
737 txt = cite.getText();
738 m_t << "{\\bfseries ";
739 filter(txt);
740 m_t << "}";
741 }
742 else
743 {
744 if (!opt.noPar()) txt += "[";
745 txt += cite.target();
746 if (!opt.noPar()) txt += "]";
747 m_t << "{\\bfseries ";
748 filter(txt);
749 m_t << "}";
750 }
751 }
752}
753
754//--------------------------------------
755// visitor functions for compound nodes
756//--------------------------------------
757
759{
760 if (m_hide) return;
761 if (m_indentLevel>=maxIndentLevels-1) return;
762 if (l.isEnumList())
763 {
764 m_t << "\n\\begin{DoxyEnumerate}";
766 }
767 else
768 {
770 m_t << "\n\\begin{DoxyItemize}";
771 }
772 visitChildren(l);
773 if (l.isEnumList())
774 {
775 m_t << "\n\\end{DoxyEnumerate}";
776 }
777 else
778 {
779 m_t << "\n\\end{DoxyItemize}";
780 }
781}
782
784{
785 if (m_hide) return;
786 switch (li.itemNumber())
787 {
788 case DocAutoList::Unchecked: // unchecked
789 m_t << "\n\\item[\\DoxyUnchecked] ";
790 break;
791 case DocAutoList::Checked_x: // checked with x
792 case DocAutoList::Checked_X: // checked with X
793 m_t << "\n\\item[\\DoxyChecked] ";
794 break;
795 default:
796 m_t << "\n\\item ";
797 break;
798 }
800 visitChildren(li);
802}
803
805{
806 if (m_hide) return;
807 visitChildren(p);
808 if (!p.isLast() && // omit <p> for last paragraph
809 !(p.parent() && // and for parameter sections
810 std::get_if<DocParamSect>(p.parent())
811 )
812 )
813 {
814 if (insideTable())
815 {
816 m_t << "~\\newline\n";
817 }
818 else
819 {
820 m_t << "\n\n";
821 }
822 }
823}
824
826{
827 visitChildren(r);
828}
829
831{
832 if (m_hide) return;
833 switch(s.type())
834 {
836 m_t << "\\begin{DoxySeeAlso}{";
838 break;
840 m_t << "\\begin{DoxyReturn}{";
842 break;
844 m_t << "\\begin{DoxyAuthor}{";
845 filter(theTranslator->trAuthor(true,true));
846 break;
848 m_t << "\\begin{DoxyAuthor}{";
849 filter(theTranslator->trAuthor(true,false));
850 break;
852 m_t << "\\begin{DoxyVersion}{";
854 break;
856 m_t << "\\begin{DoxySince}{";
858 break;
860 m_t << "\\begin{DoxyDate}{";
862 break;
864 m_t << "\\begin{DoxyNote}{";
866 break;
868 m_t << "\\begin{DoxyWarning}{";
870 break;
872 m_t << "\\begin{DoxyPrecond}{";
874 break;
876 m_t << "\\begin{DoxyPostcond}{";
878 break;
880 m_t << "\\begin{DoxyCopyright}{";
882 break;
884 m_t << "\\begin{DoxyInvariant}{";
886 break;
888 m_t << "\\begin{DoxyRemark}{";
890 break;
892 m_t << "\\begin{DoxyAttention}{";
894 break;
896 m_t << "\\begin{DoxyImportant}{";
898 break;
900 m_t << "\\begin{DoxyParagraph}{";
901 break;
903 m_t << "\\begin{DoxyParagraph}{";
904 break;
905 case DocSimpleSect::Unknown: break;
906 }
907
908 if (s.title())
909 {
910 m_insideItem=true;
911 std::visit(*this,*s.title());
912 m_insideItem=false;
913 }
914 m_t << "}\n";
916 visitChildren(s);
917 switch(s.type())
918 {
920 m_t << "\n\\end{DoxySeeAlso}\n";
921 break;
923 m_t << "\n\\end{DoxyReturn}\n";
924 break;
926 m_t << "\n\\end{DoxyAuthor}\n";
927 break;
929 m_t << "\n\\end{DoxyAuthor}\n";
930 break;
932 m_t << "\n\\end{DoxyVersion}\n";
933 break;
935 m_t << "\n\\end{DoxySince}\n";
936 break;
938 m_t << "\n\\end{DoxyDate}\n";
939 break;
941 m_t << "\n\\end{DoxyNote}\n";
942 break;
944 m_t << "\n\\end{DoxyWarning}\n";
945 break;
947 m_t << "\n\\end{DoxyPrecond}\n";
948 break;
950 m_t << "\n\\end{DoxyPostcond}\n";
951 break;
953 m_t << "\n\\end{DoxyCopyright}\n";
954 break;
956 m_t << "\n\\end{DoxyInvariant}\n";
957 break;
959 m_t << "\n\\end{DoxyRemark}\n";
960 break;
962 m_t << "\n\\end{DoxyAttention}\n";
963 break;
965 m_t << "\n\\end{DoxyImportant}\n";
966 break;
968 m_t << "\n\\end{DoxyParagraph}\n";
969 break;
971 m_t << "\n\\end{DoxyParagraph}\n";
972 break;
973 default:
974 break;
975 }
977}
978
980{
981 if (m_hide) return;
982 visitChildren(t);
983}
984
986{
987 if (m_hide) return;
988 m_t << "\\begin{DoxyItemize}\n";
990 visitChildren(l);
991 m_t << "\\end{DoxyItemize}\n";
992}
993
995{
996 if (m_hide) return;
997 m_t << "\\item ";
999 if (li.paragraph())
1000 {
1001 visit(*this,*li.paragraph());
1002 }
1004}
1005
1007{
1008 if (m_hide) return;
1009 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1010 if (pdfHyperlinks)
1011 {
1012 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1013 }
1014 m_t << "\\" << getSectionName(s.level()) << "{";
1015 if (pdfHyperlinks)
1016 {
1017 m_t << "\\texorpdfstring{";
1018 }
1019 if (s.title())
1020 {
1021 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1022 std::visit(*this,*s.title());
1024 }
1025 if (pdfHyperlinks)
1026 {
1027 m_t << "}{";
1028 if (s.title())
1029 {
1030 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1031 std::visit(*this,*s.title());
1033 }
1034 m_t << "}";
1035 }
1036 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1037 visitChildren(s);
1038}
1039
1041{
1042 if (m_hide) return;
1043 if (m_indentLevel>=maxIndentLevels-1) return;
1045 if (s.type()==DocHtmlList::Ordered)
1046 {
1047 bool first = true;
1048 m_t << "\n\\begin{DoxyEnumerate}";
1049 for (const auto &opt : s.attribs())
1050 {
1051 if (opt.name=="type")
1052 {
1053 if (opt.value=="1")
1054 {
1055 m_t << (first ? "[": ",");
1056 m_t << "label=\\arabic*";
1057 first = false;
1058 }
1059 else if (opt.value=="a")
1060 {
1061 m_t << (first ? "[": ",");
1062 m_t << "label=\\enumalphalphcnt*";
1063 first = false;
1064 }
1065 else if (opt.value=="A")
1066 {
1067 m_t << (first ? "[": ",");
1068 m_t << "label=\\enumAlphAlphcnt*";
1069 first = false;
1070 }
1071 else if (opt.value=="i")
1072 {
1073 m_t << (first ? "[": ",");
1074 m_t << "label=\\roman*";
1075 first = false;
1076 }
1077 else if (opt.value=="I")
1078 {
1079 m_t << (first ? "[": ",");
1080 m_t << "label=\\Roman*";
1081 first = false;
1082 }
1083 }
1084 else if (opt.name=="start")
1085 {
1086 m_t << (first ? "[": ",");
1087 bool ok = false;
1088 int val = opt.value.toInt(&ok);
1089 if (ok) m_t << "start=" << val;
1090 first = false;
1091 }
1092 }
1093 if (!first) m_t << "]\n";
1094 }
1095 else
1096 {
1097 m_t << "\n\\begin{DoxyItemize}";
1098 }
1099 visitChildren(s);
1100 if (m_indentLevel>=maxIndentLevels-1) return;
1101 if (s.type()==DocHtmlList::Ordered)
1102 m_t << "\n\\end{DoxyEnumerate}";
1103 else
1104 m_t << "\n\\end{DoxyItemize}";
1105}
1106
1108{
1109 if (m_hide) return;
1110 if (m_listItemInfo[indentLevel()].isEnum)
1111 {
1112 for (const auto &opt : l.attribs())
1113 {
1114 if (opt.name=="value")
1115 {
1116 bool ok = false;
1117 int val = opt.value.toInt(&ok);
1118 if (ok)
1119 {
1120 m_t << "\n\\setcounter{DoxyEnumerate" << DString::integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1121 }
1122 }
1123 }
1124 }
1125 m_t << "\n\\item ";
1127 visitChildren(l);
1129}
1130
1131
1133{
1134 HtmlAttribList attrs = dl.attribs();
1135 auto it = std::find_if(attrs.begin(),attrs.end(),
1136 [](const auto &att) { return att.name=="class"; });
1137 if (it!=attrs.end() && it->value == "reflist") return true;
1138 return false;
1139}
1140
1141static bool listIsNested(const DocHtmlDescList &dl)
1142{
1143 bool isNested=false;
1144 const DocNodeVariant *n = dl.parent();
1145 while (n && !isNested)
1146 {
1147 if (std::get_if<DocHtmlDescList>(n))
1148 {
1149 isNested = !classEqualsReflist(std::get<DocHtmlDescList>(*n));
1150 }
1151 n = ::parent(n);
1152 }
1153 return isNested;
1154}
1155
1157{
1158 if (m_hide) return;
1159 bool eq = classEqualsReflist(dl);
1160 if (eq)
1161 {
1162 m_t << "\n\\begin{DoxyRefList}";
1163 }
1164 else
1165 {
1166 if (listIsNested(dl)) m_t << "\n\\hfill";
1167 m_t << "\n\\begin{DoxyDescription}";
1168 }
1169 visitChildren(dl);
1170 if (eq)
1171 {
1172 m_t << "\n\\end{DoxyRefList}";
1173 }
1174 else
1175 {
1176 m_t << "\n\\end{DoxyDescription}";
1177 }
1178}
1179
1181{
1182 if (m_hide) return;
1183 m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
1184 m_insideItem=true;
1185 visitChildren(dt);
1186 m_insideItem=false;
1187 m_t << "}}]";
1188}
1189
1191{
1193 if (!m_insideItem) m_t << "\\hfill";
1194 m_t << " \\\\\n";
1195 visitChildren(dd);
1197}
1198
1200{
1201 bool isNested=m_lcg.usedTableLevel()>0;
1202 while (n && !isNested)
1203 {
1205 n = ::parent(n);
1206 }
1207 return isNested;
1208}
1209
1211{
1212 if (isTableNested(n))
1213 {
1214 m_t << "\\begin{DoxyTableNested}{" << cols << "}";
1215 }
1216 else
1217 {
1218 m_t << "\n\\begin{DoxyTable}{" << cols << "}";
1219 }
1220}
1221
1223{
1224 if (isTableNested(n))
1225 {
1226 m_t << "\\end{DoxyTableNested}\n";
1227 }
1228 else
1229 {
1230 m_t << "\\end{DoxyTable}\n";
1231 }
1232}
1233
1235{
1236 if (m_hide) return;
1238 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1239 if (c)
1240 {
1241 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1242 if (!c->file().empty() && pdfHyperLinks)
1243 {
1244 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1245 << "}{}";
1246 }
1247 m_t << "\n";
1248 }
1249
1251 if (!isTableNested(t.parent()))
1252 {
1253 // write caption
1254 m_t << "{";
1255 if (c)
1256 {
1257 m_captionTable = true;
1258 std::visit(*this, *t.caption());
1259 m_captionTable = false;
1260 }
1261 m_t << "}";
1262 // write label
1263 m_t << "{";
1264 if (c && (!stripPath(c->file()).empty() || !c->anchor().empty()))
1265 {
1266 m_t << stripPath(c->file()) << "_" << c->anchor();
1267 }
1268 m_t << "}";
1269 }
1270
1271 // write head row(s)
1272 m_t << "{" << t.numberHeaderRows() << "}\n";
1273
1275
1276 visitChildren(t);
1278 popTableState();
1279}
1280
1282{
1283 if (m_hide) return;
1284 visitChildren(c);
1285}
1286
1288{
1289 if (m_hide) return;
1291
1292 visitChildren(row);
1293
1294 m_t << "\\\\";
1295
1296 size_t col = 1;
1297 for (auto &span : rowSpans())
1298 {
1299 if (span.rowSpan>0) span.rowSpan--;
1300 if (span.rowSpan<=0)
1301 {
1302 // inactive span
1303 }
1304 else if (span.column>col)
1305 {
1306 col = span.column+span.colSpan;
1307 }
1308 else
1309 {
1310 col = span.column+span.colSpan;
1311 }
1312 }
1313
1314 m_t << "\n";
1315}
1316
1318{
1319 if (m_hide) return;
1320 //printf("Cell(r=%u,c=%u) rowSpan=%d colSpan=%d currentColumn()=%zu\n",c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),currentColumn());
1321
1323
1324 DString cellOpts;
1325 DString cellSpec;
1326 auto appendOpt = [&cellOpts](const DString &s)
1327 {
1328 if (!cellOpts.empty()) cellOpts+=",";
1329 cellOpts+=s;
1330 };
1331 auto appendSpec = [&cellSpec](const DString &s)
1332 {
1333 if (!cellSpec.empty()) cellSpec+=",";
1334 cellSpec+=s;
1335 };
1336 auto writeCell = [this,&cellOpts,&cellSpec]()
1337 {
1338 if (!cellOpts.empty() || !cellSpec.empty())
1339 {
1340 m_t << "\\SetCell";
1341 if (!cellOpts.empty())
1342 {
1343 m_t << "[" << cellOpts << "]";
1344 }
1345 m_t << "{" << cellSpec << "}";
1346 }
1347 };
1348
1349 // skip over columns that have a row span starting at an earlier row
1350 for (const auto &span : rowSpans())
1351 {
1352 //printf("span(r=%u,c=%u): column=%zu colSpan=%zu,rowSpan=%zu currentColumn()=%zu\n",
1353 // span.cell.rowIndex(),span.cell.columnIndex(),
1354 // span.column,span.colSpan,span.rowSpan,
1355 // currentColumn());
1356 if (span.rowSpan>0 && span.column==currentColumn())
1357 {
1358 setCurrentColumn(currentColumn()+span.colSpan);
1359 for (size_t i=0;i<span.colSpan;i++)
1360 {
1361 m_t << "&";
1362 }
1363 }
1364 }
1365
1366 int cs = c.colSpan();
1367 int ha = c.alignment();
1368 int rs = c.rowSpan();
1369 int va = c.valignment();
1370
1371 switch (ha) // horizontal alignment
1372 {
1373 case DocHtmlCell::Right:
1374 appendSpec("r");
1375 break;
1377 appendSpec("c");
1378 break;
1379 default:
1380 // default
1381 break;
1382 }
1383 if (rs>0) // row span
1384 {
1385 appendOpt("r="+DString().setNum(rs));
1386 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%zu\n",
1387 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1388 // currentColumn());
1390 }
1391 if (cs>1) // column span
1392 {
1393 // update column to the end of the span, needs to be done *after* calling addRowSpan()
1395 appendOpt("c="+DString().setNum(cs));
1396 }
1397 if (c.isHeading())
1398 {
1399 appendSpec("bg=\\tableheadbgcolor");
1400 appendSpec("font=\\bfseries");
1401 }
1402 switch(va) // vertical alignment
1403 {
1404 case DocHtmlCell::Top:
1405 appendSpec("h");
1406 break;
1408 appendSpec("f");
1409 break;
1411 // default
1412 break;
1413 }
1414 writeCell();
1415
1416 visitChildren(c);
1417
1418 for (int i=0;i<cs-1;i++)
1419 {
1420 m_t << "&"; // placeholder for invisible cell
1421 }
1422
1423 if (!c.isLast()) m_t << "&";
1424}
1425
1427{
1428 if (m_hide) return;
1429 visitChildren(i);
1430}
1431
1433{
1434 if (m_hide) return;
1435 if (Config_getBool(PDF_HYPERLINKS))
1436 {
1437 m_t << "\\href{";
1438 m_t << latexFilterURL(href.url());
1439 m_t << "}";
1440 }
1441 m_t << "{\\texttt{";
1442 visitChildren(href);
1443 m_t << "}}";
1444}
1445
1447{
1448 if (m_hide) return;
1449 m_t << "{\\bfseries{";
1450 visitChildren(d);
1451 m_t << "}}";
1452}
1453
1455{
1456 if (m_hide) return;
1457 m_t << "\n\n";
1458 auto summary = d.summary();
1459 if (summary)
1460 {
1461 std::visit(*this,*summary);
1462 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1463 }
1464 visitChildren(d);
1465 if (summary)
1466 {
1467 m_t << "\\end{adjustwidth}\n";
1468 }
1469 else
1470 {
1471 m_t << "\n\n";
1472 }
1473}
1474
1476{
1477 if (m_hide) return;
1478 m_t << "\\" << getSectionName(header.level()) << "*{";
1479 visitChildren(header);
1480 m_t << "}";
1481}
1482
1484{
1485 if (img.type()==DocImage::Latex)
1486 {
1487 if (m_hide) return;
1488 DString gfxName = img.name();
1489 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1490 {
1491 gfxName=gfxName.left(gfxName.length()-4);
1492 }
1493
1494 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1495 visitChildren(img);
1497 }
1498 else // other format -> skip
1499 {
1500 }
1501}
1502
1504{
1505 if (m_hide) return;
1506 bool exists = false;
1507 std::string inBuf;
1508 if (readInputFile(df.file(),inBuf))
1509 {
1510 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1511 ".dot", // extension
1512 inBuf, // contents
1513 exists);
1514 if (!fileName.empty())
1515 {
1516 startDotFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1517 visitChildren(df);
1518 endDotFile(df.hasCaption());
1519 }
1520 }
1521}
1522
1524{
1525 if (m_hide) return;
1526 bool exists = false;
1527 std::string inBuf;
1528 if (readInputFile(df.file(),inBuf))
1529 {
1530 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1531 ".msc", // extension
1532 inBuf, // contents
1533 exists);
1534 if (!fileName.empty())
1535 {
1536 startMscFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1537 visitChildren(df);
1538 endMscFile(df.hasCaption());
1539 }
1540 }
1541}
1542
1544{
1545 if (m_hide) return;
1546 bool exists = false;
1547 std::string inBuf;
1548 if (readInputFile(df.file(),inBuf))
1549 {
1550 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1551 ".dia", // extension
1552 inBuf, // contents
1553 exists);
1554 if (!fileName.empty())
1555 {
1556 startDiaFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1557 visitChildren(df);
1558 endDiaFile(df.hasCaption());
1559 }
1560 }
1561}
1562
1564{
1565 if (m_hide) return;
1566 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1567 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1568 visitChildren(df);
1570}
1571
1573{
1574 if (m_hide) return;
1575 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
1576 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1577 startMermaidFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1578 visitChildren(df);
1580}
1581
1583{
1584 if (m_hide) return;
1585 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1586 visitChildren(lnk);
1587 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1588}
1589
1591{
1592 if (m_hide) return;
1593 // when ref.isSubPage()==true we use ref.file() for HTML and
1594 // ref.anchor() for LaTeX/RTF
1595 if (ref.isSubPage())
1596 {
1597 startLink(ref.ref(),DString(),ref.anchor());
1598 }
1599 else
1600 {
1601 if (!ref.file().empty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1602 }
1603 if (!ref.hasLinkText())
1604 {
1605 filter(ref.targetTitle());
1606 }
1607 visitChildren(ref);
1608 if (ref.isSubPage())
1609 {
1610 endLink(ref.ref(),DString(),ref.anchor());
1611 }
1612 else
1613 {
1614 if (!ref.file().empty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1615 }
1616}
1617
1619{
1620 if (m_hide) return;
1621 m_t << "\\item \\contentsline{section}{";
1622 if (ref.isSubPage())
1623 {
1624 startLink(ref.ref(),DString(),ref.anchor());
1625 }
1626 else
1627 {
1628 if (!ref.file().empty())
1629 {
1630 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1631 }
1632 }
1633 visitChildren(ref);
1634 if (ref.isSubPage())
1635 {
1636 endLink(ref.ref(),DString(),ref.anchor());
1637 }
1638 else
1639 {
1640 if (!ref.file().empty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1641 }
1642 m_t << "}{\\ref{";
1643 if (!ref.file().empty()) m_t << stripPath(ref.file());
1644 if (!ref.file().empty() && !ref.anchor().empty()) m_t << "_";
1645 if (!ref.anchor().empty()) m_t << ref.anchor();
1646 m_t << "}}{}\n";
1647}
1648
1650{
1651 if (m_hide) return;
1652 m_t << "\\footnotesize\n";
1653 m_t << "\\begin{multicols}{2}\n";
1654 m_t << "\\begin{DoxyCompactList}\n";
1656 visitChildren(l);
1658 m_t << "\\end{DoxyCompactList}\n";
1659 m_t << "\\end{multicols}\n";
1660 m_t << "\\normalsize\n";
1661}
1662
1664{
1665 if (m_hide) return;
1666 bool hasInOutSpecs = s.hasInOutSpecifier();
1667 bool hasTypeSpecs = s.hasTypeSpecifier();
1669 switch(s.type())
1670 {
1672 m_t << "\n\\begin{DoxyParams}";
1673 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1674 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1675 m_t << "{";
1677 break;
1679 m_t << "\n\\begin{DoxyRetVals}{";
1681 break;
1683 m_t << "\n\\begin{DoxyExceptions}{";
1685 break;
1687 m_t << "\n\\begin{DoxyTemplParams}{";
1689 break;
1690 default:
1691 ASSERT(0);
1693 }
1694 m_t << "}\n";
1695 visitChildren(s);
1697 switch(s.type())
1698 {
1700 m_t << "\\end{DoxyParams}\n";
1701 break;
1703 m_t << "\\end{DoxyRetVals}\n";
1704 break;
1706 m_t << "\\end{DoxyExceptions}\n";
1707 break;
1709 m_t << "\\end{DoxyTemplParams}\n";
1710 break;
1711 default:
1712 ASSERT(0);
1714 }
1715}
1716
1718{
1719 m_t << " " << sep.chars() << " ";
1720}
1721
1723{
1724 if (m_hide) return;
1726 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1727 if (sect)
1728 {
1729 parentType = sect->type();
1730 }
1731 bool useTable = parentType==DocParamSect::Param ||
1732 parentType==DocParamSect::RetVal ||
1733 parentType==DocParamSect::Exception ||
1734 parentType==DocParamSect::TemplateParam;
1735 if (!useTable)
1736 {
1737 m_t << "\\item[";
1738 }
1739 if (sect && sect->hasInOutSpecifier())
1740 {
1742 {
1743 m_t << "\\doxymbox{\\texttt{";
1744 if (pl.direction()==DocParamSect::In)
1745 {
1746 m_t << "in";
1747 }
1748 else if (pl.direction()==DocParamSect::Out)
1749 {
1750 m_t << "out";
1751 }
1752 else if (pl.direction()==DocParamSect::InOut)
1753 {
1754 m_t << "in,out";
1755 }
1756 m_t << "}} ";
1757 }
1758 if (useTable) m_t << " & ";
1759 }
1760 if (sect && sect->hasTypeSpecifier())
1761 {
1762 for (const auto &type : pl.paramTypes())
1763 {
1764 std::visit(*this,type);
1765 }
1766 if (useTable) m_t << " & ";
1767 }
1768 m_t << "{\\em ";
1769 bool first=true;
1770 for (const auto &param : pl.parameters())
1771 {
1772 if (!first) m_t << ","; else first=false;
1773 m_insideItem=true;
1774 std::visit(*this,param);
1775 m_insideItem=false;
1776 }
1777 m_t << "}";
1778 if (useTable)
1779 {
1780 m_t << " & ";
1781 }
1782 else
1783 {
1784 m_t << "]";
1785 }
1786 for (const auto &par : pl.paragraphs())
1787 {
1788 std::visit(*this,par);
1789 }
1790 if (useTable)
1791 {
1792 m_t << "\\\\\n"
1793 << "\\hline\n";
1794 }
1795}
1796
1798{
1799 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1800 if (m_hide) return;
1801 if (x.title().empty()) return;
1803 m_t << "\\begin{DoxyRefDesc}{";
1804 filter(x.title());
1805 m_t << "}\n";
1806 bool anonymousEnum = x.file()=="@";
1807 m_t << "\\item[";
1808 if (pdfHyperlinks && !anonymousEnum)
1809 {
1810 m_t << "\\doxymbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1811 }
1812 else
1813 {
1814 m_t << "\\textbf{ ";
1815 }
1816 m_insideItem=true;
1817 filter(x.title());
1818 m_insideItem=false;
1819 if (pdfHyperlinks && !anonymousEnum)
1820 {
1821 m_t << "}";
1822 }
1823 m_t << "}]";
1824 visitChildren(x);
1825 if (x.title().empty()) return;
1827 m_t << "\\end{DoxyRefDesc}\n";
1828}
1829
1831{
1832 if (m_hide) return;
1833 startLink(DString(),ref.file(),ref.anchor());
1834 visitChildren(ref);
1835 endLink(DString(),ref.file(),ref.anchor());
1836}
1837
1839{
1840 if (m_hide) return;
1841 visitChildren(t);
1842}
1843
1845{
1846 if (m_hide) return;
1847 m_t << "\\begin{quote}\n";
1849 visitChildren(q);
1850 m_t << "\\end{quote}\n";
1852}
1853
1857
1859{
1860 if (m_hide) return;
1861 visitChildren(pb);
1862}
1863
1864void LatexDocVisitor::filter(const DString &str, const bool retainNewLine, const bool /* citeEntry */)
1865{
1866 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1871 m_lcg.usedTableLevel()>0, // insideTable
1872 false, // keepSpaces
1873 retainNewLine
1874 );
1875}
1876
1877void LatexDocVisitor::startLink(const DString &ref,const DString &file,const DString &anchor,
1878 bool refToTable,bool refToSection)
1879{
1880 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1881 if (ref.empty() && pdfHyperLinks) // internal PDF link
1882 {
1883 if (refToTable)
1884 {
1885 m_t << "\\doxytablelink{";
1886 }
1887 else if (refToSection)
1888 {
1889 if (m_texOrPdf == TexOrPdf::TEX || m_captionTable) m_t << "\\protect";
1890 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1891 }
1892 else
1893 {
1894 if (m_texOrPdf == TexOrPdf::TEX || m_captionTable) m_t << "\\protect";
1895 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1896 }
1897 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1898 {
1899 if (!file.empty()) m_t << stripPath(file);
1900 if (!file.empty() && !anchor.empty()) m_t << "_";
1901 if (!anchor.empty()) m_t << anchor;
1902 m_t << "}";
1903 }
1904 m_t << "{";
1905 }
1906 else if (ref.empty() && refToSection)
1907 {
1908 m_t << "\\doxysectref{";
1909 }
1910 else if (ref.empty() && refToTable)
1911 {
1912 m_t << "\\doxytableref{";
1913 }
1914 else if (ref.empty()) // internal non-PDF link
1915 {
1916 m_t << "\\doxyref{";
1917 }
1918 else // external link
1919 {
1920 m_t << "\\textbf{ ";
1921 }
1922}
1923
1924void LatexDocVisitor::endLink(const DString &ref,const DString &file,const DString &anchor,bool /*refToTable*/,bool refToSection, SectionType sectionType)
1925{
1926 m_t << "}";
1927 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1928 if (ref.empty() && !pdfHyperLinks)
1929 {
1930 m_t << "{";
1932 m_t << "}{" << file;
1933 if (!file.empty() && !anchor.empty()) m_t << "_";
1934 m_t << anchor << "}";
1935 if (refToSection)
1936 {
1937 m_t << "{" << sectionType.level() << "}";
1938 }
1939 }
1940 if (ref.empty() && pdfHyperLinks) // internal PDF link
1941 {
1942 if (refToSection)
1943 {
1944 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1945 }
1946 }
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,".dot");
1958 baseName.prepend("dot_");
1959 DString outDir = Config_getString(LATEX_OUTPUT);
1960 if (newFile) writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine,false);
1961 visitPreStart(m_t,hasCaption, baseName, width, height);
1962}
1963
1964void LatexDocVisitor::endDotFile(bool hasCaption)
1965{
1966 if (m_hide) return;
1967 visitPostEnd(m_t,hasCaption);
1968}
1969
1971 const DString &width,
1972 const DString &height,
1973 bool hasCaption,
1974 const DString &srcFile,
1975 int srcLine, bool newFile
1976 )
1977{
1978 DString baseName=makeBaseName(fileName,".msc");
1979 baseName.prepend("msc_");
1980
1981 DString outDir = Config_getString(LATEX_OUTPUT);
1982 if (newFile) writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine,false);
1983 visitPreStart(m_t,hasCaption, baseName, width, height);
1984}
1985
1986void LatexDocVisitor::endMscFile(bool hasCaption)
1987{
1988 if (m_hide) return;
1989 visitPostEnd(m_t,hasCaption);
1990}
1991
1992
1993void LatexDocVisitor::writeMscFile(const DString &fileName, const DocVerbatim &s, bool newFile)
1994{
1995 DString shortName=makeBaseName(fileName,".msc");
1996 DString outDir = Config_getString(LATEX_OUTPUT);
1997 if (newFile) writeMscGraphFromFile(fileName,outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine(),false);
1998 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
2001}
2002
2004 const DString &width,
2005 const DString &height,
2006 bool hasCaption,
2007 const DString &srcFile,
2008 int srcLine, bool newFile
2009 )
2010{
2011 DString baseName=makeBaseName(fileName,".dia");
2012 baseName.prepend("dia_");
2013
2014 DString outDir = Config_getString(LATEX_OUTPUT);
2015 if (newFile) writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine,false);
2016 visitPreStart(m_t,hasCaption, baseName, width, height);
2017}
2018
2019void LatexDocVisitor::endDiaFile(bool hasCaption)
2020{
2021 if (m_hide) return;
2022 visitPostEnd(m_t,hasCaption);
2023}
2024
2026{
2027 DString shortName = stripPath(baseName);
2028 if (s.useBitmap())
2029 {
2030 if (shortName.find('.')==DString::npos) shortName += ".png";
2031 }
2032 DString outDir = Config_getString(LATEX_OUTPUT);
2035 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2038}
2039
2041 const DString &width,
2042 const DString &height,
2043 bool hasCaption,
2044 const DString &srcFile,
2045 int srcLine
2046 )
2047{
2048 DString outDir = Config_getString(LATEX_OUTPUT);
2049 std::string inBuf;
2050 readInputFile(fileName,inBuf);
2051
2052 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2053 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
2054 outDir,DString(),inBuf,
2056 DString(),srcFile,srcLine,false);
2057 bool first = true;
2058 for (const auto &bName: baseNameVector)
2059 {
2060 DString baseName = makeBaseName(bName,".pu");
2061 DString shortName = stripPath(baseName);
2062 if (useBitmap)
2063 {
2064 if (shortName.find('.')==DString::npos) shortName += ".png";
2065 }
2068 if (!first) endPlantUmlFile(hasCaption);
2069 first = false;
2070 visitPreStart(m_t,hasCaption, shortName, width, height);
2071 }
2072}
2073
2075{
2076 if (m_hide) return;
2077 visitPostEnd(m_t,hasCaption);
2078}
2079
2081{
2082 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2083 auto shortName = stripPath(baseName);
2084 auto outDir = Config_getString(LATEX_OUTPUT);
2085 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
2086 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
2087 auto imgExt = MermaidManager::imageExtension(imageFormat);
2088 if (shortName.find('.')==DString::npos) shortName += "." + imgExt;
2089 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
2090 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2093}
2094
2096 const DString &width,
2097 const DString &height,
2098 bool hasCaption,
2099 const DString &srcFile,
2100 int srcLine
2101 )
2102{
2103 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2104 DString outDir = Config_getString(LATEX_OUTPUT);
2105 std::string inBuf;
2106 readInputFile(fileName,inBuf);
2107 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
2108 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
2109 auto imgExt = MermaidManager::imageExtension(imageFormat);
2111 outDir,DString(),inBuf,imageFormat,
2112 srcFile,srcLine);
2113 auto shortName = stripPath(baseName);
2114 if (shortName.find('.')==DString::npos) shortName += "." + imgExt;
2115 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
2116 visitPreStart(m_t,hasCaption, shortName, width, height);
2117}
2118
2120{
2121 if (m_hide) return;
2122 visitPostEnd(m_t,hasCaption);
2123}
2124
2126{
2127 return std::min(m_indentLevel,maxIndentLevels-1);
2128}
2129
2131{
2132 m_indentLevel++;
2134 {
2135 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2136 }
2137}
2138
2140{
2141 if (m_indentLevel>0)
2142 {
2143 m_indentLevel--;
2144 }
2145}
2146
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:27
int usedTableLevel() const
Definition latexgen.h:65
bool insideTabbing() const
Definition latexgen.h:70
void decUsedTableLevel()
Definition latexgen.h:64
void incUsedTableLevel()
Definition latexgen.h:63
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 const int g_maxLevels
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 const std::array< const char *, g_maxLevels > g_secLabels
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
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:5374
DString getFileNameExtension(const DString &fn)
Definition util.cpp:4211
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:4375
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
Definition util.cpp:4169
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:4620
DString makeBaseName(const DString &name, const DString &ext)
Definition util.cpp:3975
DString stripPath(const DString &s)
Definition util.cpp:3961
SrcLangExt getLanguageFromCodeLang(DString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:4187
A bunch of utility functions.