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 << "\n\\begin{DoxyTableNested}{" << cols << "}";
1260 }
1261 else
1262 {
1263 m_t << "\n\\begin{DoxyTable}{" << cols << "}";
1264 }
1265 //return isNested ? "TabularNC" : "TabularC";
1266}
1267
1269{
1270 if (isTableNested(n))
1271 {
1272 m_t << "\\end{DoxyTableNested}\n";
1273 }
1274 else
1275 {
1276 m_t << "\\end{DoxyTable}\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
1297 const DocHtmlRow *firstRow = std::get_if<DocHtmlRow>(t.firstRow());
1299 if (!isTableNested(t.parent()))
1300 {
1301 // write caption
1302 m_t << "{";
1303 if (c)
1304 {
1305 std::visit(*this, *t.caption());
1306 }
1307 m_t << "}";
1308 // write label
1309 m_t << "{";
1310 if (c)
1311 {
1312 m_t << stripPath(c->file()) << "_" << c->anchor();
1313 }
1314 m_t << "}";
1315 }
1316 // write head row
1317 m_t << "{";
1318 if (firstRow && firstRow->isHeading())
1319 {
1320 m_t << "1";
1321 }
1322 else
1323 {
1324 m_t << "0";
1325 }
1326 m_t << "}";
1327 m_t << "\n";
1328
1330
1331 visitChildren(t);
1333 popTableState();
1334}
1335
1337{
1338 if (m_hide) return;
1339 visitChildren(c);
1340}
1341
1343{
1344 if (m_hide) return;
1346
1347 visitChildren(row);
1348
1349 m_t << "\\\\";
1350
1351 size_t col = 1;
1352 for (auto &span : rowSpans())
1353 {
1354 if (span.rowSpan>0) span.rowSpan--;
1355 if (span.rowSpan<=0)
1356 {
1357 // inactive span
1358 }
1359 else if (span.column>col)
1360 {
1361 col = span.column+span.colSpan;
1362 }
1363 else
1364 {
1365 col = span.column+span.colSpan;
1366 }
1367 }
1368
1369 m_t << "\n";
1370}
1371
1373{
1374 if (m_hide) return;
1375 //printf("Cell(r=%u,c=%u) rowSpan=%d colSpan=%d currentColumn()=%zu\n",c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),currentColumn());
1376
1378
1379 QCString cellOpts;
1380 QCString cellSpec;
1381 auto appendOpt = [&cellOpts](const QCString &s)
1382 {
1383 if (!cellOpts.isEmpty()) cellOpts+=",";
1384 cellOpts+=s;
1385 };
1386 auto appendSpec = [&cellSpec](const QCString &s)
1387 {
1388 if (!cellSpec.isEmpty()) cellSpec+=",";
1389 cellSpec+=s;
1390 };
1391 auto writeCell = [this,&cellOpts,&cellSpec]()
1392 {
1393 if (!cellOpts.isEmpty() || !cellSpec.isEmpty())
1394 {
1395 m_t << "\\SetCell";
1396 if (!cellOpts.isEmpty())
1397 {
1398 m_t << "[" << cellOpts << "]";
1399 }
1400 m_t << "{" << cellSpec << "}";
1401 }
1402 };
1403
1404 // skip over columns that have a row span starting at an earlier row
1405 for (const auto &span : rowSpans())
1406 {
1407 //printf("span(r=%u,c=%u): column=%zu colSpan=%zu,rowSpan=%zu currentColumn()=%zu\n",
1408 // span.cell.rowIndex(),span.cell.columnIndex(),
1409 // span.column,span.colSpan,span.rowSpan,
1410 // currentColumn());
1411 if (span.rowSpan>0 && span.column==currentColumn())
1412 {
1413 setCurrentColumn(currentColumn()+span.colSpan);
1414 for (size_t i=0;i<span.colSpan;i++)
1415 {
1416 m_t << "&";
1417 }
1418 }
1419 }
1420
1421 int cs = c.colSpan();
1422 int ha = c.alignment();
1423 int rs = c.rowSpan();
1424 int va = c.valignment();
1425
1426 switch (ha) // horizontal alignment
1427 {
1428 case DocHtmlCell::Right:
1429 appendSpec("r");
1430 break;
1432 appendSpec("c");
1433 break;
1434 default:
1435 // default
1436 break;
1437 }
1438 if (rs>0) // row span
1439 {
1440 appendOpt("r="+QCString().setNum(rs));
1441 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%zu\n",
1442 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1443 // currentColumn());
1445 }
1446 if (cs>1) // column span
1447 {
1448 // update column to the end of the span, needs to be done *after* calling addRowSpan()
1450 appendOpt("c="+QCString().setNum(cs));
1451 }
1452 switch(va) // vertical alignment
1453 {
1454 case DocHtmlCell::Top:
1455 appendSpec("h");
1456 break;
1458 appendSpec("f");
1459 break;
1461 // default
1462 break;
1463 }
1464 writeCell();
1465
1466 visitChildren(c);
1467
1468 for (int i=0;i<cs-1;i++)
1469 {
1470 m_t << "&"; // placeholder for invisible cell
1471 }
1472
1473 if (!c.isLast()) m_t << "&";
1474}
1475
1477{
1478 if (m_hide) return;
1479 visitChildren(i);
1480}
1481
1483{
1484 if (m_hide) return;
1485 if (Config_getBool(PDF_HYPERLINKS))
1486 {
1487 m_t << "\\href{";
1488 m_t << latexFilterURL(href.url());
1489 m_t << "}";
1490 }
1491 m_t << "{\\texttt{";
1492 visitChildren(href);
1493 m_t << "}}";
1494}
1495
1497{
1498 if (m_hide) return;
1499 m_t << "{\\bfseries{";
1500 visitChildren(d);
1501 m_t << "}}";
1502}
1503
1505{
1506 if (m_hide) return;
1507 m_t << "\n\n";
1508 auto summary = d.summary();
1509 if (summary)
1510 {
1511 std::visit(*this,*summary);
1512 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1513 }
1514 visitChildren(d);
1515 if (summary)
1516 {
1517 m_t << "\\end{adjustwidth}\n";
1518 }
1519 else
1520 {
1521 m_t << "\n\n";
1522 }
1523}
1524
1526{
1527 if (m_hide) return;
1528 m_t << "\\" << getSectionName(header.level()) << "*{";
1529 visitChildren(header);
1530 m_t << "}";
1531}
1532
1534{
1535 if (img.type()==DocImage::Latex)
1536 {
1537 if (m_hide) return;
1538 QCString gfxName = img.name();
1539 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1540 {
1541 gfxName=gfxName.left(gfxName.length()-4);
1542 }
1543
1544 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1545 visitChildren(img);
1547 }
1548 else // other format -> skip
1549 {
1550 }
1551}
1552
1554{
1555 if (m_hide) return;
1556 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1557 startDotFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1558 visitChildren(df);
1559 endDotFile(df.hasCaption());
1560}
1561
1563{
1564 if (m_hide) return;
1565 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1566 startMscFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1567 visitChildren(df);
1568 endMscFile(df.hasCaption());
1569}
1570
1572{
1573 if (m_hide) return;
1574 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1575 startDiaFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1576 visitChildren(df);
1577 endDiaFile(df.hasCaption());
1578}
1579
1581{
1582 if (m_hide) return;
1583 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1584 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1585 visitChildren(df);
1587}
1588
1590{
1591 if (m_hide) return;
1592 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1593 visitChildren(lnk);
1594 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1595}
1596
1598{
1599 if (m_hide) return;
1600 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1601 // ref.anchor() for LaTeX/RTF
1602 if (ref.isSubPage())
1603 {
1604 startLink(ref.ref(),QCString(),ref.anchor());
1605 }
1606 else
1607 {
1608 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1609 }
1610 if (!ref.hasLinkText())
1611 {
1612 filter(ref.targetTitle());
1613 }
1614 visitChildren(ref);
1615 if (ref.isSubPage())
1616 {
1617 endLink(ref.ref(),QCString(),ref.anchor());
1618 }
1619 else
1620 {
1621 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1622 }
1623}
1624
1626{
1627 if (m_hide) return;
1628 m_t << "\\item \\contentsline{section}{";
1629 if (ref.isSubPage())
1630 {
1631 startLink(ref.ref(),QCString(),ref.anchor());
1632 }
1633 else
1634 {
1635 if (!ref.file().isEmpty())
1636 {
1637 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1638 }
1639 }
1640 visitChildren(ref);
1641 if (ref.isSubPage())
1642 {
1643 endLink(ref.ref(),QCString(),ref.anchor());
1644 }
1645 else
1646 {
1647 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1648 }
1649 m_t << "}{\\ref{";
1650 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1651 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1652 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1653 m_t << "}}{}\n";
1654}
1655
1657{
1658 if (m_hide) return;
1659 m_t << "\\footnotesize\n";
1660 m_t << "\\begin{multicols}{2}\n";
1661 m_t << "\\begin{DoxyCompactList}\n";
1663 visitChildren(l);
1665 m_t << "\\end{DoxyCompactList}\n";
1666 m_t << "\\end{multicols}\n";
1667 m_t << "\\normalsize\n";
1668}
1669
1671{
1672 if (m_hide) return;
1673 bool hasInOutSpecs = s.hasInOutSpecifier();
1674 bool hasTypeSpecs = s.hasTypeSpecifier();
1675 m_lcg.incUsedTableLevel();
1676 switch(s.type())
1677 {
1679 m_t << "\n\\begin{DoxyParams}";
1680 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1681 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1682 m_t << "{";
1683 filter(theTranslator->trParameters());
1684 break;
1686 m_t << "\n\\begin{DoxyRetVals}{";
1687 filter(theTranslator->trReturnValues());
1688 break;
1690 m_t << "\n\\begin{DoxyExceptions}{";
1691 filter(theTranslator->trExceptions());
1692 break;
1694 m_t << "\n\\begin{DoxyTemplParams}{";
1695 filter(theTranslator->trTemplateParameters());
1696 break;
1697 default:
1698 ASSERT(0);
1700 }
1701 m_t << "}\n";
1702 visitChildren(s);
1703 m_lcg.decUsedTableLevel();
1704 switch(s.type())
1705 {
1707 m_t << "\\end{DoxyParams}\n";
1708 break;
1710 m_t << "\\end{DoxyRetVals}\n";
1711 break;
1713 m_t << "\\end{DoxyExceptions}\n";
1714 break;
1716 m_t << "\\end{DoxyTemplParams}\n";
1717 break;
1718 default:
1719 ASSERT(0);
1721 }
1722}
1723
1725{
1726 m_t << " " << sep.chars() << " ";
1727}
1728
1730{
1731 if (m_hide) return;
1733 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1734 if (sect)
1735 {
1736 parentType = sect->type();
1737 }
1738 bool useTable = parentType==DocParamSect::Param ||
1739 parentType==DocParamSect::RetVal ||
1740 parentType==DocParamSect::Exception ||
1741 parentType==DocParamSect::TemplateParam;
1742 if (!useTable)
1743 {
1744 m_t << "\\item[";
1745 }
1746 if (sect && sect->hasInOutSpecifier())
1747 {
1749 {
1750 m_t << "\\mbox{\\texttt{";
1751 if (pl.direction()==DocParamSect::In)
1752 {
1753 m_t << "in";
1754 }
1755 else if (pl.direction()==DocParamSect::Out)
1756 {
1757 m_t << "out";
1758 }
1759 else if (pl.direction()==DocParamSect::InOut)
1760 {
1761 m_t << "in,out";
1762 }
1763 m_t << "}} ";
1764 }
1765 if (useTable) m_t << " & ";
1766 }
1767 if (sect && sect->hasTypeSpecifier())
1768 {
1769 for (const auto &type : pl.paramTypes())
1770 {
1771 std::visit(*this,type);
1772 }
1773 if (useTable) m_t << " & ";
1774 }
1775 m_t << "{\\em ";
1776 bool first=TRUE;
1777 for (const auto &param : pl.parameters())
1778 {
1779 if (!first) m_t << ","; else first=FALSE;
1781 std::visit(*this,param);
1783 }
1784 m_t << "}";
1785 if (useTable)
1786 {
1787 m_t << " & ";
1788 }
1789 else
1790 {
1791 m_t << "]";
1792 }
1793 for (const auto &par : pl.paragraphs())
1794 {
1795 std::visit(*this,par);
1796 }
1797 if (useTable)
1798 {
1799 m_t << "\\\\\n"
1800 << "\\hline\n";
1801 }
1802}
1803
1805{
1806 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1807 if (m_hide) return;
1808 if (x.title().isEmpty()) return;
1810 m_t << "\\begin{DoxyRefDesc}{";
1811 filter(x.title());
1812 m_t << "}\n";
1813 bool anonymousEnum = x.file()=="@";
1814 m_t << "\\item[";
1815 if (pdfHyperlinks && !anonymousEnum)
1816 {
1817 m_t << "\\mbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1818 }
1819 else
1820 {
1821 m_t << "\\textbf{ ";
1822 }
1824 filter(x.title());
1826 if (pdfHyperlinks && !anonymousEnum)
1827 {
1828 m_t << "}";
1829 }
1830 m_t << "}]";
1831 visitChildren(x);
1832 if (x.title().isEmpty()) return;
1834 m_t << "\\end{DoxyRefDesc}\n";
1835}
1836
1838{
1839 if (m_hide) return;
1840 startLink(QCString(),ref.file(),ref.anchor());
1841 visitChildren(ref);
1842 endLink(QCString(),ref.file(),ref.anchor());
1843}
1844
1846{
1847 if (m_hide) return;
1848 visitChildren(t);
1849}
1850
1852{
1853 if (m_hide) return;
1854 m_t << "\\begin{quote}\n";
1856 visitChildren(q);
1857 m_t << "\\end{quote}\n";
1859}
1860
1864
1866{
1867 if (m_hide) return;
1868 visitChildren(pb);
1869}
1870
1871void LatexDocVisitor::filter(const QCString &str, const bool retainNewLine)
1872{
1873 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1875 m_lcg.insideTabbing(),
1878 m_lcg.usedTableLevel()>0, // insideTable
1879 false, // keepSpaces
1880 retainNewLine
1881 );
1882}
1883
1884void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,
1885 bool refToTable,bool refToSection)
1886{
1887 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1888 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1889 {
1890 if (refToTable)
1891 {
1892 m_t << "\\doxytablelink{";
1893 }
1894 else if (refToSection)
1895 {
1896 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1897 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1898 }
1899 else
1900 {
1901 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1902 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1903 }
1904 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1905 {
1906 if (!file.isEmpty()) m_t << stripPath(file);
1907 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1908 if (!anchor.isEmpty()) m_t << anchor;
1909 m_t << "}";
1910 }
1911 m_t << "{";
1912 }
1913 else if (ref.isEmpty() && refToSection)
1914 {
1915 m_t << "\\doxysectref{";
1916 }
1917 else if (ref.isEmpty() && refToTable)
1918 {
1919 m_t << "\\doxytableref{";
1920 }
1921 else if (ref.isEmpty()) // internal non-PDF link
1922 {
1923 m_t << "\\doxyref{";
1924 }
1925 else // external link
1926 {
1927 m_t << "\\textbf{ ";
1928 }
1929}
1930
1931void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool /*refToTable*/,bool refToSection, SectionType sectionType)
1932{
1933 m_t << "}";
1934 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1935 if (ref.isEmpty() && !pdfHyperLinks)
1936 {
1937 m_t << "{";
1938 filter(theTranslator->trPageAbbreviation());
1939 m_t << "}{" << file;
1940 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1941 m_t << anchor << "}";
1942 if (refToSection)
1943 {
1944 m_t << "{" << sectionType.level() << "}";
1945 }
1946 }
1947 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1948 {
1949 if (refToSection)
1950 {
1951 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1952 }
1953 }
1954}
1955
1957 const QCString &width,
1958 const QCString &height,
1959 bool hasCaption,
1960 const QCString &srcFile,
1961 int srcLine
1962 )
1963{
1964 QCString baseName=makeBaseName(fileName);
1965 baseName.prepend("dot_");
1966 QCString outDir = Config_getString(LATEX_OUTPUT);
1967 QCString name = fileName;
1968 writeDotGraphFromFile(name,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
1969 visitPreStart(m_t,hasCaption, baseName, width, height);
1970}
1971
1972void LatexDocVisitor::endDotFile(bool hasCaption)
1973{
1974 if (m_hide) return;
1975 visitPostEnd(m_t,hasCaption);
1976}
1977
1979 const QCString &width,
1980 const QCString &height,
1981 bool hasCaption,
1982 const QCString &srcFile,
1983 int srcLine
1984 )
1985{
1986 QCString baseName=makeBaseName(fileName);
1987 baseName.prepend("msc_");
1988
1989 QCString outDir = Config_getString(LATEX_OUTPUT);
1990 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
1991 visitPreStart(m_t,hasCaption, baseName, width, height);
1992}
1993
1994void LatexDocVisitor::endMscFile(bool hasCaption)
1995{
1996 if (m_hide) return;
1997 visitPostEnd(m_t,hasCaption);
1998}
1999
2000
2002{
2003 QCString shortName = makeShortName(baseName);
2004 QCString outDir = Config_getString(LATEX_OUTPUT);
2005 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
2006 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
2009}
2010
2011
2013 const QCString &width,
2014 const QCString &height,
2015 bool hasCaption,
2016 const QCString &srcFile,
2017 int srcLine
2018 )
2019{
2020 QCString baseName=makeBaseName(fileName);
2021 baseName.prepend("dia_");
2022
2023 QCString outDir = Config_getString(LATEX_OUTPUT);
2024 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
2025 visitPreStart(m_t,hasCaption, baseName, width, height);
2026}
2027
2028void LatexDocVisitor::endDiaFile(bool hasCaption)
2029{
2030 if (m_hide) return;
2031 visitPostEnd(m_t,hasCaption);
2032}
2033
2034
2036{
2037 QCString shortName = makeShortName(baseName);
2038 QCString outDir = Config_getString(LATEX_OUTPUT);
2039 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::EPS,s.srcFile(),s.srcLine());
2040 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2043}
2044
2046{
2047 QCString shortName = makeShortName(baseName);
2048 if (s.useBitmap())
2049 {
2050 if (shortName.find('.')==-1) shortName += ".png";
2051 }
2052 QCString outDir = Config_getString(LATEX_OUTPUT);
2055 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2058}
2059
2061 const QCString &width,
2062 const QCString &height,
2063 bool hasCaption,
2064 const QCString &srcFile,
2065 int srcLine
2066 )
2067{
2068 QCString outDir = Config_getString(LATEX_OUTPUT);
2069 std::string inBuf;
2070 readInputFile(fileName,inBuf);
2071
2072 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2073 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
2074 outDir,QCString(),inBuf.c_str(),
2076 QCString(),srcFile,srcLine,false);
2077 bool first = true;
2078 for (const auto &bName: baseNameVector)
2079 {
2080 QCString baseName = makeBaseName(QCString(bName));
2081 QCString shortName = makeShortName(baseName);
2082 if (useBitmap)
2083 {
2084 if (shortName.find('.')==-1) shortName += ".png";
2085 }
2088 if (!first) endPlantUmlFile(hasCaption);
2089 first = false;
2090 visitPreStart(m_t,hasCaption, shortName, width, height);
2091 }
2092}
2093
2095{
2096 if (m_hide) return;
2097 visitPostEnd(m_t,hasCaption);
2098}
2099
2101{
2102 return std::min(m_indentLevel,maxIndentLevels-1);
2103}
2104
2106{
2107 m_indentLevel++;
2109 {
2110 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2111 }
2112}
2113
2115{
2116 if (m_indentLevel>0)
2117 {
2118 m_indentLevel--;
2119 }
2120}
2121
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:952
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:1913
uint32_t rowSpan() const
Definition docnode.cpp:1851
Alignment alignment() const
Definition docnode.cpp:1875
bool isLast() const
Definition docnode.h:1202
uint32_t colSpan() const
Definition docnode.cpp:1863
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 numColumns() const
Definition docnode.h:1278
const DocNodeVariant * caption() const
Definition docnode.cpp:2183
const DocNodeVariant * firstRow() const
Definition docnode.cpp:2188
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)
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 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: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:5724
QCString integerToRoman(int n, bool upper)
Definition util.cpp:7215
QCString stripPath(const QCString &s)
Definition util.cpp:5467
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:6053
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5742
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:6376
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5766
A bunch of utility functions.