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