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
44static const int g_maxLevels = 7;
45static const std::array<const char *,g_maxLevels> g_secLabels =
46{ "doxysection",
47 "doxysubsection",
48 "doxysubsubsection",
49 "doxysubsubsubsection",
50 "doxysubsubsubsubsection",
51 "doxysubsubsubsubsubsection",
52 "doxysubsubsubsubsubsubsection"
53};
54
55static const char *g_paragraphLabel = "doxyparagraph";
56static const char *g_subparagraphLabel = "doxysubparagraph";
57
58const char *LatexDocVisitor::getSectionName(int level) const
59{
60 bool compactLatex = Config_getBool(COMPACT_LATEX);
61 int l = level;
62 if (compactLatex) l++;
63
64 if (l < g_maxLevels)
65 {
66 l += m_hierarchyLevel; /* May be -1 if generating main page */
67 // Sections get special treatment because they inherit the parent's level
68 if (l >= g_maxLevels)
69 {
70 l = g_maxLevels - 1;
71 }
72 else if (l < 0)
73 {
74 /* Should not happen; level is always >= 1 and hierarchyLevel >= -1 */
75 l = 0;
76 }
77 return g_secLabels[l];
78 }
79 else if (l == 7)
80 {
81 return g_paragraphLabel;
82 }
83 else
84 {
86 }
87}
88
89static void insertDimension(TextStream &t, QCString dimension, const char *orientationString)
90{
91 // dimensions for latex images can be a percentage, in this case they need some extra
92 // handling as the % symbol is used for comments
93 static const reg::Ex re(R"((\d+)%)");
94 std::string s = dimension.str();
95 reg::Match match;
96 if (reg::search(s,match,re))
97 {
98 bool ok = false;
99 double percent = QCString(match[1].str()).toInt(&ok);
100 if (ok)
101 {
102 t << percent/100.0 << "\\text" << orientationString;
103 return;
104 }
105 }
106 t << dimension;
107}
108
109static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage = FALSE)
110{
111 if (inlineImage)
112 {
113 t << "\n\\begin{DoxyInlineImage}\n";
114 }
115 else
116 {
117 if (hasCaption)
118 {
119 t << "\n\\begin{DoxyImage}\n";
120 }
121 else
122 {
123 t << "\n\\begin{DoxyImageNoCaption}\n"
124 " \\mbox{";
125 }
126 }
127
128 t << "\\includegraphics";
129 if (!width.isEmpty() || !height.isEmpty())
130 {
131 t << "[";
132 }
133 if (!width.isEmpty())
134 {
135 t << "width=";
136 insertDimension(t, width, "width");
137 }
138 if (!width.isEmpty() && !height.isEmpty())
139 {
140 t << ",";
141 }
142 if (!height.isEmpty())
143 {
144 t << "height=";
145 insertDimension(t, height, "height");
146 }
147 if (width.isEmpty() && height.isEmpty())
148 {
149 /* default setting */
150 if (inlineImage)
151 {
152 t << "[height=\\baselineskip,keepaspectratio=true]";
153 }
154 else
155 {
156 t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]";
157 }
158 }
159 else
160 {
161 t << "]";
162 }
163
164 t << "{" << name << "}";
165
166 if (hasCaption)
167 {
168 if (!inlineImage)
169 {
170 if (Config_getBool(PDF_HYPERLINKS))
171 {
172 t << "\n\\doxyfigcaption{";
173 }
174 else
175 {
176 t << "\n\\doxyfigcaptionnolink{";
177 }
178 }
179 else
180 {
181 t << "%"; // to catch the caption
182 }
183 }
184}
185
186
187
188static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage = FALSE)
189{
190 if (inlineImage)
191 {
192 t << "\n\\end{DoxyInlineImage}\n";
193 }
194 else
195 {
196 t << "}\n"; // end mbox or caption
197 if (hasCaption)
198 {
199 t << "\\end{DoxyImage}\n";
200 }
201 else
202 {
203 t << "\\end{DoxyImageNoCaption}\n";
204 }
205 }
206}
207
208static QCString makeShortName(const QCString &name)
209{
210 QCString shortName = name;
211 int i = shortName.findRev('/');
212 if (i!=-1)
213 {
214 shortName=shortName.mid(i+1);
215 }
216 return shortName;
217}
218
219static QCString makeBaseName(const QCString &name)
220{
221 QCString baseName = makeShortName(name);
222 int i=baseName.find('.');
223 if (i!=-1)
224 {
225 baseName=baseName.left(i);
226 }
227 return baseName;
228}
229
230
232{
233 for (const auto &n : children)
234 {
235 std::visit(*this,n);
236 }
237}
238
240{
241 QCString result;
242 const char *p=s;
243 char str[2]; str[1]=0;
244 char c = 0;
245 if (p)
246 {
247 while ((c=*p++))
248 {
249 switch (c)
250 {
251 case '!': m_t << "\"!"; break;
252 case '"': m_t << "\"\""; break;
253 case '@': m_t << "\"@"; break;
254 case '|': m_t << "\\texttt{\"|}"; break;
255 case '[': m_t << "["; break;
256 case ']': m_t << "]"; break;
257 case '{': m_t << "\\lcurly{}"; break;
258 case '}': m_t << "\\rcurly{}"; break;
259 default: str[0]=c; filter(str); break;
260 }
261 }
262 }
263 return result;
264}
265
266
268 const QCString &langExt, int hierarchyLevel)
269 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(FALSE),
271 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
272{
273}
274
275 //--------------------------------------
276 // visitor functions for leaf nodes
277 //--------------------------------------
278
280{
281 if (m_hide) return;
282 filter(w.word());
283}
284
286{
287 if (m_hide) return;
288 startLink(w.ref(),w.file(),w.anchor());
289 filter(w.word());
290 endLink(w.ref(),w.file(),w.anchor());
291}
292
294{
295 if (m_hide) return;
296 if (m_insidePre)
297 {
298 m_t << w.chars();
299 }
300 else
301 {
302 m_t << " ";
303 }
304}
305
307{
308 if (m_hide) return;
309 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
310 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
311 if (res)
312 {
314 {
315 if (pdfHyperlinks)
316 {
317 m_t << "\\texorpdfstring{$<$}{<}";
318 }
319 else
320 {
321 m_t << "$<$";
322 }
323 }
325 {
326 if (pdfHyperlinks)
327 {
328 m_t << "\\texorpdfstring{$>$}{>}";
329 }
330 else
331 {
332 m_t << "$>$";
333 }
334 }
335 else
336 {
337 m_t << res;
338 }
339 }
340 else
341 {
342 err("LaTeX: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
343 }
344}
345
347{
348 if (m_hide) return;
349 QCString emojiName = EmojiEntityMapper::instance().name(s.index());
350 if (!emojiName.isEmpty())
351 {
352 QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
353 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
354 filter(emojiName);
355 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
356 }
357 else
358 {
359 m_t << s.name();
360 }
361}
362
364{
365 if (m_hide) return;
366 if (Config_getBool(PDF_HYPERLINKS))
367 {
368 m_t << "\\href{";
369 if (u.isEmail()) m_t << "mailto:";
370 m_t << latexFilterURL(u.url()) << "}";
371 }
372 m_t << "{\\texttt{ ";
373 filter(u.url());
374 m_t << "}}";
375}
376
378{
379 if (m_hide) return;
380 m_t << "~\\newline\n";
381}
382
384{
385 if (m_hide) return;
386 if (insideTable())
387 m_t << "\\DoxyHorRuler{1}\n";
388 else
389 m_t << "\\DoxyHorRuler{0}\n";
390}
391
393{
394 if (m_hide) return;
395 switch (s.style())
396 {
398 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
399 break;
403 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
404 break;
407 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
408 break;
410 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
411 break;
414 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
415 break;
417 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
418 break;
420 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
421 break;
423 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
424 break;
426 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
427 break;
429 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
430 break;
432 if (s.enable())
433 {
434 m_t << "\n\\begin{DoxyPre}";
436 }
437 else
438 {
440 m_t << "\\end{DoxyPre}\n";
441 }
442 break;
443 case DocStyleChange::Div: /* HTML only */ break;
444 case DocStyleChange::Span: /* HTML only */ break;
445 }
446}
447
449{
450 if (m_hide) return;
451 QCString lang = m_langExt;
452 if (!s.language().isEmpty()) // explicit language setting
453 {
454 lang = s.language();
455 }
456 SrcLangExt langExt = getLanguageFromCodeLang(lang);
457 switch(s.type())
458 {
460 {
461 m_ci.startCodeFragment("DoxyCode");
462 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
463 Config_getBool(STRIP_CODE_COMMENTS),
464 s.isExample(),s.exampleFile());
465 m_ci.endCodeFragment("DoxyCode");
466 }
467 break;
469 filter(s.text(), true);
470 break;
472 m_t << "{\\ttfamily ";
473 filter(s.text(), true);
474 m_t << "}";
475 break;
477 m_t << "\\begin{DoxyVerb}";
478 m_t << s.text();
479 m_t << "\\end{DoxyVerb}\n";
480 break;
486 /* nothing */
487 break;
489 m_t << s.text();
490 break;
491 case DocVerbatim::Dot:
492 {
493 static int dotindex = 1;
494 QCString fileName(4096, QCString::ExplicitSize);
495
496 fileName.sprintf("%s%d%s",
497 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_"),
498 dotindex++,
499 ".dot"
500 );
501 std::ofstream file = Portable::openOutputStream(fileName);
502 if (!file.is_open())
503 {
504 err("Could not open file %s for writing\n",qPrint(fileName));
505 }
506 else
507 {
508 file.write( s.text().data(), s.text().length() );
509 file.close();
510
511 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine());
512 visitChildren(s);
514
515 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
516 }
517 }
518 break;
519 case DocVerbatim::Msc:
520 {
521 static int mscindex = 1;
522 QCString baseName(4096, QCString::ExplicitSize);
523
524 baseName.sprintf("%s%d",
525 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_"),
526 mscindex++
527 );
528 QCString fileName = baseName+".msc";
529 std::ofstream file = Portable::openOutputStream(fileName);
530 if (!file.is_open())
531 {
532 err("Could not open file %s for writing\n",qPrint(fileName));
533 }
534 else
535 {
536 QCString text = "msc {";
537 text+=s.text();
538 text+="}";
539 file.write( text.data(), text.length() );
540 file.close();
541
542 writeMscFile(baseName, s);
543
544 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
545 }
546 }
547 break;
549 {
550 QCString latexOutput = Config_getString(LATEX_OUTPUT);
552 latexOutput,s.exampleFile(),s.text(),
554 s.engine(),s.srcFile(),s.srcLine(),true);
555
556 writePlantUMLFile(baseName, s);
557 }
558 break;
559 }
560}
561
563{
564 if (m_hide) return;
565 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
566 if (!anc.file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
567 {
568 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
569 << "}%\n";
570 }
571}
572
574{
575 if (m_hide) return;
577 switch(inc.type())
578 {
580 {
581 m_ci.startCodeFragment("DoxyCodeInclude");
582 FileInfo cfi( inc.file().str() );
583 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
585 inc.text(),
586 langExt,
587 inc.stripCodeComments(),
588 inc.isExample(),
589 inc.exampleFile(),
590 fd.get(), // fileDef,
591 -1, // start line
592 -1, // end line
593 FALSE, // inline fragment
594 nullptr, // memberDef
595 TRUE // show line numbers
596 );
597 m_ci.endCodeFragment("DoxyCodeInclude");
598 }
599 break;
601 {
602 m_ci.startCodeFragment("DoxyCodeInclude");
604 inc.text(),langExt,
605 inc.stripCodeComments(),
606 inc.isExample(),
607 inc.exampleFile(),
608 nullptr, // fileDef
609 -1, // startLine
610 -1, // endLine
611 TRUE, // inlineFragment
612 nullptr, // memberDef
613 FALSE
614 );
615 m_ci.endCodeFragment("DoxyCodeInclude");
616 }
617 break;
625 break;
627 m_t << inc.text();
628 break;
630 m_t << "\n\\begin{DoxyVerbInclude}\n";
631 m_t << inc.text();
632 m_t << "\\end{DoxyVerbInclude}\n";
633 break;
636 {
637 m_ci.startCodeFragment("DoxyCodeInclude");
639 inc.file(),
640 inc.blockId(),
641 inc.context(),
643 inc.trimLeft(),
645 );
646 m_ci.endCodeFragment("DoxyCodeInclude");
647 }
648 break;
649 }
650}
651
653{
654 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
655 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
656 if (op.isFirst())
657 {
658 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
660 m_hide = TRUE;
661 }
662 QCString locLangExt = getFileNameExtension(op.includeFileName());
663 if (locLangExt.isEmpty()) locLangExt = m_langExt;
664 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
665 if (op.type()!=DocIncOperator::Skip)
666 {
667 m_hide = popHidden();
668 if (!m_hide)
669 {
670 std::unique_ptr<FileDef> fd;
671 if (!op.includeFileName().isEmpty())
672 {
673 FileInfo cfi( op.includeFileName().str() );
674 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
675 }
676
677 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
679 op.isExample(),op.exampleFile(),
680 fd.get(), // fileDef
681 op.line(), // startLine
682 -1, // endLine
683 FALSE, // inline fragment
684 nullptr, // memberDef
685 op.showLineNo() // show line numbers
686 );
687 }
689 m_hide=TRUE;
690 }
691 if (op.isLast())
692 {
694 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
695 }
696 else
697 {
698 if (!m_hide) m_t << "\n";
699 }
700}
701
703{
704 if (m_hide) return;
705 QCString s = f.text();
706 const char *p = s.data();
707 char c = 0;
708 if (p)
709 {
710 while ((c=*p++))
711 {
712 switch (c)
713 {
714 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
715 default: m_t << c; break;
716 }
717 }
718 }
719}
720
722{
723 if (m_hide) return;
724 m_t << "\\index{";
726 m_t << "@{";
728 m_t << "}}";
729}
730
734
736{
737 if (m_hide) return;
738 if (!cite.file().isEmpty())
739 {
740 //startLink(cite.ref(),cite.file(),cite.anchor());
741 QCString anchor = cite.anchor();
742 QCString anchorPrefix = CitationManager::instance().anchorPrefix();
743 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
744 m_t << "\\cite{" << anchor << "}";
745 }
746 else
747 {
748 m_t << "{\\bfseries [";
749 filter(cite.text());
750 m_t << "]}";
751 }
752}
753
754//--------------------------------------
755// visitor functions for compound nodes
756//--------------------------------------
757
759{
760 if (m_hide) return;
761 if (m_indentLevel>=maxIndentLevels-1) return;
762 if (l.isEnumList())
763 {
764 m_t << "\n\\begin{DoxyEnumerate}";
765 m_listItemInfo[indentLevel()].isEnum = true;
766 }
767 else
768 {
769 m_listItemInfo[indentLevel()].isEnum = false;
770 m_t << "\n\\begin{DoxyItemize}";
771 }
772 visitChildren(l);
773 if (l.isEnumList())
774 {
775 m_t << "\n\\end{DoxyEnumerate}";
776 }
777 else
778 {
779 m_t << "\n\\end{DoxyItemize}";
780 }
781}
782
784{
785 if (m_hide) return;
786 switch (li.itemNumber())
787 {
788 case DocAutoList::Unchecked: // unchecked
789 m_t << "\n\\item[\\DoxyUnchecked] ";
790 break;
791 case DocAutoList::Checked_x: // checked with x
792 case DocAutoList::Checked_X: // checked with X
793 m_t << "\n\\item[\\DoxyChecked] ";
794 break;
795 default:
796 m_t << "\n\\item ";
797 break;
798 }
800 visitChildren(li);
802}
803
805{
806 if (m_hide) return;
807 visitChildren(p);
808 if (!p.isLast() && // omit <p> for last paragraph
809 !(p.parent() && // and for parameter sections
810 std::get_if<DocParamSect>(p.parent())
811 )
812 ) m_t << "\n\n";
813}
814
816{
817 visitChildren(r);
818}
819
821{
822 if (m_hide) return;
823 switch(s.type())
824 {
826 m_t << "\\begin{DoxySeeAlso}{";
828 break;
830 m_t << "\\begin{DoxyReturn}{";
832 break;
834 m_t << "\\begin{DoxyAuthor}{";
836 break;
838 m_t << "\\begin{DoxyAuthor}{";
840 break;
842 m_t << "\\begin{DoxyVersion}{";
844 break;
846 m_t << "\\begin{DoxySince}{";
848 break;
850 m_t << "\\begin{DoxyDate}{";
852 break;
854 m_t << "\\begin{DoxyNote}{";
856 break;
858 m_t << "\\begin{DoxyWarning}{";
860 break;
862 m_t << "\\begin{DoxyPrecond}{";
864 break;
866 m_t << "\\begin{DoxyPostcond}{";
868 break;
870 m_t << "\\begin{DoxyCopyright}{";
872 break;
874 m_t << "\\begin{DoxyInvariant}{";
876 break;
878 m_t << "\\begin{DoxyRemark}{";
880 break;
882 m_t << "\\begin{DoxyAttention}{";
884 break;
886 m_t << "\\begin{DoxyImportant}{";
888 break;
890 m_t << "\\begin{DoxyParagraph}{";
891 break;
893 m_t << "\\begin{DoxyParagraph}{";
894 break;
895 case DocSimpleSect::Unknown: break;
896 }
897
898 if (s.title())
899 {
901 std::visit(*this,*s.title());
903 }
904 m_t << "}\n";
906 visitChildren(s);
907 switch(s.type())
908 {
910 m_t << "\n\\end{DoxySeeAlso}\n";
911 break;
913 m_t << "\n\\end{DoxyReturn}\n";
914 break;
916 m_t << "\n\\end{DoxyAuthor}\n";
917 break;
919 m_t << "\n\\end{DoxyAuthor}\n";
920 break;
922 m_t << "\n\\end{DoxyVersion}\n";
923 break;
925 m_t << "\n\\end{DoxySince}\n";
926 break;
928 m_t << "\n\\end{DoxyDate}\n";
929 break;
931 m_t << "\n\\end{DoxyNote}\n";
932 break;
934 m_t << "\n\\end{DoxyWarning}\n";
935 break;
937 m_t << "\n\\end{DoxyPrecond}\n";
938 break;
940 m_t << "\n\\end{DoxyPostcond}\n";
941 break;
943 m_t << "\n\\end{DoxyCopyright}\n";
944 break;
946 m_t << "\n\\end{DoxyInvariant}\n";
947 break;
949 m_t << "\n\\end{DoxyRemark}\n";
950 break;
952 m_t << "\n\\end{DoxyAttention}\n";
953 break;
955 m_t << "\n\\end{DoxyImportant}\n";
956 break;
958 m_t << "\n\\end{DoxyParagraph}\n";
959 break;
961 m_t << "\n\\end{DoxyParagraph}\n";
962 break;
963 default:
964 break;
965 }
967}
968
970{
971 if (m_hide) return;
972 visitChildren(t);
973}
974
976{
977 if (m_hide) return;
978 m_t << "\\begin{DoxyItemize}\n";
979 m_listItemInfo[indentLevel()].isEnum = false;
980 visitChildren(l);
981 m_t << "\\end{DoxyItemize}\n";
982}
983
985{
986 if (m_hide) return;
987 m_t << "\\item ";
989 if (li.paragraph())
990 {
991 visit(*this,*li.paragraph());
992 }
994}
995
997{
998 if (m_hide) return;
999 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1000 if (pdfHyperlinks)
1001 {
1002 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1003 }
1004 m_t << "\\" << getSectionName(s.level()) << "{";
1005 if (pdfHyperlinks)
1006 {
1007 m_t << "\\texorpdfstring{";
1008 }
1009 if (s.title())
1010 {
1011 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1012 std::visit(*this,*s.title());
1014 }
1015 if (pdfHyperlinks)
1016 {
1017 m_t << "}{";
1018 if (s.title())
1019 {
1020 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1021 std::visit(*this,*s.title());
1023 }
1024 m_t << "}";
1025 }
1026 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1027 visitChildren(s);
1028}
1029
1031{
1032 if (m_hide) return;
1033 if (m_indentLevel>=maxIndentLevels-1) return;
1035 if (s.type()==DocHtmlList::Ordered)
1036 {
1037 bool first = true;
1038 m_t << "\n\\begin{DoxyEnumerate}";
1039 for (const auto &opt : s.attribs())
1040 {
1041 if (opt.name=="type")
1042 {
1043 if (opt.value=="1")
1044 {
1045 m_t << (first ? "[": ",");
1046 m_t << "label=\\arabic*";
1047 first = false;
1048 }
1049 else if (opt.value=="a")
1050 {
1051 m_t << (first ? "[": ",");
1052 m_t << "label=\\enumalphalphcnt*";
1053 first = false;
1054 }
1055 else if (opt.value=="A")
1056 {
1057 m_t << (first ? "[": ",");
1058 m_t << "label=\\enumAlphAlphcnt*";
1059 first = false;
1060 }
1061 else if (opt.value=="i")
1062 {
1063 m_t << (first ? "[": ",");
1064 m_t << "label=\\roman*";
1065 first = false;
1066 }
1067 else if (opt.value=="I")
1068 {
1069 m_t << (first ? "[": ",");
1070 m_t << "label=\\Roman*";
1071 first = false;
1072 }
1073 }
1074 else if (opt.name=="start")
1075 {
1076 m_t << (first ? "[": ",");
1077 bool ok = false;
1078 int val = opt.value.toInt(&ok);
1079 if (ok) m_t << "start=" << val;
1080 first = false;
1081 }
1082 }
1083 if (!first) m_t << "]\n";
1084 }
1085 else
1086 {
1087 m_t << "\n\\begin{DoxyItemize}";
1088 }
1089 visitChildren(s);
1090 if (m_indentLevel>=maxIndentLevels-1) return;
1091 if (s.type()==DocHtmlList::Ordered)
1092 m_t << "\n\\end{DoxyEnumerate}";
1093 else
1094 m_t << "\n\\end{DoxyItemize}";
1095}
1096
1098{
1099 if (m_hide) return;
1100 if (m_listItemInfo[indentLevel()].isEnum)
1101 {
1102 for (const auto &opt : l.attribs())
1103 {
1104 if (opt.name=="value")
1105 {
1106 bool ok = false;
1107 int val = opt.value.toInt(&ok);
1108 if (ok)
1109 {
1110 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1111 }
1112 }
1113 }
1114 }
1115 m_t << "\n\\item ";
1117 visitChildren(l);
1119}
1120
1121
1123{
1124 HtmlAttribList attrs = dl.attribs();
1125 auto it = std::find_if(attrs.begin(),attrs.end(),
1126 [](const auto &att) { return att.name=="class"; });
1127 if (it!=attrs.end() && it->value == "reflist") return true;
1128 return false;
1129}
1130
1131static bool listIsNested(const DocHtmlDescList &dl)
1132{
1133 bool isNested=false;
1134 const DocNodeVariant *n = dl.parent();
1135 while (n && !isNested)
1136 {
1137 if (std::get_if<DocHtmlDescList>(n))
1138 {
1139 isNested = !classEqualsReflist(std::get<DocHtmlDescList>(*n));
1140 }
1141 n = ::parent(n);
1142 }
1143 return isNested;
1144}
1145
1147{
1148 if (m_hide) return;
1149 bool eq = classEqualsReflist(dl);
1150 if (eq)
1151 {
1152 m_t << "\n\\begin{DoxyRefList}";
1153 }
1154 else
1155 {
1156 if (listIsNested(dl)) m_t << "\n\\hfill";
1157 m_t << "\n\\begin{DoxyDescription}";
1158 }
1159 visitChildren(dl);
1160 if (eq)
1161 {
1162 m_t << "\n\\end{DoxyRefList}";
1163 }
1164 else
1165 {
1166 m_t << "\n\\end{DoxyDescription}";
1167 }
1168}
1169
1171{
1172 if (m_hide) return;
1173 m_t << "\n\\item[";
1175 visitChildren(dt);
1177 m_t << "]";
1178}
1179
1181{
1183 if (!m_insideItem) m_t << "\\hfill";
1184 m_t << " \\\\\n";
1185 visitChildren(dd);
1187}
1188
1189static bool tableIsNested(const DocNodeVariant *n)
1190{
1191 bool isNested=FALSE;
1192 while (n && !isNested)
1193 {
1195 n = ::parent(n);
1196 }
1197 return isNested;
1198}
1199
1200static void writeStartTableCommand(TextStream &t,const DocNodeVariant *n,size_t cols)
1201{
1202 if (tableIsNested(n))
1203 {
1204 t << "{\\begin{tabularx}{\\linewidth}{|*{" << cols << "}{>{\\raggedright\\arraybackslash}X|}}";
1205 }
1206 else
1207 {
1208 t << "\\tabulinesep=1mm\n\\begin{longtabu}spread 0pt [c]{*{" << cols << "}{|X[-1]}|}\n";
1209 }
1210 //return isNested ? "TabularNC" : "TabularC";
1211}
1212
1214{
1215 if (tableIsNested(n))
1216 {
1217 t << "\\end{tabularx}}\n";
1218 }
1219 else
1220 {
1221 t << "\\end{longtabu}\n";
1222 }
1223 //return isNested ? "TabularNC" : "TabularC";
1224}
1225
1227{
1228 if (m_hide) return;
1230 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1231 if (c)
1232 {
1233 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1234 if (!c->file().isEmpty() && pdfHyperLinks)
1235 {
1236 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1237 << "}{}";
1238 }
1239 m_t << "\n";
1240 }
1241
1243
1244 if (c)
1245 {
1246 m_t << "\\caption{";
1247 std::visit(*this, *t.caption());
1248 m_t << "}";
1249 m_t << "\\label{" << stripPath(c->file()) << "_" << c->anchor() << "}";
1250 m_t << "\\\\\n";
1251 }
1252
1254 m_t << "\\hline\n";
1255
1256 // check if first row is a heading and then render the row already here
1257 // and end it with \endfirsthead (triggered via m_firstRow==TRUE)
1258 // then repeat the row as normal and end it with \endhead (m_firstRow==FALSE)
1259 const DocHtmlRow *firstRow = std::get_if<DocHtmlRow>(t.firstRow());
1260 if (firstRow && firstRow->isHeading())
1261 {
1263 if (!tableIsNested(t.parent()))
1264 {
1265 std::visit(*this,*t.firstRow());
1266 }
1268 }
1269 visitChildren(t);
1271 popTableState();
1272}
1273
1275{
1276 if (m_hide) return;
1277 visitChildren(c);
1278}
1279
1281{
1282 if (m_hide) return;
1284
1285 visitChildren(row);
1286
1287 size_t c=currentColumn();
1288 while (c<=numCols()) // end of row while inside a row span?
1289 {
1290 for (const auto &span : rowSpans())
1291 {
1292 //printf(" found row span: column=%d rs=%d cs=%d rowIdx=%d cell->rowIdx=%d i=%d c=%d\n",
1293 // span->column, span->rowSpan,span->colSpan,row.rowIndex(),span->cell->rowIndex(),i,c);
1294 if (span.rowSpan>0 && span.column==c && // we are at a cell in a row span
1295 row.rowIndex()>span.cell.rowIndex() // but not the row that started the span
1296 )
1297 {
1298 m_t << "&";
1299 if (span.colSpan>1) // row span is also part of a column span
1300 {
1301 m_t << "\\multicolumn{" << span.colSpan << "}{";
1302 m_t << "}|}{}";
1303 }
1304 else // solitary row span
1305 {
1306 m_t << "\\multicolumn{1}{c|}{}";
1307 }
1308 }
1309 }
1310 c++;
1311 }
1312
1313 m_t << "\\\\";
1314
1315 size_t col = 1;
1316 for (auto &span : rowSpans())
1317 {
1318 if (span.rowSpan>0) span.rowSpan--;
1319 if (span.rowSpan<=0)
1320 {
1321 // inactive span
1322 }
1323 else if (span.column>col)
1324 {
1325 m_t << "\\cline{" << col << "-" << (span.column-1) << "}";
1326 col = span.column+span.colSpan;
1327 }
1328 else
1329 {
1330 col = span.column+span.colSpan;
1331 }
1332 }
1333
1334 if (col <= numCols())
1335 {
1336 m_t << "\\cline{" << col << "-" << numCols() << "}";
1337 }
1338
1339 m_t << "\n";
1340
1341 const DocNodeVariant *n = ::parent(row.parent());
1342 if (row.isHeading() && row.rowIndex()==1 && !tableIsNested(n))
1343 {
1344 if (firstRow())
1345 {
1346 m_t << "\\endfirsthead\n";
1347 m_t << "\\hline\n";
1348 m_t << "\\endfoot\n";
1349 m_t << "\\hline\n";
1350 }
1351 else
1352 {
1353 m_t << "\\endhead\n";
1354 }
1355 }
1356}
1357
1359{
1360 if (m_hide) return;
1361
1362 const DocHtmlRow *row = std::get_if<DocHtmlRow>(c.parent());
1363
1365
1366 //Skip columns that span from above.
1367 for (const auto &span : rowSpans())
1368 {
1369 if (span.rowSpan>0 && span.column==currentColumn())
1370 {
1371 if (row && span.colSpan>1)
1372 {
1373 m_t << "\\multicolumn{" << span.colSpan << "}{";
1374 if (currentColumn() /*c.columnIndex()*/==1) // add extra | for first column
1375 {
1376 m_t << "|";
1377 }
1378 m_t << "l|}{" << (c.isHeading()? "\\columncolor{\\tableheadbgcolor}" : "") << "}"; // alignment not relevant, empty column
1379 setCurrentColumn(currentColumn()+span.colSpan);
1380 }
1381 else
1382 {
1384 }
1385 m_t << "&";
1386 }
1387 }
1388
1389 int cs = c.colSpan();
1390 int a = c.alignment();
1391 if (cs>1 && row)
1392 {
1394 m_t << "\\multicolumn{" << cs << "}{";
1395 if (c.columnIndex()==1) // add extra | for first column
1396 {
1397 m_t << "|";
1398 }
1399 switch (a)
1400 {
1401 case DocHtmlCell::Right:
1402 m_t << "r|}{";
1403 break;
1405 m_t << "c|}{";
1406 break;
1407 default:
1408 m_t << "l|}{";
1409 break;
1410 }
1411 }
1412 int rs = c.rowSpan();
1413 int va = c.valignment();
1414 if (rs>0)
1415 {
1417 m_t << "\\multirow";
1418 switch(va)
1419 {
1420 case DocHtmlCell::Top:
1421 m_t << "[t]";
1422 break;
1424 m_t << "[b]";
1425 break;
1427 break; // No alignment option needed
1428 default:
1429 break;
1430 }
1431 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%d\n",
1432 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1433 // currentColumn());
1435 m_t << "{" << rs << "}{*}{";
1436 }
1437 if (a==DocHtmlCell::Center)
1438 {
1439 m_t << "\\PBS\\centering ";
1440 }
1441 else if (a==DocHtmlCell::Right)
1442 {
1443 m_t << "\\PBS\\raggedleft ";
1444 }
1445 if (c.isHeading())
1446 {
1447 m_t << "\\cellcolor{\\tableheadbgcolor}\\textbf{ ";
1448 }
1449 if (cs>1)
1450 {
1452 }
1453
1454 visitChildren(c);
1455
1456 if (c.isHeading())
1457 {
1458 m_t << "}";
1459 }
1460 if (inRowSpan())
1461 {
1463 m_t << "}";
1464 }
1465 if (inColSpan())
1466 {
1468 m_t << "}";
1469 }
1470 if (!c.isLast()) m_t << "&";
1471}
1472
1474{
1475 if (m_hide) return;
1476 visitChildren(i);
1477}
1478
1480{
1481 if (m_hide) return;
1482 if (Config_getBool(PDF_HYPERLINKS))
1483 {
1484 m_t << "\\href{";
1485 m_t << latexFilterURL(href.url());
1486 m_t << "}";
1487 }
1488 m_t << "{\\texttt{ ";
1489 visitChildren(href);
1490 m_t << "}}";
1491}
1492
1494{
1495 if (m_hide) return;
1496 m_t << "{\\bfseries{";
1497 visitChildren(d);
1498 m_t << "}}";
1499}
1500
1502{
1503 if (m_hide) return;
1504 m_t << "\n\n";
1505 auto summary = d.summary();
1506 if (summary)
1507 {
1508 std::visit(*this,*summary);
1509 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1510 }
1511 visitChildren(d);
1512 if (summary)
1513 {
1514 m_t << "\\end{adjustwidth}\n";
1515 }
1516 else
1517 {
1518 m_t << "\n\n";
1519 }
1520}
1521
1523{
1524 if (m_hide) return;
1525 m_t << "\\" << getSectionName(header.level()) << "*{";
1526 visitChildren(header);
1527 m_t << "}";
1528}
1529
1531{
1532 if (img.type()==DocImage::Latex)
1533 {
1534 if (m_hide) return;
1535 QCString gfxName = img.name();
1536 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1537 {
1538 gfxName=gfxName.left(gfxName.length()-4);
1539 }
1540
1541 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1542 visitChildren(img);
1544 }
1545 else // other format -> skip
1546 {
1547 }
1548}
1549
1551{
1552 if (m_hide) return;
1553 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1554 startDotFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1555 visitChildren(df);
1556 endDotFile(df.hasCaption());
1557}
1558
1560{
1561 if (m_hide) return;
1562 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1563 startMscFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1564 visitChildren(df);
1565 endMscFile(df.hasCaption());
1566}
1567
1569{
1570 if (m_hide) return;
1571 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1572 startDiaFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1573 visitChildren(df);
1574 endDiaFile(df.hasCaption());
1575}
1576
1578{
1579 if (m_hide) return;
1580 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1581 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1582 visitChildren(df);
1584}
1585
1587{
1588 if (m_hide) return;
1589 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1590 visitChildren(lnk);
1591 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1592}
1593
1595{
1596 if (m_hide) return;
1597 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1598 // ref.anchor() for LaTeX/RTF
1599 if (ref.isSubPage())
1600 {
1601 startLink(ref.ref(),QCString(),ref.anchor());
1602 }
1603 else
1604 {
1605 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1606 }
1607 if (!ref.hasLinkText())
1608 {
1609 filter(ref.targetTitle());
1610 }
1611 visitChildren(ref);
1612 if (ref.isSubPage())
1613 {
1614 endLink(ref.ref(),QCString(),ref.anchor());
1615 }
1616 else
1617 {
1618 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1619 }
1620}
1621
1623{
1624 if (m_hide) return;
1625 m_t << "\\item \\contentsline{section}{";
1626 if (ref.isSubPage())
1627 {
1628 startLink(ref.ref(),QCString(),ref.anchor());
1629 }
1630 else
1631 {
1632 if (!ref.file().isEmpty())
1633 {
1634 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1635 }
1636 }
1637 visitChildren(ref);
1638 if (ref.isSubPage())
1639 {
1640 endLink(ref.ref(),QCString(),ref.anchor());
1641 }
1642 else
1643 {
1644 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1645 }
1646 m_t << "}{\\ref{";
1647 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1648 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1649 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1650 m_t << "}}{}\n";
1651}
1652
1654{
1655 if (m_hide) return;
1656 m_t << "\\footnotesize\n";
1657 m_t << "\\begin{multicols}{2}\n";
1658 m_t << "\\begin{DoxyCompactList}\n";
1660 visitChildren(l);
1662 m_t << "\\end{DoxyCompactList}\n";
1663 m_t << "\\end{multicols}\n";
1664 m_t << "\\normalsize\n";
1665}
1666
1668{
1669 if (m_hide) return;
1670 bool hasInOutSpecs = s.hasInOutSpecifier();
1671 bool hasTypeSpecs = s.hasTypeSpecifier();
1672 m_lcg.incUsedTableLevel();
1673 switch(s.type())
1674 {
1676 m_t << "\n\\begin{DoxyParams}";
1677 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1678 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1679 m_t << "{";
1681 break;
1683 m_t << "\n\\begin{DoxyRetVals}{";
1685 break;
1687 m_t << "\n\\begin{DoxyExceptions}{";
1689 break;
1691 m_t << "\n\\begin{DoxyTemplParams}{";
1693 break;
1694 default:
1695 ASSERT(0);
1697 }
1698 m_t << "}\n";
1699 visitChildren(s);
1700 m_lcg.decUsedTableLevel();
1701 switch(s.type())
1702 {
1704 m_t << "\\end{DoxyParams}\n";
1705 break;
1707 m_t << "\\end{DoxyRetVals}\n";
1708 break;
1710 m_t << "\\end{DoxyExceptions}\n";
1711 break;
1713 m_t << "\\end{DoxyTemplParams}\n";
1714 break;
1715 default:
1716 ASSERT(0);
1718 }
1719}
1720
1722{
1723 m_t << " " << sep.chars() << " ";
1724}
1725
1727{
1728 if (m_hide) return;
1730 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1731 if (sect)
1732 {
1733 parentType = sect->type();
1734 }
1735 bool useTable = parentType==DocParamSect::Param ||
1736 parentType==DocParamSect::RetVal ||
1737 parentType==DocParamSect::Exception ||
1738 parentType==DocParamSect::TemplateParam;
1739 if (!useTable)
1740 {
1741 m_t << "\\item[";
1742 }
1743 if (sect && sect->hasInOutSpecifier())
1744 {
1746 {
1747 m_t << "\\mbox{\\texttt{ ";
1748 if (pl.direction()==DocParamSect::In)
1749 {
1750 m_t << "in";
1751 }
1752 else if (pl.direction()==DocParamSect::Out)
1753 {
1754 m_t << "out";
1755 }
1756 else if (pl.direction()==DocParamSect::InOut)
1757 {
1758 m_t << "in,out";
1759 }
1760 m_t << "}} ";
1761 }
1762 if (useTable) m_t << " & ";
1763 }
1764 if (sect && sect->hasTypeSpecifier())
1765 {
1766 for (const auto &type : pl.paramTypes())
1767 {
1768 std::visit(*this,type);
1769 }
1770 if (useTable) m_t << " & ";
1771 }
1772 m_t << "{\\em ";
1773 bool first=TRUE;
1774 for (const auto &param : pl.parameters())
1775 {
1776 if (!first) m_t << ","; else first=FALSE;
1778 std::visit(*this,param);
1780 }
1781 m_t << "}";
1782 if (useTable)
1783 {
1784 m_t << " & ";
1785 }
1786 else
1787 {
1788 m_t << "]";
1789 }
1790 for (const auto &par : pl.paragraphs())
1791 {
1792 std::visit(*this,par);
1793 }
1794 if (useTable)
1795 {
1796 m_t << "\\\\\n"
1797 << "\\hline\n";
1798 }
1799}
1800
1802{
1803 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1804 if (m_hide) return;
1805 if (x.title().isEmpty()) return;
1807 m_t << "\\begin{DoxyRefDesc}{";
1808 filter(x.title());
1809 m_t << "}\n";
1810 bool anonymousEnum = x.file()=="@";
1811 m_t << "\\item[";
1812 if (pdfHyperlinks && !anonymousEnum)
1813 {
1814 m_t << "\\mbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1815 }
1816 else
1817 {
1818 m_t << "\\textbf{ ";
1819 }
1821 filter(x.title());
1823 if (pdfHyperlinks && !anonymousEnum)
1824 {
1825 m_t << "}";
1826 }
1827 m_t << "}]";
1828 visitChildren(x);
1829 if (x.title().isEmpty()) return;
1831 m_t << "\\end{DoxyRefDesc}\n";
1832}
1833
1835{
1836 if (m_hide) return;
1837 startLink(QCString(),ref.file(),ref.anchor());
1838 visitChildren(ref);
1839 endLink(QCString(),ref.file(),ref.anchor());
1840}
1841
1843{
1844 if (m_hide) return;
1845 visitChildren(t);
1846}
1847
1849{
1850 if (m_hide) return;
1851 m_t << "\\begin{quote}\n";
1853 visitChildren(q);
1854 m_t << "\\end{quote}\n";
1856}
1857
1861
1863{
1864 if (m_hide) return;
1865 visitChildren(pb);
1866}
1867
1868void LatexDocVisitor::filter(const QCString &str, const bool retainNewLine)
1869{
1870 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d\n",qPrint(str),m_ci.insideTabbing());
1872 m_lcg.insideTabbing(),
1875 m_lcg.usedTableLevel()>0, // insideTable
1876 false, // keepSpaces
1877 retainNewLine
1878 );
1879}
1880
1881void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,
1882 bool refToTable,bool refToSection)
1883{
1884 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1885 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1886 {
1887 if (refToTable)
1888 {
1889 m_t << "\\doxytablelink{";
1890 }
1891 else if (refToSection)
1892 {
1893 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1894 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1895 }
1896 else
1897 {
1898 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1899 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1900 }
1901 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1902 {
1903 if (!file.isEmpty()) m_t << stripPath(file);
1904 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1905 if (!anchor.isEmpty()) m_t << anchor;
1906 m_t << "}";
1907 }
1908 m_t << "{";
1909 }
1910 else if (ref.isEmpty() && refToSection)
1911 {
1912 m_t << "\\doxysectref{";
1913 }
1914 else if (ref.isEmpty() && refToTable)
1915 {
1916 m_t << "\\doxytableref{";
1917 }
1918 else if (ref.isEmpty()) // internal non-PDF link
1919 {
1920 m_t << "\\doxyref{";
1921 }
1922 else // external link
1923 {
1924 m_t << "\\textbf{ ";
1925 }
1926}
1927
1928void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool /*refToTable*/,bool refToSection, SectionType sectionType)
1929{
1930 m_t << "}";
1931 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1932 if (ref.isEmpty() && !pdfHyperLinks)
1933 {
1934 m_t << "{";
1936 m_t << "}{" << file;
1937 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1938 m_t << anchor << "}";
1939 if (refToSection)
1940 {
1941 m_t << "{" << sectionType.level() << "}";
1942 }
1943 }
1944 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1945 {
1946 if (refToSection)
1947 {
1948 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1949 }
1950 }
1951}
1952
1954 const QCString &width,
1955 const QCString &height,
1956 bool hasCaption,
1957 const QCString &srcFile,
1958 int srcLine
1959 )
1960{
1961 QCString baseName=makeBaseName(fileName);
1962 baseName.prepend("dot_");
1963 QCString outDir = Config_getString(LATEX_OUTPUT);
1964 QCString name = fileName;
1965 writeDotGraphFromFile(name,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
1966 visitPreStart(m_t,hasCaption, baseName, width, height);
1967}
1968
1969void LatexDocVisitor::endDotFile(bool hasCaption)
1970{
1971 if (m_hide) return;
1972 visitPostEnd(m_t,hasCaption);
1973}
1974
1976 const QCString &width,
1977 const QCString &height,
1978 bool hasCaption,
1979 const QCString &srcFile,
1980 int srcLine
1981 )
1982{
1983 QCString baseName=makeBaseName(fileName);
1984 baseName.prepend("msc_");
1985
1986 QCString outDir = Config_getString(LATEX_OUTPUT);
1987 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
1988 visitPreStart(m_t,hasCaption, baseName, width, height);
1989}
1990
1991void LatexDocVisitor::endMscFile(bool hasCaption)
1992{
1993 if (m_hide) return;
1994 visitPostEnd(m_t,hasCaption);
1995}
1996
1997
1999{
2000 QCString shortName = makeShortName(baseName);
2001 QCString outDir = Config_getString(LATEX_OUTPUT);
2002 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
2003 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
2006}
2007
2008
2010 const QCString &width,
2011 const QCString &height,
2012 bool hasCaption,
2013 const QCString &srcFile,
2014 int srcLine
2015 )
2016{
2017 QCString baseName=makeBaseName(fileName);
2018 baseName.prepend("dia_");
2019
2020 QCString outDir = Config_getString(LATEX_OUTPUT);
2021 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
2022 visitPreStart(m_t,hasCaption, baseName, width, height);
2023}
2024
2025void LatexDocVisitor::endDiaFile(bool hasCaption)
2026{
2027 if (m_hide) return;
2028 visitPostEnd(m_t,hasCaption);
2029}
2030
2031
2033{
2034 QCString shortName = makeShortName(baseName);
2035 QCString outDir = Config_getString(LATEX_OUTPUT);
2036 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::EPS,s.srcFile(),s.srcLine());
2037 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2040}
2041
2043{
2044 QCString shortName = makeShortName(baseName);
2045 if (s.useBitmap())
2046 {
2047 if (shortName.find('.')==-1) shortName += ".png";
2048 }
2049 QCString outDir = Config_getString(LATEX_OUTPUT);
2052 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2055}
2056
2058 const QCString &width,
2059 const QCString &height,
2060 bool hasCaption,
2061 const QCString &srcFile,
2062 int srcLine
2063 )
2064{
2065 QCString outDir = Config_getString(LATEX_OUTPUT);
2066 std::string inBuf;
2067 readInputFile(fileName,inBuf);
2068
2069 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2070 QCString baseName = PlantumlManager::instance().writePlantUMLSource(
2071 outDir,QCString(),inBuf.c_str(),
2073 QCString(),srcFile,srcLine,false);
2074 baseName=makeBaseName(baseName);
2075 QCString shortName = makeShortName(baseName);
2076 if (useBitmap)
2077 {
2078 if (shortName.find('.')==-1) shortName += ".png";
2079 }
2082 visitPreStart(m_t,hasCaption, shortName, width, height);
2083}
2084
2086{
2087 if (m_hide) return;
2088 visitPostEnd(m_t,hasCaption);
2089}
2090
2092{
2093 return std::min(m_indentLevel,maxIndentLevels-1);
2094}
2095
2097{
2098 m_indentLevel++;
2100 {
2101 err("Maximum indent level (%d) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2102 }
2103}
2104
2106{
2107 if (m_indentLevel>0)
2108 {
2109 m_indentLevel--;
2110 }
2111}
2112
QCString anchorPrefix() const
Definition cite.cpp:122
static CitationManager & instance()
Definition cite.cpp:80
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.
Node representing an anchor.
Definition docnode.h:228
QCString anchor() const
Definition docnode.h:231
QCString file() const
Definition docnode.h:232
Node representing an auto List.
Definition docnode.h:552
bool isEnumList() const
Definition docnode.h:561
Node representing an item of a auto list.
Definition docnode.h:576
int itemNumber() const
Definition docnode.h:579
Node representing a citation of some bibliographic reference.
Definition docnode.h:244
QCString text() const
Definition docnode.h:251
QCString anchor() const
Definition docnode.h:250
QCString file() const
Definition docnode.h:247
Node representing a dia file.
Definition docnode.h:711
QCString height() const
Definition docnode.h:669
QCString srcFile() const
Definition docnode.h:671
QCString file() const
Definition docnode.h:665
int srcLine() const
Definition docnode.h:672
bool hasCaption() const
Definition docnode.h:667
QCString width() const
Definition docnode.h:668
Node representing a dot file.
Definition docnode.h:693
Node representing an emoji.
Definition docnode.h:322
int index() const
Definition docnode.h:326
QCString name() const
Definition docnode.h:325
Node representing an item of a cross-referenced list.
Definition docnode.h:510
QCString text() const
Definition docnode.h:514
Node representing a Hypertext reference.
Definition docnode.h:803
QCString url() const
Definition docnode.h:810
Node representing a horizontal ruler.
Definition docnode.h:215
Node representing an HTML blockquote.
Definition docnode.h:1271
Node representing a HTML table caption.
Definition docnode.h:1208
QCString anchor() const
Definition docnode.h:1215
QCString file() const
Definition docnode.h:1214
Node representing a HTML table cell.
Definition docnode.h:1173
Valignment valignment() const
Definition docnode.cpp:1859
uint32_t columnIndex() const
Definition docnode.h:1189
uint32_t rowSpan() const
Definition docnode.cpp:1797
Alignment alignment() const
Definition docnode.cpp:1821
bool isLast() const
Definition docnode.h:1182
bool isHeading() const
Definition docnode.h:1180
uint32_t colSpan() const
Definition docnode.cpp:1809
Node representing a HTML description data.
Definition docnode.h:1161
Node representing a Html description list.
Definition docnode.h:881
const HtmlAttribList & attribs() const
Definition docnode.h:885
Node representing a Html description item.
Definition docnode.h:868
Node Html details.
Definition docnode.h:837
const DocNodeVariant * summary() const
Definition docnode.h:844
Node Html heading.
Definition docnode.h:853
int level() const
Definition docnode.h:857
Node representing a Html list.
Definition docnode.h:980
const HtmlAttribList & attribs() const
Definition docnode.h:986
Type type() const
Definition docnode.h:985
Node representing a HTML list item.
Definition docnode.h:1145
const HtmlAttribList & attribs() const
Definition docnode.h:1150
Node representing a HTML table row.
Definition docnode.h:1226
bool isHeading() const
Definition docnode.cpp:1881
uint32_t rowIndex() const
Definition docnode.h:1238
Node Html summary.
Definition docnode.h:824
Node representing a HTML table.
Definition docnode.h:1249
size_t numColumns() const
Definition docnode.h:1258
const DocNodeVariant * caption() const
Definition docnode.cpp:2027
const DocNodeVariant * firstRow() const
Definition docnode.cpp:2032
Node representing an image.
Definition docnode.h:622
QCString name() const
Definition docnode.h:628
QCString height() const
Definition docnode.h:631
Type type() const
Definition docnode.h:627
QCString width() const
Definition docnode.h:630
bool isInlineImage() const
Definition docnode.h:634
bool hasCaption() const
Definition docnode.h:629
Node representing a include/dontinclude operator block.
Definition docnode.h:458
bool stripCodeComments() const
Definition docnode.h:487
bool isLast() const
Definition docnode.h:484
QCString includeFileName() const
Definition docnode.h:490
QCString text() const
Definition docnode.h:480
QCString context() const
Definition docnode.h:482
QCString exampleFile() const
Definition docnode.h:489
int line() const
Definition docnode.h:478
Type type() const
Definition docnode.h:466
bool isFirst() const
Definition docnode.h:483
bool showLineNo() const
Definition docnode.h:479
bool isExample() const
Definition docnode.h:488
Node representing an included text block from file.
Definition docnode.h:416
QCString blockId() const
Definition docnode.h:435
QCString extension() const
Definition docnode.h:431
bool stripCodeComments() const
Definition docnode.h:436
@ LatexInclude
Definition docnode.h:418
@ SnippetWithLines
Definition docnode.h:419
@ DontIncWithLines
Definition docnode.h:420
@ IncWithLines
Definition docnode.h:419
@ HtmlInclude
Definition docnode.h:418
@ VerbInclude
Definition docnode.h:418
@ DontInclude
Definition docnode.h:418
@ DocbookInclude
Definition docnode.h:420
Type type() const
Definition docnode.h:432
QCString exampleFile() const
Definition docnode.h:438
QCString text() const
Definition docnode.h:433
QCString file() const
Definition docnode.h:430
bool trimLeft() const
Definition docnode.h:440
bool isExample() const
Definition docnode.h:437
QCString context() const
Definition docnode.h:434
Node representing an entry in the index.
Definition docnode.h:533
QCString entry() const
Definition docnode.h:540
Node representing an internal section of documentation.
Definition docnode.h:949
Node representing an internal reference to some item.
Definition docnode.h:787
QCString file() const
Definition docnode.h:791
QCString anchor() const
Definition docnode.h:793
Node representing a line break.
Definition docnode.h:201
Node representing a word that can be linked to something.
Definition docnode.h:164
QCString file() const
Definition docnode.h:170
QCString ref() const
Definition docnode.h:172
QCString word() const
Definition docnode.h:169
QCString anchor() const
Definition docnode.h:173
Node representing a msc file.
Definition docnode.h:702
DocNodeVariant * parent()
Definition docnode.h:89
Node representing an block of paragraphs.
Definition docnode.h:959
Node representing a paragraph in the documentation tree.
Definition docnode.h:1060
bool isLast() const
Definition docnode.h:1068
Node representing a parameter list.
Definition docnode.h:1105
const DocNodeList & parameters() const
Definition docnode.h:1109
const DocNodeList & paramTypes() const
Definition docnode.h:1110
DocParamSect::Direction direction() const
Definition docnode.h:1113
const DocNodeList & paragraphs() const
Definition docnode.h:1111
Node representing a parameter section.
Definition docnode.h:1033
bool hasInOutSpecifier() const
Definition docnode.h:1049
bool hasTypeSpecifier() const
Definition docnode.h:1050
Type type() const
Definition docnode.h:1048
Node representing a uml file.
Definition docnode.h:720
Node representing a reference to some item.
Definition docnode.h:758
QCString anchor() const
Definition docnode.h:765
SectionType sectionType() const
Definition docnode.h:767
QCString targetTitle() const
Definition docnode.h:766
bool isSubPage() const
Definition docnode.h:772
bool refToTable() const
Definition docnode.h:771
QCString file() const
Definition docnode.h:762
QCString ref() const
Definition docnode.h:764
bool refToSection() const
Definition docnode.h:770
bool hasLinkText() const
Definition docnode.h:768
Root node of documentation tree.
Definition docnode.h:1293
Node representing a reference to a section.
Definition docnode.h:915
bool refToTable() const
Definition docnode.h:923
QCString file() const
Definition docnode.h:919
QCString anchor() const
Definition docnode.h:920
QCString ref() const
Definition docnode.h:922
bool isSubPage() const
Definition docnode.h:924
Node representing a list of section references.
Definition docnode.h:939
Node representing a normal section.
Definition docnode.h:894
QCString file() const
Definition docnode.h:902
int level() const
Definition docnode.h:898
QCString anchor() const
Definition docnode.h:900
const DocNodeVariant * title() const
Definition docnode.h:899
Node representing a separator.
Definition docnode.h:346
QCString chars() const
Definition docnode.h:350
Node representing a simple list.
Definition docnode.h:970
Node representing a simple list item.
Definition docnode.h:1133
const DocNodeVariant * paragraph() const
Definition docnode.h:1137
Node representing a simple section.
Definition docnode.h:997
Type type() const
Definition docnode.h:1006
const DocNodeVariant * title() const
Definition docnode.h:1013
Node representing a separator between two simple sections of the same type.
Definition docnode.h:1024
Node representing a style change.
Definition docnode.h:264
Style style() const
Definition docnode.h:292
bool enable() const
Definition docnode.h:294
Node representing a special symbol.
Definition docnode.h:309
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:313
Root node of a text fragment.
Definition docnode.h:1284
Node representing a simple section title.
Definition docnode.h:589
Node representing a URL (or email address)
Definition docnode.h:187
QCString url() const
Definition docnode.h:191
bool isEmail() const
Definition docnode.h:192
Node representing a verbatim, unparsed text fragment.
Definition docnode.h:357
QCString srcFile() const
Definition docnode.h:378
int srcLine() const
Definition docnode.h:379
QCString height() const
Definition docnode.h:373
bool hasCaption() const
Definition docnode.h:371
QCString language() const
Definition docnode.h:369
const DocNodeList & children() const
Definition docnode.h:376
bool isExample() const
Definition docnode.h:366
QCString context() const
Definition docnode.h:365
Type type() const
Definition docnode.h:363
QCString text() const
Definition docnode.h:364
QCString exampleFile() const
Definition docnode.h:367
QCString engine() const
Definition docnode.h:374
bool useBitmap() const
Definition docnode.h:375
@ JavaDocLiteral
Definition docnode.h:359
QCString width() const
Definition docnode.h:372
Node representing a VHDL flow chart.
Definition docnode.h:729
CodeParserInterface & getCodeParser(const QCString &langExt)
void pushHidden(bool hide)
bool popHidden()
Node representing some amount of white space.
Definition docnode.h:335
QCString chars() const
Definition docnode.h:339
Node representing a word.
Definition docnode.h:152
QCString word() const
Definition docnode.h:155
Node representing an item of a cross-referenced list.
Definition docnode.h:601
QCString anchor() const
Definition docnode.h:605
QCString file() const
Definition docnode.h:604
QCString title() const
Definition docnode.h:606
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
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:31
const char * latex(SymType symb) const
Access routine to the LaTeX code of the HTML entity.
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
Generator for LaTeX code fragments.
Definition latexgen.h:28
QCString escapeMakeIndexChars(const char *s)
void writeDiaFile(const QCString &fileName, const DocVerbatim &s)
void setFirstRow(bool b)
RowSpanList & rowSpans()
void setCurrentColumn(size_t col)
static const int maxIndentLevels
void endLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)
bool firstRow() const
void endDotFile(bool hasCaption)
void operator()(const DocWord &)
void setInColSpan(bool b)
void visitCaption(const DocNodeList &children)
void addRowSpan(ActiveRowSpan &&span)
void setNumCols(size_t num)
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false)
OutputCodeList & m_ci
LatexDocVisitor(TextStream &t, OutputCodeList &ci, LatexCodeGenerator &lcg, const QCString &langExt, int hierarchyLevel=0)
size_t currentColumn() const
bool inRowSpan() const
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void filter(const QCString &str, const bool retainNewLine=false)
void endMscFile(bool hasCaption)
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void startPlantUmlFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
LatexListItemInfo m_listItemInfo[maxIndentLevels]
bool insideTable() const
void endDiaFile(bool hasCaption)
bool inColSpan() const
const char * getSectionName(int level) const
void writeMscFile(const QCString &fileName, const DocVerbatim &s)
void endPlantUmlFile(bool hasCaption)
void startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void setInRowSpan(bool b)
void visitChildren(const T &t)
LatexCodeGenerator & m_lcg
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
size_t numCols() const
Class representing a list of different code generators.
Definition outputlist.h:164
QCString 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:27
static PlantumlManager & instance()
Definition plantuml.cpp:156
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:127
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:504
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
const std::string & str() const
Definition qcstring.h:526
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
virtual QCString trPrecondition()=0
virtual QCString trSince()=0
virtual QCString trVersion()=0
virtual QCString trReturns()=0
virtual QCString trExceptions()=0
virtual QCString trRemarks()=0
virtual QCString trPageAbbreviation()=0
virtual QCString trNote()=0
virtual QCString trPostcondition()=0
virtual QCString trAttention()=0
virtual QCString trCopyright()=0
virtual QCString trDate()=0
virtual QCString trParameters()=0
virtual QCString trTemplateParameters()=0
virtual QCString trAuthor(bool first_capital, bool singular)=0
virtual QCString trWarning()=0
virtual QCString trSeeAlso()=0
virtual QCString trImportant()=0
virtual QCString trReturnValues()=0
virtual QCString trInvariant()=0
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:66
constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
returns true iff v holds one of types passed as template parameters
Definition docnode.h:1346
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:1310
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:265
Translator * theTranslator
Definition language.cpp:71
static void writeStartTableCommand(TextStream &t, const DocNodeVariant *n, size_t cols)
static const char * g_subparagraphLabel
static const int g_maxLevels
static bool tableIsNested(const DocNodeVariant *n)
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 writeEndTableCommand(TextStream &t, const DocNodeVariant *n)
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:84
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:156
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:661
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
SrcLangExt
Language as given by extension.
Definition types.h:42
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5549
QCString integerToRoman(int n, bool upper)
Definition util.cpp:7025
QCString stripPath(const QCString &s)
Definition util.cpp:5292
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:5841
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5567
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:6169
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5591
A bunch of utility functions.