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 const QCString &langExt, int hierarchyLevel)
242 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(FALSE),
244 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
245{
246}
247
248 //--------------------------------------
249 // visitor functions for leaf nodes
250 //--------------------------------------
251
253{
254 if (m_hide) return;
255 filter(w.word());
256}
257
259{
260 if (m_hide) return;
261 startLink(w.ref(),w.file(),w.anchor());
262 filter(w.word());
263 endLink(w.ref(),w.file(),w.anchor());
264}
265
267{
268 if (m_hide) return;
269 if (m_insidePre)
270 {
271 m_t << w.chars();
272 }
273 else
274 {
275 m_t << " ";
276 }
277}
278
280{
281 if (m_hide) return;
282 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
283 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
284 if (res)
285 {
287 {
288 if (pdfHyperlinks)
289 {
290 m_t << "\\texorpdfstring{$<$}{<}";
291 }
292 else
293 {
294 m_t << "$<$";
295 }
296 }
298 {
299 if (pdfHyperlinks)
300 {
301 m_t << "\\texorpdfstring{$>$}{>}";
302 }
303 else
304 {
305 m_t << "$>$";
306 }
307 }
308 else
309 {
310 m_t << res;
311 }
312 }
313 else
314 {
315 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
316 }
317}
318
320{
321 if (m_hide) return;
323 if (!emojiName.isEmpty())
324 {
325 QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
326 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
327 filter(emojiName);
328 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
329 }
330 else
331 {
332 m_t << s.name();
333 }
334}
335
337{
338 if (m_hide) return;
339 if (Config_getBool(PDF_HYPERLINKS))
340 {
341 m_t << "\\href{";
342 if (u.isEmail()) m_t << "mailto:";
343 m_t << latexFilterURL(u.url()) << "}";
344 }
345 m_t << "{\\texttt{";
346 filter(u.url());
347 m_t << "}}";
348}
349
351{
352 if (m_hide) return;
353 if (m_insideItem)
354 {
355 m_t << "\\\\\n";
356 }
357 else
358 {
359 m_t << "~\\newline\n";
360 }
361}
362
364{
365 if (m_hide) return;
366 if (insideTable())
367 m_t << "\\DoxyHorRuler{1}\n";
368 else
369 m_t << "\\DoxyHorRuler{0}\n";
370}
371
373{
374 if (m_hide) return;
375 switch (s.style())
376 {
378 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
379 break;
383 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
384 break;
387 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
388 break;
390 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
391 break;
395 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
396 break;
398 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
399 break;
401 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
402 break;
404 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
405 break;
407 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
408 break;
410 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
411 break;
413 if (s.enable())
414 {
415 m_t << "\n\\begin{DoxyPre}";
417 }
418 else
419 {
421 m_t << "\\end{DoxyPre}\n";
422 }
423 break;
424 case DocStyleChange::Div: /* HTML only */ break;
425 case DocStyleChange::Span: /* HTML only */ break;
426 }
427}
428
430{
431 if (m_hide) return;
432 QCString lang = m_langExt;
433 if (!s.language().isEmpty()) // explicit language setting
434 {
435 lang = s.language();
436 }
437 SrcLangExt langExt = getLanguageFromCodeLang(lang);
438 switch(s.type())
439 {
441 {
442 m_ci.startCodeFragment("DoxyCode");
443 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
444 Config_getBool(STRIP_CODE_COMMENTS),
445 s.isExample(),s.exampleFile());
446 m_ci.endCodeFragment("DoxyCode");
447 }
448 break;
450 filter(s.text(), true);
451 break;
453 m_t << "{\\ttfamily ";
454 filter(s.text(), true);
455 m_t << "}";
456 break;
458 if (isTableNested(s.parent())) // in table
459 {
460 m_t << "\\begin{DoxyCode}{0}";
461 filter(s.text(), true);
462 m_t << "\\end{DoxyCode}\n";
463 }
464 else
465 {
466 m_t << "\\begin{DoxyVerb}";
467 m_t << s.text();
468 m_t << "\\end{DoxyVerb}\n";
469 }
470 break;
476 /* nothing */
477 break;
479 m_t << s.text();
480 break;
481 case DocVerbatim::Dot:
482 {
483 static int dotindex = 1;
484 QCString fileName(4096, QCString::ExplicitSize);
485
486 fileName.sprintf("%s%d%s",
487 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_"),
488 dotindex++,
489 ".dot"
490 );
491 std::ofstream file = Portable::openOutputStream(fileName);
492 if (!file.is_open())
493 {
494 err("Could not open file {} for writing\n",fileName);
495 }
496 else
497 {
498 file.write( s.text().data(), s.text().length() );
499 file.close();
500
501 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine());
502 visitChildren(s);
504
505 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
506 }
507 }
508 break;
509 case DocVerbatim::Msc:
510 {
511 static int mscindex = 1;
512 QCString baseName(4096, QCString::ExplicitSize);
513
514 baseName.sprintf("%s%d",
515 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_"),
516 mscindex++
517 );
518 QCString fileName = baseName+".msc";
519 std::ofstream file = Portable::openOutputStream(fileName);
520 if (!file.is_open())
521 {
522 err("Could not open file {} for writing\n",fileName);
523 }
524 else
525 {
526 QCString text = "msc {";
527 text+=s.text();
528 text+="}";
529 file.write( text.data(), text.length() );
530 file.close();
531
532 writeMscFile(baseName, s);
533
534 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
535 }
536 }
537 break;
539 {
540 QCString latexOutput = Config_getString(LATEX_OUTPUT);
541 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
542 latexOutput,s.exampleFile(),s.text(),
544 s.engine(),s.srcFile(),s.srcLine(),true);
545
546 for (const auto &baseName: baseNameVector)
547 {
548 writePlantUMLFile(baseName, s);
549 }
550 }
551 break;
552 }
553}
554
556{
557 if (m_hide) return;
558 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
559 if (!anc.file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
560 {
561 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
562 << "}%\n";
563 }
564}
565
567{
568 if (m_hide) return;
570 switch(inc.type())
571 {
573 {
574 m_ci.startCodeFragment("DoxyCodeInclude");
575 FileInfo cfi( inc.file().str() );
576 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
578 inc.text(),
579 langExt,
580 inc.stripCodeComments(),
581 inc.isExample(),
582 inc.exampleFile(),
583 fd.get(), // fileDef,
584 -1, // start line
585 -1, // end line
586 FALSE, // inline fragment
587 nullptr, // memberDef
588 TRUE // show line numbers
589 );
590 m_ci.endCodeFragment("DoxyCodeInclude");
591 }
592 break;
594 {
595 m_ci.startCodeFragment("DoxyCodeInclude");
597 inc.text(),langExt,
598 inc.stripCodeComments(),
599 inc.isExample(),
600 inc.exampleFile(),
601 nullptr, // fileDef
602 -1, // startLine
603 -1, // endLine
604 TRUE, // inlineFragment
605 nullptr, // memberDef
606 FALSE
607 );
608 m_ci.endCodeFragment("DoxyCodeInclude");
609 }
610 break;
618 break;
620 m_t << inc.text();
621 break;
623 if (isTableNested(inc.parent())) // in table
624 {
625 m_t << "\\begin{DoxyCode}{0}";
626 filter(inc.text(), true);
627 m_t << "\\end{DoxyCode}\n";
628 }
629 else
630 {
631 m_t << "\n\\begin{DoxyVerbInclude}\n";
632 m_t << inc.text();
633 m_t << "\\end{DoxyVerbInclude}\n";
634 }
635 break;
638 {
639 m_ci.startCodeFragment("DoxyCodeInclude");
641 inc.file(),
642 inc.blockId(),
643 inc.context(),
645 inc.trimLeft(),
647 );
648 m_ci.endCodeFragment("DoxyCodeInclude");
649 }
650 break;
651 }
652}
653
655{
656 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
657 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
658 if (op.isFirst())
659 {
660 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
662 m_hide = TRUE;
663 }
665 if (locLangExt.isEmpty()) locLangExt = m_langExt;
666 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
667 if (op.type()!=DocIncOperator::Skip)
668 {
669 m_hide = popHidden();
670 if (!m_hide)
671 {
672 std::unique_ptr<FileDef> fd;
673 if (!op.includeFileName().isEmpty())
674 {
675 FileInfo cfi( op.includeFileName().str() );
676 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
677 }
678
679 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
681 op.isExample(),op.exampleFile(),
682 fd.get(), // fileDef
683 op.line(), // startLine
684 -1, // endLine
685 FALSE, // inline fragment
686 nullptr, // memberDef
687 op.showLineNo() // show line numbers
688 );
689 }
691 m_hide=TRUE;
692 }
693 if (op.isLast())
694 {
696 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
697 }
698 else
699 {
700 if (!m_hide) m_t << "\n";
701 }
702}
703
705{
706 if (m_hide) return;
707 QCString s = f.text();
708 const char *p = s.data();
709 char c = 0;
710 if (p)
711 {
712 while ((c=*p++))
713 {
714 switch (c)
715 {
716 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
717 default: m_t << c; break;
718 }
719 }
720 }
721}
722
724{
725 if (m_hide) return;
726 m_t << "\\index{";
728 m_t << "@{";
730 m_t << "}}";
731}
732
736
738{
739 if (m_hide) return;
740 auto opt = cite.option();
741 QCString txt;
742 if (opt.noCite())
743 {
744 if (!cite.file().isEmpty())
745 {
746 txt = cite.getText();
747 }
748 else
749 {
750 if (!opt.noPar()) txt += "[";
751 txt += cite.target();
752 if (!opt.noPar()) txt += "]";
753 }
754 m_t << "{\\bfseries ";
755 filter(txt);
756 m_t << "}";
757 }
758 else
759 {
760 if (!cite.file().isEmpty())
761 {
762 QCString anchor = cite.anchor();
764 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
765
766 txt = "\\DoxyCite{" + anchor + "}";
767 if (opt.isNumber())
768 {
769 txt += "{number}";
770 }
771 else if (opt.isShortAuthor())
772 {
773 txt += "{shortauthor}";
774 }
775 else if (opt.isYear())
776 {
777 txt += "{year}";
778 }
779 if (!opt.noPar()) txt += "{1}";
780 else txt += "{0}";
781
782 m_t << txt;
783 }
784 else
785 {
786 if (!opt.noPar()) txt += "[";
787 txt += cite.target();
788 if (!opt.noPar()) txt += "]";
789 m_t << "{\\bfseries ";
790 filter(txt);
791 m_t << "}";
792 }
793 }
794}
795
796//--------------------------------------
797// visitor functions for compound nodes
798//--------------------------------------
799
801{
802 if (m_hide) return;
803 if (m_indentLevel>=maxIndentLevels-1) return;
804 if (l.isEnumList())
805 {
806 m_t << "\n\\begin{DoxyEnumerate}";
807 m_listItemInfo[indentLevel()].isEnum = true;
808 }
809 else
810 {
811 m_listItemInfo[indentLevel()].isEnum = false;
812 m_t << "\n\\begin{DoxyItemize}";
813 }
814 visitChildren(l);
815 if (l.isEnumList())
816 {
817 m_t << "\n\\end{DoxyEnumerate}";
818 }
819 else
820 {
821 m_t << "\n\\end{DoxyItemize}";
822 }
823}
824
826{
827 if (m_hide) return;
828 switch (li.itemNumber())
829 {
830 case DocAutoList::Unchecked: // unchecked
831 m_t << "\n\\item[\\DoxyUnchecked] ";
832 break;
833 case DocAutoList::Checked_x: // checked with x
834 case DocAutoList::Checked_X: // checked with X
835 m_t << "\n\\item[\\DoxyChecked] ";
836 break;
837 default:
838 m_t << "\n\\item ";
839 break;
840 }
842 visitChildren(li);
844}
845
847{
848 if (m_hide) return;
849 visitChildren(p);
850 if (!p.isLast() && // omit <p> for last paragraph
851 !(p.parent() && // and for parameter sections
852 std::get_if<DocParamSect>(p.parent())
853 )
854 )
855 {
856 if (insideTable())
857 {
858 m_t << "~\\newline\n";
859 }
860 else
861 {
862 m_t << "\n\n";
863 }
864 }
865}
866
868{
869 visitChildren(r);
870}
871
873{
874 if (m_hide) return;
875 switch(s.type())
876 {
878 m_t << "\\begin{DoxySeeAlso}{";
879 filter(theTranslator->trSeeAlso());
880 break;
882 m_t << "\\begin{DoxyReturn}{";
883 filter(theTranslator->trReturns());
884 break;
886 m_t << "\\begin{DoxyAuthor}{";
887 filter(theTranslator->trAuthor(TRUE,TRUE));
888 break;
890 m_t << "\\begin{DoxyAuthor}{";
891 filter(theTranslator->trAuthor(TRUE,FALSE));
892 break;
894 m_t << "\\begin{DoxyVersion}{";
895 filter(theTranslator->trVersion());
896 break;
898 m_t << "\\begin{DoxySince}{";
899 filter(theTranslator->trSince());
900 break;
902 m_t << "\\begin{DoxyDate}{";
903 filter(theTranslator->trDate());
904 break;
906 m_t << "\\begin{DoxyNote}{";
907 filter(theTranslator->trNote());
908 break;
910 m_t << "\\begin{DoxyWarning}{";
911 filter(theTranslator->trWarning());
912 break;
914 m_t << "\\begin{DoxyPrecond}{";
915 filter(theTranslator->trPrecondition());
916 break;
918 m_t << "\\begin{DoxyPostcond}{";
919 filter(theTranslator->trPostcondition());
920 break;
922 m_t << "\\begin{DoxyCopyright}{";
923 filter(theTranslator->trCopyright());
924 break;
926 m_t << "\\begin{DoxyInvariant}{";
927 filter(theTranslator->trInvariant());
928 break;
930 m_t << "\\begin{DoxyRemark}{";
931 filter(theTranslator->trRemarks());
932 break;
934 m_t << "\\begin{DoxyAttention}{";
935 filter(theTranslator->trAttention());
936 break;
938 m_t << "\\begin{DoxyImportant}{";
939 filter(theTranslator->trImportant());
940 break;
942 m_t << "\\begin{DoxyParagraph}{";
943 break;
945 m_t << "\\begin{DoxyParagraph}{";
946 break;
947 case DocSimpleSect::Unknown: break;
948 }
949
950 if (s.title())
951 {
953 std::visit(*this,*s.title());
955 }
956 m_t << "}\n";
958 visitChildren(s);
959 switch(s.type())
960 {
962 m_t << "\n\\end{DoxySeeAlso}\n";
963 break;
965 m_t << "\n\\end{DoxyReturn}\n";
966 break;
968 m_t << "\n\\end{DoxyAuthor}\n";
969 break;
971 m_t << "\n\\end{DoxyAuthor}\n";
972 break;
974 m_t << "\n\\end{DoxyVersion}\n";
975 break;
977 m_t << "\n\\end{DoxySince}\n";
978 break;
980 m_t << "\n\\end{DoxyDate}\n";
981 break;
983 m_t << "\n\\end{DoxyNote}\n";
984 break;
986 m_t << "\n\\end{DoxyWarning}\n";
987 break;
989 m_t << "\n\\end{DoxyPrecond}\n";
990 break;
992 m_t << "\n\\end{DoxyPostcond}\n";
993 break;
995 m_t << "\n\\end{DoxyCopyright}\n";
996 break;
998 m_t << "\n\\end{DoxyInvariant}\n";
999 break;
1001 m_t << "\n\\end{DoxyRemark}\n";
1002 break;
1004 m_t << "\n\\end{DoxyAttention}\n";
1005 break;
1007 m_t << "\n\\end{DoxyImportant}\n";
1008 break;
1010 m_t << "\n\\end{DoxyParagraph}\n";
1011 break;
1012 case DocSimpleSect::Rcs:
1013 m_t << "\n\\end{DoxyParagraph}\n";
1014 break;
1015 default:
1016 break;
1017 }
1019}
1020
1022{
1023 if (m_hide) return;
1024 visitChildren(t);
1025}
1026
1028{
1029 if (m_hide) return;
1030 m_t << "\\begin{DoxyItemize}\n";
1031 m_listItemInfo[indentLevel()].isEnum = false;
1032 visitChildren(l);
1033 m_t << "\\end{DoxyItemize}\n";
1034}
1035
1037{
1038 if (m_hide) return;
1039 m_t << "\\item ";
1041 if (li.paragraph())
1042 {
1043 visit(*this,*li.paragraph());
1044 }
1046}
1047
1049{
1050 if (m_hide) return;
1051 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1052 if (pdfHyperlinks)
1053 {
1054 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1055 }
1056 m_t << "\\" << getSectionName(s.level()) << "{";
1057 if (pdfHyperlinks)
1058 {
1059 m_t << "\\texorpdfstring{";
1060 }
1061 if (s.title())
1062 {
1063 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1064 std::visit(*this,*s.title());
1066 }
1067 if (pdfHyperlinks)
1068 {
1069 m_t << "}{";
1070 if (s.title())
1071 {
1072 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1073 std::visit(*this,*s.title());
1075 }
1076 m_t << "}";
1077 }
1078 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1079 visitChildren(s);
1080}
1081
1083{
1084 if (m_hide) return;
1085 if (m_indentLevel>=maxIndentLevels-1) return;
1087 if (s.type()==DocHtmlList::Ordered)
1088 {
1089 bool first = true;
1090 m_t << "\n\\begin{DoxyEnumerate}";
1091 for (const auto &opt : s.attribs())
1092 {
1093 if (opt.name=="type")
1094 {
1095 if (opt.value=="1")
1096 {
1097 m_t << (first ? "[": ",");
1098 m_t << "label=\\arabic*";
1099 first = false;
1100 }
1101 else if (opt.value=="a")
1102 {
1103 m_t << (first ? "[": ",");
1104 m_t << "label=\\enumalphalphcnt*";
1105 first = false;
1106 }
1107 else if (opt.value=="A")
1108 {
1109 m_t << (first ? "[": ",");
1110 m_t << "label=\\enumAlphAlphcnt*";
1111 first = false;
1112 }
1113 else if (opt.value=="i")
1114 {
1115 m_t << (first ? "[": ",");
1116 m_t << "label=\\roman*";
1117 first = false;
1118 }
1119 else if (opt.value=="I")
1120 {
1121 m_t << (first ? "[": ",");
1122 m_t << "label=\\Roman*";
1123 first = false;
1124 }
1125 }
1126 else if (opt.name=="start")
1127 {
1128 m_t << (first ? "[": ",");
1129 bool ok = false;
1130 int val = opt.value.toInt(&ok);
1131 if (ok) m_t << "start=" << val;
1132 first = false;
1133 }
1134 }
1135 if (!first) m_t << "]\n";
1136 }
1137 else
1138 {
1139 m_t << "\n\\begin{DoxyItemize}";
1140 }
1141 visitChildren(s);
1142 if (m_indentLevel>=maxIndentLevels-1) return;
1143 if (s.type()==DocHtmlList::Ordered)
1144 m_t << "\n\\end{DoxyEnumerate}";
1145 else
1146 m_t << "\n\\end{DoxyItemize}";
1147}
1148
1150{
1151 if (m_hide) return;
1152 if (m_listItemInfo[indentLevel()].isEnum)
1153 {
1154 for (const auto &opt : l.attribs())
1155 {
1156 if (opt.name=="value")
1157 {
1158 bool ok = false;
1159 int val = opt.value.toInt(&ok);
1160 if (ok)
1161 {
1162 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1163 }
1164 }
1165 }
1166 }
1167 m_t << "\n\\item ";
1169 visitChildren(l);
1171}
1172
1173
1175{
1176 HtmlAttribList attrs = dl.attribs();
1177 auto it = std::find_if(attrs.begin(),attrs.end(),
1178 [](const auto &att) { return att.name=="class"; });
1179 if (it!=attrs.end() && it->value == "reflist") return true;
1180 return false;
1181}
1182
1183static bool listIsNested(const DocHtmlDescList &dl)
1184{
1185 bool isNested=false;
1186 const DocNodeVariant *n = dl.parent();
1187 while (n && !isNested)
1188 {
1189 if (std::get_if<DocHtmlDescList>(n))
1190 {
1191 isNested = !classEqualsReflist(std::get<DocHtmlDescList>(*n));
1192 }
1193 n = ::parent(n);
1194 }
1195 return isNested;
1196}
1197
1199{
1200 if (m_hide) return;
1201 bool eq = classEqualsReflist(dl);
1202 if (eq)
1203 {
1204 m_t << "\n\\begin{DoxyRefList}";
1205 }
1206 else
1207 {
1208 if (listIsNested(dl)) m_t << "\n\\hfill";
1209 m_t << "\n\\begin{DoxyDescription}";
1210 }
1211 visitChildren(dl);
1212 if (eq)
1213 {
1214 m_t << "\n\\end{DoxyRefList}";
1215 }
1216 else
1217 {
1218 m_t << "\n\\end{DoxyDescription}";
1219 }
1220}
1221
1223{
1224 if (m_hide) return;
1225 m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
1227 visitChildren(dt);
1229 m_t << "}}]";
1230}
1231
1233{
1235 if (!m_insideItem) m_t << "\\hfill";
1236 m_t << " \\\\\n";
1237 visitChildren(dd);
1239}
1240
1242{
1243 bool isNested=m_lcg.usedTableLevel()>0;
1244 while (n && !isNested)
1245 {
1247 n = ::parent(n);
1248 }
1249 return isNested;
1250}
1251
1253{
1254 if (isTableNested(n))
1255 {
1256 m_t << "\\begin{DoxyTableNested}{" << cols << "}";
1257 }
1258 else
1259 {
1260 m_t << "\n\\begin{DoxyTable}{" << cols << "}";
1261 }
1262}
1263
1265{
1266 if (isTableNested(n))
1267 {
1268 m_t << "\\end{DoxyTableNested}\n";
1269 }
1270 else
1271 {
1272 m_t << "\\end{DoxyTable}\n";
1273 }
1274}
1275
1277{
1278 if (m_hide) return;
1280 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1281 if (c)
1282 {
1283 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1284 if (!c->file().isEmpty() && pdfHyperLinks)
1285 {
1286 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1287 << "}{}";
1288 }
1289 m_t << "\n";
1290 }
1291
1293 if (!isTableNested(t.parent()))
1294 {
1295 // write caption
1296 m_t << "{";
1297 if (c)
1298 {
1299 std::visit(*this, *t.caption());
1300 }
1301 m_t << "}";
1302 // write label
1303 m_t << "{";
1304 if (c && (!stripPath(c->file()).isEmpty() || !c->anchor().isEmpty()))
1305 {
1306 m_t << stripPath(c->file()) << "_" << c->anchor();
1307 }
1308 m_t << "}";
1309 }
1310
1311 // write head row(s)
1312 m_t << "{" << t.numberHeaderRows() << "}\n";
1313
1315
1316 visitChildren(t);
1318 popTableState();
1319}
1320
1322{
1323 if (m_hide) return;
1324 visitChildren(c);
1325}
1326
1328{
1329 if (m_hide) return;
1331
1332 visitChildren(row);
1333
1334 m_t << "\\\\";
1335
1336 size_t col = 1;
1337 for (auto &span : rowSpans())
1338 {
1339 if (span.rowSpan>0) span.rowSpan--;
1340 if (span.rowSpan<=0)
1341 {
1342 // inactive span
1343 }
1344 else if (span.column>col)
1345 {
1346 col = span.column+span.colSpan;
1347 }
1348 else
1349 {
1350 col = span.column+span.colSpan;
1351 }
1352 }
1353
1354 m_t << "\n";
1355}
1356
1358{
1359 if (m_hide) return;
1360 //printf("Cell(r=%u,c=%u) rowSpan=%d colSpan=%d currentColumn()=%zu\n",c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),currentColumn());
1361
1363
1364 QCString cellOpts;
1365 QCString cellSpec;
1366 auto appendOpt = [&cellOpts](const QCString &s)
1367 {
1368 if (!cellOpts.isEmpty()) cellOpts+=",";
1369 cellOpts+=s;
1370 };
1371 auto appendSpec = [&cellSpec](const QCString &s)
1372 {
1373 if (!cellSpec.isEmpty()) cellSpec+=",";
1374 cellSpec+=s;
1375 };
1376 auto writeCell = [this,&cellOpts,&cellSpec]()
1377 {
1378 if (!cellOpts.isEmpty() || !cellSpec.isEmpty())
1379 {
1380 m_t << "\\SetCell";
1381 if (!cellOpts.isEmpty())
1382 {
1383 m_t << "[" << cellOpts << "]";
1384 }
1385 m_t << "{" << cellSpec << "}";
1386 }
1387 };
1388
1389 // skip over columns that have a row span starting at an earlier row
1390 for (const auto &span : rowSpans())
1391 {
1392 //printf("span(r=%u,c=%u): column=%zu colSpan=%zu,rowSpan=%zu currentColumn()=%zu\n",
1393 // span.cell.rowIndex(),span.cell.columnIndex(),
1394 // span.column,span.colSpan,span.rowSpan,
1395 // currentColumn());
1396 if (span.rowSpan>0 && span.column==currentColumn())
1397 {
1398 setCurrentColumn(currentColumn()+span.colSpan);
1399 for (size_t i=0;i<span.colSpan;i++)
1400 {
1401 m_t << "&";
1402 }
1403 }
1404 }
1405
1406 int cs = c.colSpan();
1407 int ha = c.alignment();
1408 int rs = c.rowSpan();
1409 int va = c.valignment();
1410
1411 switch (ha) // horizontal alignment
1412 {
1413 case DocHtmlCell::Right:
1414 appendSpec("r");
1415 break;
1417 appendSpec("c");
1418 break;
1419 default:
1420 // default
1421 break;
1422 }
1423 if (rs>0) // row span
1424 {
1425 appendOpt("r="+QCString().setNum(rs));
1426 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%zu\n",
1427 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1428 // currentColumn());
1430 }
1431 if (cs>1) // column span
1432 {
1433 // update column to the end of the span, needs to be done *after* calling addRowSpan()
1435 appendOpt("c="+QCString().setNum(cs));
1436 }
1437 if (c.isHeading())
1438 {
1439 appendSpec("bg=\\tableheadbgcolor");
1440 appendSpec("font=\\bfseries");
1441 }
1442 switch(va) // vertical alignment
1443 {
1444 case DocHtmlCell::Top:
1445 appendSpec("h");
1446 break;
1448 appendSpec("f");
1449 break;
1451 // default
1452 break;
1453 }
1454 writeCell();
1455
1456 visitChildren(c);
1457
1458 for (int i=0;i<cs-1;i++)
1459 {
1460 m_t << "&"; // placeholder for invisible cell
1461 }
1462
1463 if (!c.isLast()) m_t << "&";
1464}
1465
1467{
1468 if (m_hide) return;
1469 visitChildren(i);
1470}
1471
1473{
1474 if (m_hide) return;
1475 if (Config_getBool(PDF_HYPERLINKS))
1476 {
1477 m_t << "\\href{";
1478 m_t << latexFilterURL(href.url());
1479 m_t << "}";
1480 }
1481 m_t << "{\\texttt{";
1482 visitChildren(href);
1483 m_t << "}}";
1484}
1485
1487{
1488 if (m_hide) return;
1489 m_t << "{\\bfseries{";
1490 visitChildren(d);
1491 m_t << "}}";
1492}
1493
1495{
1496 if (m_hide) return;
1497 m_t << "\n\n";
1498 auto summary = d.summary();
1499 if (summary)
1500 {
1501 std::visit(*this,*summary);
1502 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1503 }
1504 visitChildren(d);
1505 if (summary)
1506 {
1507 m_t << "\\end{adjustwidth}\n";
1508 }
1509 else
1510 {
1511 m_t << "\n\n";
1512 }
1513}
1514
1516{
1517 if (m_hide) return;
1518 m_t << "\\" << getSectionName(header.level()) << "*{";
1519 visitChildren(header);
1520 m_t << "}";
1521}
1522
1524{
1525 if (img.type()==DocImage::Latex)
1526 {
1527 if (m_hide) return;
1528 QCString gfxName = img.name();
1529 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1530 {
1531 gfxName=gfxName.left(gfxName.length()-4);
1532 }
1533
1534 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1535 visitChildren(img);
1537 }
1538 else // other format -> skip
1539 {
1540 }
1541}
1542
1544{
1545 if (m_hide) return;
1546 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1547 startDotFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1548 visitChildren(df);
1549 endDotFile(df.hasCaption());
1550}
1551
1553{
1554 if (m_hide) return;
1555 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1556 startMscFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1557 visitChildren(df);
1558 endMscFile(df.hasCaption());
1559}
1560
1562{
1563 if (m_hide) return;
1564 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1565 startDiaFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1566 visitChildren(df);
1567 endDiaFile(df.hasCaption());
1568}
1569
1571{
1572 if (m_hide) return;
1573 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1574 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1575 visitChildren(df);
1577}
1578
1580{
1581 if (m_hide) return;
1582 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1583 visitChildren(lnk);
1584 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1585}
1586
1588{
1589 if (m_hide) return;
1590 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1591 // ref.anchor() for LaTeX/RTF
1592 if (ref.isSubPage())
1593 {
1594 startLink(ref.ref(),QCString(),ref.anchor());
1595 }
1596 else
1597 {
1598 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1599 }
1600 if (!ref.hasLinkText())
1601 {
1602 filter(ref.targetTitle());
1603 }
1604 visitChildren(ref);
1605 if (ref.isSubPage())
1606 {
1607 endLink(ref.ref(),QCString(),ref.anchor());
1608 }
1609 else
1610 {
1611 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1612 }
1613}
1614
1616{
1617 if (m_hide) return;
1618 m_t << "\\item \\contentsline{section}{";
1619 if (ref.isSubPage())
1620 {
1621 startLink(ref.ref(),QCString(),ref.anchor());
1622 }
1623 else
1624 {
1625 if (!ref.file().isEmpty())
1626 {
1627 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1628 }
1629 }
1630 visitChildren(ref);
1631 if (ref.isSubPage())
1632 {
1633 endLink(ref.ref(),QCString(),ref.anchor());
1634 }
1635 else
1636 {
1637 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1638 }
1639 m_t << "}{\\ref{";
1640 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1641 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1642 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1643 m_t << "}}{}\n";
1644}
1645
1647{
1648 if (m_hide) return;
1649 m_t << "\\footnotesize\n";
1650 m_t << "\\begin{multicols}{2}\n";
1651 m_t << "\\begin{DoxyCompactList}\n";
1653 visitChildren(l);
1655 m_t << "\\end{DoxyCompactList}\n";
1656 m_t << "\\end{multicols}\n";
1657 m_t << "\\normalsize\n";
1658}
1659
1661{
1662 if (m_hide) return;
1663 bool hasInOutSpecs = s.hasInOutSpecifier();
1664 bool hasTypeSpecs = s.hasTypeSpecifier();
1665 m_lcg.incUsedTableLevel();
1666 switch(s.type())
1667 {
1669 m_t << "\n\\begin{DoxyParams}";
1670 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1671 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1672 m_t << "{";
1673 filter(theTranslator->trParameters());
1674 break;
1676 m_t << "\n\\begin{DoxyRetVals}{";
1677 filter(theTranslator->trReturnValues());
1678 break;
1680 m_t << "\n\\begin{DoxyExceptions}{";
1681 filter(theTranslator->trExceptions());
1682 break;
1684 m_t << "\n\\begin{DoxyTemplParams}{";
1685 filter(theTranslator->trTemplateParameters());
1686 break;
1687 default:
1688 ASSERT(0);
1690 }
1691 m_t << "}\n";
1692 visitChildren(s);
1693 m_lcg.decUsedTableLevel();
1694 switch(s.type())
1695 {
1697 m_t << "\\end{DoxyParams}\n";
1698 break;
1700 m_t << "\\end{DoxyRetVals}\n";
1701 break;
1703 m_t << "\\end{DoxyExceptions}\n";
1704 break;
1706 m_t << "\\end{DoxyTemplParams}\n";
1707 break;
1708 default:
1709 ASSERT(0);
1711 }
1712}
1713
1715{
1716 m_t << " " << sep.chars() << " ";
1717}
1718
1720{
1721 if (m_hide) return;
1723 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1724 if (sect)
1725 {
1726 parentType = sect->type();
1727 }
1728 bool useTable = parentType==DocParamSect::Param ||
1729 parentType==DocParamSect::RetVal ||
1730 parentType==DocParamSect::Exception ||
1731 parentType==DocParamSect::TemplateParam;
1732 if (!useTable)
1733 {
1734 m_t << "\\item[";
1735 }
1736 if (sect && sect->hasInOutSpecifier())
1737 {
1739 {
1740 m_t << "\\mbox{\\texttt{";
1741 if (pl.direction()==DocParamSect::In)
1742 {
1743 m_t << "in";
1744 }
1745 else if (pl.direction()==DocParamSect::Out)
1746 {
1747 m_t << "out";
1748 }
1749 else if (pl.direction()==DocParamSect::InOut)
1750 {
1751 m_t << "in,out";
1752 }
1753 m_t << "}} ";
1754 }
1755 if (useTable) m_t << " & ";
1756 }
1757 if (sect && sect->hasTypeSpecifier())
1758 {
1759 for (const auto &type : pl.paramTypes())
1760 {
1761 std::visit(*this,type);
1762 }
1763 if (useTable) m_t << " & ";
1764 }
1765 m_t << "{\\em ";
1766 bool first=TRUE;
1767 for (const auto &param : pl.parameters())
1768 {
1769 if (!first) m_t << ","; else first=FALSE;
1771 std::visit(*this,param);
1773 }
1774 m_t << "}";
1775 if (useTable)
1776 {
1777 m_t << " & ";
1778 }
1779 else
1780 {
1781 m_t << "]";
1782 }
1783 for (const auto &par : pl.paragraphs())
1784 {
1785 std::visit(*this,par);
1786 }
1787 if (useTable)
1788 {
1789 m_t << "\\\\\n"
1790 << "\\hline\n";
1791 }
1792}
1793
1795{
1796 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1797 if (m_hide) return;
1798 if (x.title().isEmpty()) return;
1800 m_t << "\\begin{DoxyRefDesc}{";
1801 filter(x.title());
1802 m_t << "}\n";
1803 bool anonymousEnum = x.file()=="@";
1804 m_t << "\\item[";
1805 if (pdfHyperlinks && !anonymousEnum)
1806 {
1807 m_t << "\\mbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1808 }
1809 else
1810 {
1811 m_t << "\\textbf{ ";
1812 }
1814 filter(x.title());
1816 if (pdfHyperlinks && !anonymousEnum)
1817 {
1818 m_t << "}";
1819 }
1820 m_t << "}]";
1821 visitChildren(x);
1822 if (x.title().isEmpty()) return;
1824 m_t << "\\end{DoxyRefDesc}\n";
1825}
1826
1828{
1829 if (m_hide) return;
1830 startLink(QCString(),ref.file(),ref.anchor());
1831 visitChildren(ref);
1832 endLink(QCString(),ref.file(),ref.anchor());
1833}
1834
1836{
1837 if (m_hide) return;
1838 visitChildren(t);
1839}
1840
1842{
1843 if (m_hide) return;
1844 m_t << "\\begin{quote}\n";
1846 visitChildren(q);
1847 m_t << "\\end{quote}\n";
1849}
1850
1854
1856{
1857 if (m_hide) return;
1858 visitChildren(pb);
1859}
1860
1861void LatexDocVisitor::filter(const QCString &str, const bool retainNewLine)
1862{
1863 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1865 m_lcg.insideTabbing(),
1868 m_lcg.usedTableLevel()>0, // insideTable
1869 false, // keepSpaces
1870 retainNewLine
1871 );
1872}
1873
1874void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,
1875 bool refToTable,bool refToSection)
1876{
1877 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1878 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1879 {
1880 if (refToTable)
1881 {
1882 m_t << "\\doxytablelink{";
1883 }
1884 else if (refToSection)
1885 {
1886 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1887 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1888 }
1889 else
1890 {
1891 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1892 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1893 }
1894 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1895 {
1896 if (!file.isEmpty()) m_t << stripPath(file);
1897 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1898 if (!anchor.isEmpty()) m_t << anchor;
1899 m_t << "}";
1900 }
1901 m_t << "{";
1902 }
1903 else if (ref.isEmpty() && refToSection)
1904 {
1905 m_t << "\\doxysectref{";
1906 }
1907 else if (ref.isEmpty() && refToTable)
1908 {
1909 m_t << "\\doxytableref{";
1910 }
1911 else if (ref.isEmpty()) // internal non-PDF link
1912 {
1913 m_t << "\\doxyref{";
1914 }
1915 else // external link
1916 {
1917 m_t << "\\textbf{ ";
1918 }
1919}
1920
1921void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool /*refToTable*/,bool refToSection, SectionType sectionType)
1922{
1923 m_t << "}";
1924 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1925 if (ref.isEmpty() && !pdfHyperLinks)
1926 {
1927 m_t << "{";
1928 filter(theTranslator->trPageAbbreviation());
1929 m_t << "}{" << file;
1930 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1931 m_t << anchor << "}";
1932 if (refToSection)
1933 {
1934 m_t << "{" << sectionType.level() << "}";
1935 }
1936 }
1937 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1938 {
1939 if (refToSection)
1940 {
1941 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1942 }
1943 }
1944}
1945
1947 const QCString &width,
1948 const QCString &height,
1949 bool hasCaption,
1950 const QCString &srcFile,
1951 int srcLine
1952 )
1953{
1954 QCString baseName=makeBaseName(fileName);
1955 baseName.prepend("dot_");
1956 QCString outDir = Config_getString(LATEX_OUTPUT);
1957 QCString name = fileName;
1958 writeDotGraphFromFile(name,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
1959 visitPreStart(m_t,hasCaption, baseName, width, height);
1960}
1961
1962void LatexDocVisitor::endDotFile(bool hasCaption)
1963{
1964 if (m_hide) return;
1965 visitPostEnd(m_t,hasCaption);
1966}
1967
1969 const QCString &width,
1970 const QCString &height,
1971 bool hasCaption,
1972 const QCString &srcFile,
1973 int srcLine
1974 )
1975{
1976 QCString baseName=makeBaseName(fileName);
1977 baseName.prepend("msc_");
1978
1979 QCString outDir = Config_getString(LATEX_OUTPUT);
1980 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
1981 visitPreStart(m_t,hasCaption, baseName, width, height);
1982}
1983
1984void LatexDocVisitor::endMscFile(bool hasCaption)
1985{
1986 if (m_hide) return;
1987 visitPostEnd(m_t,hasCaption);
1988}
1989
1990
1992{
1993 QCString shortName = makeShortName(baseName);
1994 QCString outDir = Config_getString(LATEX_OUTPUT);
1995 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
1996 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
1999}
2000
2001
2003 const QCString &width,
2004 const QCString &height,
2005 bool hasCaption,
2006 const QCString &srcFile,
2007 int srcLine
2008 )
2009{
2010 QCString baseName=makeBaseName(fileName);
2011 baseName.prepend("dia_");
2012
2013 QCString outDir = Config_getString(LATEX_OUTPUT);
2014 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
2015 visitPreStart(m_t,hasCaption, baseName, width, height);
2016}
2017
2018void LatexDocVisitor::endDiaFile(bool hasCaption)
2019{
2020 if (m_hide) return;
2021 visitPostEnd(m_t,hasCaption);
2022}
2023
2025{
2026 QCString shortName = makeShortName(baseName);
2027 if (s.useBitmap())
2028 {
2029 if (shortName.find('.')==-1) shortName += ".png";
2030 }
2031 QCString outDir = Config_getString(LATEX_OUTPUT);
2034 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2037}
2038
2040 const QCString &width,
2041 const QCString &height,
2042 bool hasCaption,
2043 const QCString &srcFile,
2044 int srcLine
2045 )
2046{
2047 QCString outDir = Config_getString(LATEX_OUTPUT);
2048 std::string inBuf;
2049 readInputFile(fileName,inBuf);
2050
2051 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2052 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
2053 outDir,QCString(),inBuf,
2055 QCString(),srcFile,srcLine,false);
2056 bool first = true;
2057 for (const auto &bName: baseNameVector)
2058 {
2059 QCString baseName = makeBaseName(bName);
2060 QCString shortName = makeShortName(baseName);
2061 if (useBitmap)
2062 {
2063 if (shortName.find('.')==-1) shortName += ".png";
2064 }
2067 if (!first) endPlantUmlFile(hasCaption);
2068 first = false;
2069 visitPreStart(m_t,hasCaption, shortName, width, height);
2070 }
2071}
2072
2074{
2075 if (m_hide) return;
2076 visitPostEnd(m_t,hasCaption);
2077}
2078
2080{
2081 return std::min(m_indentLevel,maxIndentLevels-1);
2082}
2083
2085{
2086 m_indentLevel++;
2088 {
2089 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2090 }
2091}
2092
2094{
2095 if (m_indentLevel>0)
2096 {
2097 m_indentLevel--;
2098 }
2099}
2100
QCString anchorPrefix() const
Definition cite.cpp:127
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:951
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:1911
uint32_t rowSpan() const
Definition docnode.cpp:1849
Alignment alignment() const
Definition docnode.cpp:1873
bool isLast() const
Definition docnode.h:1202
bool isHeading() const
Definition docnode.h:1200
uint32_t colSpan() const
Definition docnode.cpp:1861
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
Node Html summary.
Definition docnode.h:844
Node representing a HTML table.
Definition docnode.h:1269
size_t numberHeaderRows() const
Definition docnode.cpp:2186
size_t numColumns() const
Definition docnode.h:1278
const DocNodeVariant * caption() const
Definition docnode.cpp:2181
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
RowSpanList & rowSpans()
void setCurrentColumn(size_t col)
static const int maxIndentLevels
void endLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)
void endDotFile(bool hasCaption)
void operator()(const DocWord &)
void visitCaption(const DocNodeList &children)
void addRowSpan(ActiveRowSpan &&span)
void setNumCols(size_t num)
void writeStartTableCommand(const DocNodeVariant *n, size_t cols)
void writeEndTableCommand(const DocNodeVariant *n)
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false)
OutputCodeList & m_ci
LatexDocVisitor(TextStream &t, OutputCodeList &ci, LatexCodeGenerator &lcg, const QCString &langExt, int hierarchyLevel=0)
size_t currentColumn() const
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void filter(const QCString &str, const bool retainNewLine=false)
void endMscFile(bool hasCaption)
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)
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 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)
Class representing a list of different code generators.
Definition outputlist.h:165
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:422
int toInt(bool *ok=nullptr, int base=10) const
Definition qcstring.cpp:254
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
bool endsWith(const char *s) const
Definition qcstring.h:524
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
const std::string & str() const
Definition qcstring.h:552
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
@ ExplicitSize
Definition qcstring.h:146
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:96
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:172
QCString left(size_t len) const
Definition qcstring.h:229
constexpr int level() const
Definition section.h: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:151
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
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:649
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:842
Portable versions of functions that are platform dependent.
const char * qPrint(const char *s)
Definition qcstring.h:687
#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:5134
QCString integerToRoman(int n, bool upper)
Definition util.cpp:6635
QCString stripPath(const QCString &s)
Definition util.cpp:4877
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:5473
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5152
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:5796
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5176
A bunch of utility functions.