Doxygen
latexdocvisitor.cpp
浏览该文件的文档.
1 /******************************************************************************
2  *
3  *
4  *
5  *
6  * Copyright (C) 1997-2015 by Dimitri van Heesch.
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation under the terms of the GNU General Public License is hereby
10  * granted. No representations are made about the suitability of this software
11  * for any purpose. It is provided "as is" without express or implied warranty.
12  * See the GNU General Public License for more details.
13  *
14  * Documents produced by Doxygen are derivative works derived from the
15  * input used in their production; they are not affected by this license.
16  *
17  */
18 
19 #include <algorithm>
20 
21 #include "htmlattrib.h"
22 #include "latexdocvisitor.h"
23 #include "latexgen.h"
24 #include "docparser.h"
25 #include "language.h"
26 #include "doxygen.h"
27 #include "outputgen.h"
28 #include "dot.h"
29 #include "util.h"
30 #include "message.h"
31 #include "parserintf.h"
32 #include "msc.h"
33 #include "dia.h"
34 #include "cite.h"
35 #include "filedef.h"
36 #include "config.h"
37 #include "htmlentity.h"
38 #include "emoji.h"
39 #include "plantuml.h"
40 #include "fileinfo.h"
41 
42 const int maxLevels=5;
43 static const char *secLabels[maxLevels] =
44  { "doxysection","doxysubsection","doxysubsubsection","doxyparagraph","doxysubparagraph" };
45 
46 static const char *getSectionName(int level)
47 {
48  static bool compactLatex = Config_getBool(COMPACT_LATEX);
49  int l = level;
50  if (compactLatex) l++;
51  if (Doxygen::insideMainPage) l--;
52  return secLabels[std::min(maxLevels-1,l)];
53 }
54 
55 static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage = FALSE)
56 {
57  if (inlineImage)
58  {
59  t << "\n\\begin{DoxyInlineImage}\n";
60  }
61  else
62  {
63  if (hasCaption)
64  {
65  t << "\n\\begin{DoxyImage}\n";
66  }
67  else
68  {
69  t << "\n\\begin{DoxyImageNoCaption}\n"
70  " \\mbox{";
71  }
72  }
73 
74  t << "\\includegraphics";
75  if (!width.isEmpty() || !height.isEmpty())
76  {
77  t << "[";
78  }
79  if (!width.isEmpty())
80  {
81  t << "width=" << width;
82  }
83  if (!width.isEmpty() && !height.isEmpty())
84  {
85  t << ",";
86  }
87  if (!height.isEmpty())
88  {
89  t << "height=" << height;
90  }
91  if (width.isEmpty() && height.isEmpty())
92  {
93  /* default setting */
94  if (inlineImage)
95  {
96  t << "[height=\\baselineskip,keepaspectratio=true]";
97  }
98  else
99  {
100  t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]";
101  }
102  }
103  else
104  {
105  t << "]";
106  }
107 
108  t << "{" << name << "}";
109 
110  if (hasCaption)
111  {
112  if (!inlineImage)
113  {
114  t << "\n\\doxyfigcaption{";
115  }
116  else
117  {
118  t << "%"; // to catch the caption
119  }
120  }
121 }
122 
123 
124 
125 static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage = FALSE)
126 {
127  if (inlineImage)
128  {
129  t << "\n\\end{DoxyInlineImage}\n";
130  }
131  else
132  {
133  t << "}\n"; // end mbox or caption
134  if (hasCaption)
135  {
136  t << "\\end{DoxyImage}\n";
137  }
138  else
139  {
140  t << "\\end{DoxyImageNoCaption}\n";
141  }
142  }
143 }
144 
145 
146 static void visitCaption(LatexDocVisitor *parent, const DocNodeList &children)
147 {
148  for (const auto &n : children) n->accept(parent);
149 }
150 
152 {
153  QCString result;
154  const char *p=s;
155  char str[2]; str[1]=0;
156  char c;
157  if (p)
158  {
159  while ((c=*p++))
160  {
161  switch (c)
162  {
163  case '!': m_t << "\"!"; break;
164  case '"': m_t << "\"\""; break;
165  case '@': m_t << "\"@"; break;
166  case '|': m_t << "\\texttt{\"|}"; break;
167  case '[': m_t << "["; break;
168  case ']': m_t << "]"; break;
169  case '{': m_t << "\\lcurly{}"; break;
170  case '}': m_t << "\\rcurly{}"; break;
171  default: str[0]=c; filter(str); break;
172  }
173  }
174  }
175  return result;
176 }
177 
178 
180  const QCString &langExt,bool insideTabbing)
181  : DocVisitor(DocVisitor_Latex), m_t(t), m_ci(ci), m_insidePre(FALSE),
182  m_insideItem(FALSE), m_hide(FALSE), m_hideCaption(FALSE),
183  m_insideTabbing(insideTabbing), m_langExt(langExt)
184 {
185 }
186 
187  //--------------------------------------
188  // visitor functions for leaf nodes
189  //--------------------------------------
190 
192 {
193  if (m_hide) return;
194  filter(w->word());
195 }
196 
198 {
199  if (m_hide) return;
200  startLink(w->ref(),w->file(),w->anchor());
201  filter(w->word());
202  endLink(w->ref(),w->file(),w->anchor());
203 }
204 
206 {
207  if (m_hide) return;
208  if (m_insidePre)
209  {
210  m_t << w->chars();
211  }
212  else
213  {
214  m_t << " ";
215  }
216 }
217 
219 {
220  if (m_hide) return;
221  bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
222  const char *res = HtmlEntityMapper::instance()->latex(s->symbol());
223  if (res)
224  {
225  if (((s->symbol() == DocSymbol::Sym_lt) || (s->symbol() == DocSymbol::Sym_Less))&& (!m_insidePre))
226  {
227  if (pdfHyperlinks)
228  {
229  m_t << "\\texorpdfstring{$<$}{<}";
230  }
231  else
232  {
233  m_t << "$<$";
234  }
235  }
236  else if (((s->symbol() == DocSymbol::Sym_gt) || (s->symbol() == DocSymbol::Sym_Greater)) && (!m_insidePre))
237  {
238  if (pdfHyperlinks)
239  {
240  m_t << "\\texorpdfstring{$>$}{>}";
241  }
242  else
243  {
244  m_t << "$>$";
245  }
246  }
247  else
248  {
249  m_t << res;
250  }
251  }
252  else
253  {
254  err("LaTeX: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE));
255  }
256 }
257 
259 {
260  if (m_hide) return;
261  QCString emojiName = EmojiEntityMapper::instance()->name(s->index());
262  if (!emojiName.isEmpty())
263  {
264  QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
265  m_t << "\\doxygenemoji{";
266  filter(emojiName);
267  m_t << "}{" << imageName << "}";
268  }
269  else
270  {
271  m_t << s->name();
272  }
273 }
274 
276 {
277  if (m_hide) return;
278  if (Config_getBool(PDF_HYPERLINKS))
279  {
280  m_t << "\\href{";
281  if (u->isEmail()) m_t << "mailto:";
282  m_t << latexFilterURL(u->url()) << "}";
283  }
284  m_t << "{\\texttt{ ";
285  filter(u->url());
286  m_t << "}}";
287 }
288 
290 {
291  if (m_hide) return;
292  m_t << "~\\newline\n";
293 }
294 
296 {
297  if (m_hide) return;
298  if (insideTable())
299  m_t << "\\DoxyHorRuler{1}\n";
300  else
301  m_t << "\\DoxyHorRuler{0}\n";
302 }
303 
305 {
306  if (m_hide) return;
307  switch (s->style())
308  {
310  if (s->enable()) m_t << "{\\bfseries{"; else m_t << "}}";
311  break;
312  case DocStyleChange::S:
314  case DocStyleChange::Del:
315  if (s->enable()) m_t << "\\sout{"; else m_t << "}";
316  break;
318  case DocStyleChange::Ins:
319  if (s->enable()) m_t << "\\uline{"; else m_t << "}";
320  break;
322  if (s->enable()) m_t << "{\\itshape "; else m_t << "}";
323  break;
325  if (s->enable()) m_t << "{\\ttfamily "; else m_t << "}";
326  break;
328  if (s->enable()) m_t << "\\textsubscript{"; else m_t << "}";
329  break;
331  if (s->enable()) m_t << "\\textsuperscript{"; else m_t << "}";
332  break;
334  if (s->enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
335  break;
337  if (s->enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
338  break;
340  if (s->enable())
341  {
342  m_t << "\n\\begin{DoxyPre}";
344  }
345  else
346  {
348  m_t << "\\end{DoxyPre}\n";
349  }
350  break;
351  case DocStyleChange::Div: /* HTML only */ break;
352  case DocStyleChange::Span: /* HTML only */ break;
353  }
354 }
355 
357 {
358  if (m_hide) return;
359  QCString lang = m_langExt;
360  if (!s->language().isEmpty()) // explicit language setting
361  {
362  lang = s->language();
363  }
364  SrcLangExt langExt = getLanguageFromCodeLang(lang);
365  switch(s->type())
366  {
367  case DocVerbatim::Code:
368  {
369  m_ci.startCodeFragment("DoxyCode");
370  getCodeParser(lang).parseCode(m_ci,s->context(),s->text(),langExt,
371  s->isExample(),s->exampleFile());
372  m_ci.endCodeFragment("DoxyCode");
373  }
374  break;
376  m_t << "\\begin{DoxyVerb}";
377  m_t << s->text();
378  m_t << "\\end{DoxyVerb}\n";
379  break;
385  /* nothing */
386  break;
388  m_t << s->text();
389  break;
390  case DocVerbatim::Dot:
391  {
392  static int dotindex = 1;
393  QCString fileName(4096);
394 
395  fileName.sprintf("%s%d%s",
396  qPrint(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_"),
397  dotindex++,
398  ".dot"
399  );
400  std::ofstream file(fileName.str(),std::ofstream::out | std::ofstream::binary);
401  if (!file.is_open())
402  {
403  err("Could not open file %s for writing\n",qPrint(fileName));
404  }
405  else
406  {
407  file.write( s->text().data(), s->text().length() );
408  file.close();
409 
410  startDotFile(fileName,s->width(),s->height(),s->hasCaption(),s->srcFile(),s->srcLine());
411  visitCaption(this, s->children());
412  endDotFile(s->hasCaption());
413 
414  if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
415  }
416  }
417  break;
418  case DocVerbatim::Msc:
419  {
420  static int mscindex = 1;
421  QCString baseName(4096);
422 
423  baseName.sprintf("%s%d",
424  qPrint(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_"),
425  mscindex++
426  );
427  std::string fileName = baseName.str()+".msc";
428  std::ofstream file(fileName,std::ofstream::out | std::ofstream::binary);
429  if (!file.is_open())
430  {
431  err("Could not open file %s for writing\n",fileName.c_str());
432  }
433  else
434  {
435  QCString text = "msc {";
436  text+=s->text();
437  text+="}";
438  file.write( text.data(), text.length() );
439  file.close();
440 
441  writeMscFile(baseName, s);
442 
443  if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName);
444  }
445  }
446  break;
448  {
449  QCString latexOutput = Config_getString(LATEX_OUTPUT);
451  latexOutput,s->exampleFile(),s->text(),
453  s->engine(),s->srcFile(),s->srcLine());
454 
455  writePlantUMLFile(baseName, s);
456  }
457  break;
458  }
459 }
460 
462 {
463  if (m_hide) return;
464  m_t << "\\label{" << stripPath(anc->file()) << "_" << anc->anchor() << "}%\n";
465  if (!anc->file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
466  {
467  m_t << "\\Hypertarget{" << stripPath(anc->file()) << "_" << anc->anchor()
468  << "}%\n";
469  }
470 }
471 
473 {
474  if (m_hide) return;
475  SrcLangExt langExt = getLanguageFromFileName(inc->extension());
476  switch(inc->type())
477  {
479  {
480  m_ci.startCodeFragment("DoxyCodeInclude");
481  FileInfo cfi( inc->file().str() );
482  FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
484  inc->text(),
485  langExt,
486  inc->isExample(),
487  inc->exampleFile(),
488  fd, // fileDef,
489  -1, // start line
490  -1, // end line
491  FALSE, // inline fragment
492  0, // memberDef
493  TRUE // show line numbers
494  );
495  delete fd;
496  m_ci.endCodeFragment("DoxyCodeInclude");
497  }
498  break;
499  case DocInclude::Include:
500  {
501  m_ci.startCodeFragment("DoxyCodeInclude");
503  inc->text(),langExt,inc->isExample(),
504  inc->exampleFile(),
505  0, // fileDef
506  -1, // startLine
507  -1, // endLine
508  TRUE, // inlineFragment
509  0, // memberDef
510  FALSE
511  );
512  m_ci.endCodeFragment("DoxyCodeInclude");
513  }
514  break;
522  break;
524  m_t << inc->text();
525  break;
527  m_t << "\n\\begin{DoxyVerbInclude}\n";
528  m_t << inc->text();
529  m_t << "\\end{DoxyVerbInclude}\n";
530  break;
531  case DocInclude::Snippet:
532  {
533  m_ci.startCodeFragment("DoxyCodeInclude");
535  inc->context(),
536  extractBlock(inc->text(),inc->blockId()),
537  langExt,
538  inc->isExample(),
539  inc->exampleFile()
540  );
541  m_ci.endCodeFragment("DoxyCodeInclude");
542  }
543  break;
545  {
546  FileInfo cfi( inc->file().str() );
547  FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
548  m_ci.startCodeFragment("DoxyCodeInclude");
550  inc->context(),
551  extractBlock(inc->text(),inc->blockId()),
552  langExt,
553  inc->isExample(),
554  inc->exampleFile(),
555  fd,
556  lineBlock(inc->text(),inc->blockId()),
557  -1, // endLine
558  FALSE, // inlineFragment
559  0, // memberDef
560  TRUE // show line number
561  );
562  delete fd;
563  m_ci.endCodeFragment("DoxyCodeInclude");
564  }
565  break;
568  err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
569  "Please create a bug report\n",__FILE__);
570  break;
571  }
572 }
573 
575 {
576  //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
577  // op->type(),op->isFirst(),op->isLast(),qPrint(op->text()));
578  if (op->isFirst())
579  {
580  if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
582  m_hide = TRUE;
583  }
584  QCString locLangExt = getFileNameExtension(op->includeFileName());
585  if (locLangExt.isEmpty()) locLangExt = m_langExt;
586  SrcLangExt langExt = getLanguageFromFileName(locLangExt);
587  if (op->type()!=DocIncOperator::Skip)
588  {
589  m_hide = popHidden();
590  if (!m_hide)
591  {
592  FileDef *fd = 0;
593  if (!op->includeFileName().isEmpty())
594  {
595  FileInfo cfi( op->includeFileName().str() );
596  fd = createFileDef( cfi.dirPath(), cfi.fileName() );
597  }
598 
599  getCodeParser(locLangExt).parseCode(m_ci,op->context(),op->text(),langExt,
600  op->isExample(),op->exampleFile(),
601  fd, // fileDef
602  op->line(), // startLine
603  -1, // endLine
604  FALSE, // inline fragment
605  0, // memberDef
606  op->showLineNo() // show line numbers
607  );
608  if (fd) delete fd;
609  }
611  m_hide=TRUE;
612  }
613  if (op->isLast())
614  {
615  m_hide=popHidden();
616  if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
617  }
618  else
619  {
620  if (!m_hide) m_t << "\n";
621  }
622 }
623 
625 {
626  if (m_hide) return;
627  QCString s = f->text();
628  const char *p = s.data();
629  char c;
630  if (p)
631  {
632  while ((c=*p++))
633  {
634  switch (c)
635  {
636  case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
637  default: m_t << c; break;
638  }
639  }
640  }
641 }
642 
644 {
645  if (m_hide) return;
646  m_t << "\\index{";
647  m_t << latexEscapeLabelName(i->entry());
648  m_t << "@{";
650  m_t << "}}";
651 }
652 
654 {
655 }
656 
658 {
659  if (m_hide) return;
660  if (!cite->file().isEmpty())
661  {
662  //startLink(cite->ref(),cite->file(),cite->anchor());
663  QCString anchor = cite->anchor();
665  anchor = anchor.mid(anchorPrefix.length()); // strip prefix
666  m_t << "\\cite{" << anchor << "}";
667  }
668  else
669  {
670  m_t << "{\\bfseries [";
671  filter(cite->text());
672  m_t << "]}";
673  }
674 }
675 
676 //--------------------------------------
677 // visitor functions for compound nodes
678 //--------------------------------------
679 
681 {
682  if (m_hide) return;
683  if (m_indentLevel>=maxIndentLevels-1) return;
684  if (l->isEnumList())
685  {
686  m_t << "\n\\begin{DoxyEnumerate}";
688  }
689  else
690  {
691  m_listItemInfo[indentLevel()].isEnum = false;
692  m_t << "\n\\begin{DoxyItemize}";
693  }
694 }
695 
697 {
698  if (m_hide) return;
699  if (m_indentLevel>=maxIndentLevels-1) return;
700  if (l->isEnumList())
701  {
702  m_t << "\n\\end{DoxyEnumerate}";
703  }
704  else
705  {
706  m_t << "\n\\end{DoxyItemize}";
707  }
708 }
709 
711 {
712  if (m_hide) return;
713  m_t << "\n\\item ";
714  incIndentLevel();
715 }
716 
718 {
719  decIndentLevel();
720 }
721 
723 {
724 }
725 
727 {
728  if (m_hide) return;
729  if (!p->isLast() && // omit <p> for last paragraph
730  !(p->parent() && // and for parameter sections
732  )
733  ) m_t << "\n\n";
734 }
735 
737 {
738  //if (r->indent()) incIndentLevel();
739 }
740 
742 {
743  //if (r->indent()) decIndentLevel();
744 }
745 
747 {
748  if (m_hide) return;
749  switch(s->type())
750  {
751  case DocSimpleSect::See:
752  m_t << "\\begin{DoxySeeAlso}{";
754  break;
756  m_t << "\\begin{DoxyReturn}{";
758  break;
760  m_t << "\\begin{DoxyAuthor}{";
762  break;
764  m_t << "\\begin{DoxyAuthor}{";
766  break;
768  m_t << "\\begin{DoxyVersion}{";
770  break;
772  m_t << "\\begin{DoxySince}{";
774  break;
775  case DocSimpleSect::Date:
776  m_t << "\\begin{DoxyDate}{";
778  break;
779  case DocSimpleSect::Note:
780  m_t << "\\begin{DoxyNote}{";
782  break;
784  m_t << "\\begin{DoxyWarning}{";
786  break;
787  case DocSimpleSect::Pre:
788  m_t << "\\begin{DoxyPrecond}{";
790  break;
791  case DocSimpleSect::Post:
792  m_t << "\\begin{DoxyPostcond}{";
794  break;
796  m_t << "\\begin{DoxyCopyright}{";
798  break;
800  m_t << "\\begin{DoxyInvariant}{";
802  break;
804  m_t << "\\begin{DoxyRemark}{";
806  break;
808  m_t << "\\begin{DoxyAttention}{";
810  break;
811  case DocSimpleSect::User:
812  m_t << "\\begin{DoxyParagraph}{";
813  break;
814  case DocSimpleSect::Rcs:
815  m_t << "\\begin{DoxyParagraph}{";
816  break;
817  case DocSimpleSect::Unknown: break;
818  }
819 
820  // special case 1: user defined title
821  if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs)
822  {
823  incIndentLevel();
824  m_t << "}\n";
825  }
826  else
827  {
829  }
830 }
831 
833 {
834  if (m_hide) return;
835  switch(s->type())
836  {
837  case DocSimpleSect::See:
838  m_t << "\n\\end{DoxySeeAlso}\n";
839  break;
841  m_t << "\n\\end{DoxyReturn}\n";
842  break;
844  m_t << "\n\\end{DoxyAuthor}\n";
845  break;
847  m_t << "\n\\end{DoxyAuthor}\n";
848  break;
850  m_t << "\n\\end{DoxyVersion}\n";
851  break;
853  m_t << "\n\\end{DoxySince}\n";
854  break;
855  case DocSimpleSect::Date:
856  m_t << "\n\\end{DoxyDate}\n";
857  break;
858  case DocSimpleSect::Note:
859  m_t << "\n\\end{DoxyNote}\n";
860  break;
862  m_t << "\n\\end{DoxyWarning}\n";
863  break;
864  case DocSimpleSect::Pre:
865  m_t << "\n\\end{DoxyPrecond}\n";
866  break;
867  case DocSimpleSect::Post:
868  m_t << "\n\\end{DoxyPostcond}\n";
869  break;
871  m_t << "\n\\end{DoxyCopyright}\n";
872  break;
874  m_t << "\n\\end{DoxyInvariant}\n";
875  break;
877  m_t << "\n\\end{DoxyRemark}\n";
878  break;
880  m_t << "\n\\end{DoxyAttention}\n";
881  break;
882  case DocSimpleSect::User:
883  m_t << "\n\\end{DoxyParagraph}\n";
884  break;
885  case DocSimpleSect::Rcs:
886  m_t << "\n\\end{DoxyParagraph}\n";
887  break;
888  default:
889  break;
890  }
891  decIndentLevel();
892 }
893 
895 {
896 }
897 
899 {
900  if (m_hide) return;
902  m_t << "}\n";
903 }
904 
906 {
907  if (m_hide) return;
908  m_t << "\\begin{DoxyItemize}\n";
909  m_listItemInfo[indentLevel()].isEnum = false;
910 }
911 
913 {
914  if (m_hide) return;
915  m_t << "\\end{DoxyItemize}\n";
916 }
917 
919 {
920  if (m_hide) return;
921  m_t << "\\item ";
922  incIndentLevel();
923 }
924 
926 {
927  decIndentLevel();
928 }
929 
931 {
932  if (m_hide) return;
933  if (Config_getBool(PDF_HYPERLINKS))
934  {
935  m_t << "\\hypertarget{" << stripPath(s->file()) << "_" << s->anchor() << "}{}";
936  }
937  m_t << "\\" << getSectionName(s->level()) << "{";
939  m_t << "}\\label{" << stripPath(s->file()) << "_" << s->anchor() << "}\n";
940 }
941 
943 {
944 }
945 
947 {
948  if (m_hide) return;
949  if (m_indentLevel>=maxIndentLevels-1) return;
951  if (s->type()==DocHtmlList::Ordered)
952  {
953  bool first = true;
954  m_t << "\n\\begin{DoxyEnumerate}";
955  for (const auto &opt : s->attribs())
956  {
957  if (opt.name=="type")
958  {
959  if (opt.value=="1")
960  {
961  m_t << (first ? "[": ",");
962  m_t << "label=\\arabic*";
963  first = false;
964  }
965  else if (opt.value=="a")
966  {
967  m_t << (first ? "[": ",");
968  m_t << "label=\\enumalphalphcnt*";
969  first = false;
970  }
971  else if (opt.value=="A")
972  {
973  m_t << (first ? "[": ",");
974  m_t << "label=\\enumAlphAlphcnt*";
975  first = false;
976  }
977  else if (opt.value=="i")
978  {
979  m_t << (first ? "[": ",");
980  m_t << "label=\\roman*";
981  first = false;
982  }
983  else if (opt.value=="I")
984  {
985  m_t << (first ? "[": ",");
986  m_t << "label=\\Roman*";
987  first = false;
988  }
989  }
990  else if (opt.name=="start")
991  {
992  m_t << (first ? "[": ",");
993  bool ok;
994  int val = opt.value.toInt(&ok);
995  if (ok) m_t << "start=" << val;
996  first = false;
997  }
998  }
999  if (!first) m_t << "]\n";
1000  }
1001  else
1002  m_t << "\n\\begin{DoxyItemize}";
1003 }
1004 
1006 {
1007  if (m_hide) return;
1008  if (m_indentLevel>=maxIndentLevels-1) return;
1009  if (s->type()==DocHtmlList::Ordered)
1010  m_t << "\n\\end{DoxyEnumerate}";
1011  else
1012  m_t << "\n\\end{DoxyItemize}";
1013 }
1014 
1016 {
1017  if (m_hide) return;
1018  if (m_listItemInfo[indentLevel()].isEnum)
1019  {
1020  for (const auto &opt : l->attribs())
1021  {
1022  if (opt.name=="value")
1023  {
1024  bool ok;
1025  int val = opt.value.toInt(&ok);
1026  if (ok)
1027  {
1028  m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1029  }
1030  }
1031  }
1032  }
1033  m_t << "\n\\item ";
1034  incIndentLevel();
1035 }
1036 
1038 {
1039  decIndentLevel();
1040 }
1041 
1042 //void LatexDocVisitor::visitPre(DocHtmlPre *)
1043 //{
1044 // m_t << "\\small\\begin{alltt}";
1045 // m_insidePre=TRUE;
1046 //}
1047 
1048 //void LatexDocVisitor::visitPost(DocHtmlPre *)
1049 //{
1050 // m_insidePre=FALSE;
1051 // m_t << "\\end{alltt}\\normalsize \n";
1052 //}
1053 
1054 
1055 static bool classEqualsReflist(const DocNode *n)
1056 {
1057  if (n->kind()==DocNode::Kind_HtmlDescList)
1058  {
1059  HtmlAttribList attrs = ((DocHtmlDescList *)n)->attribs();
1060  auto it = std::find_if(attrs.begin(),attrs.end(),
1061  [](const auto &att) { return att.name=="class"; });
1062  if (it!=attrs.end() && it->value == "reflist") return true;
1063  }
1064  return false;
1065 }
1066 
1067 
1068 static bool listIsNested(const DocNode *n)
1069 {
1070  bool isNested=false;
1071  if (n)
1072  {
1073  if (classEqualsReflist(n)) return false;
1074  n = n->parent();
1075  }
1076  while (n && !isNested)
1077  {
1078  if (n->kind()==DocNode::Kind_HtmlDescList)
1079  {
1080  isNested = !classEqualsReflist(n);
1081  }
1082  n = n->parent();
1083  }
1084  return isNested;
1085 }
1086 
1088 {
1089  if (m_hide) return;
1090  if (classEqualsReflist(dl))
1091  {
1092  m_t << "\n\\begin{DoxyRefList}";
1093  }
1094  else
1095  {
1096  if (listIsNested(dl)) m_t << "\n\\hfill";
1097  m_t << "\n\\begin{DoxyDescription}";
1098  }
1099 }
1100 
1102 {
1103  if (m_hide) return;
1104  if (classEqualsReflist(dl))
1105  {
1106  m_t << "\n\\end{DoxyRefList}";
1107  }
1108  else
1109  {
1110  m_t << "\n\\end{DoxyDescription}";
1111  }
1112 }
1113 
1115 {
1116  if (m_hide) return;
1117  m_t << "\n\\item[";
1119 }
1120 
1122 {
1123  if (m_hide) return;
1125  m_t << "]";
1126 }
1127 
1129 {
1130  incIndentLevel();
1131 }
1132 
1134 {
1135  decIndentLevel();
1136 }
1137 
1138 static bool tableIsNested(const DocNode *n)
1139 {
1140  bool isNested=FALSE;
1141  while (n && !isNested)
1142  {
1143  isNested = n->kind()==DocNode::Kind_HtmlTable || n->kind()==DocNode::Kind_ParamSect;
1144  n = n->parent();
1145  }
1146  return isNested;
1147 }
1148 
1149 static void writeStartTableCommand(TextStream &t,const DocNode *n,int cols)
1150 {
1151  if (tableIsNested(n))
1152  {
1153  t << "{\\begin{tabularx}{\\linewidth}{|*{" << cols << "}{>{\\raggedright\\arraybackslash}X|}}";
1154  }
1155  else
1156  {
1157  t << "\\tabulinesep=1mm\n\\begin{longtabu}spread 0pt [c]{*{" << cols << "}{|X[-1]}|}\n";
1158  }
1159  //return isNested ? "TabularNC" : "TabularC";
1160 }
1161 
1162 static void writeEndTableCommand(TextStream &t,const DocNode *n)
1163 {
1164  if (tableIsNested(n))
1165  {
1166  t << "\\end{tabularx}}\n";
1167  }
1168  else
1169  {
1170  t << "\\end{longtabu}\n";
1171  }
1172  //return isNested ? "TabularNC" : "TabularC";
1173 }
1174 
1176 {
1177  if (m_hide) return;
1178  pushTableState();
1179  if (t->hasCaption())
1180  {
1181  DocHtmlCaption *c = t->caption();
1182  static bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1183  if (!c->file().isEmpty() && pdfHyperLinks)
1184  {
1185  m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1186  << "}{}";
1187  }
1188  m_t << "\n";
1189  }
1190 
1192 
1193  if (t->hasCaption())
1194  {
1195  DocHtmlCaption *c = t->caption();
1196  m_t << "\\caption{";
1197  visitCaption(this, c->children());
1198  m_t << "}";
1199  m_t << "\\label{" << stripPath(c->file()) << "_" << c->anchor() << "}";
1200  m_t << "\\\\\n";
1201  }
1202 
1203  setNumCols((uint)t->numColumns());
1204  m_t << "\\hline\n";
1205 
1206  // check if first row is a heading and then render the row already here
1207  // and end it with \endfirsthead (triggered via m_firstRow==TRUE)
1208  // then repeat the row as normal and end it with \endhead (m_firstRow==FALSE)
1209  DocHtmlRow *firstRow = t->firstRow();
1210  if (firstRow && firstRow->isHeading())
1211  {
1212  setFirstRow(TRUE);
1213  DocNode *n = t->parent();
1214  if (!tableIsNested(n)) firstRow->accept(this);
1215  setFirstRow(FALSE);
1216  }
1217 }
1218 
1220 {
1221  if (m_hide) return;
1223  popTableState();
1224 }
1225 
1227 {
1229  m_hide = TRUE;
1230 }
1231 
1233 {
1235 }
1236 
1238 {
1239  setCurrentColumn(0);
1240 }
1241 
1243 {
1244  if (m_hide) return;
1245 
1246  DocNode *n = row->parent() ->parent();
1247 
1248  int c=currentColumn();
1249  while (c<=numCols()) // end of row while inside a row span?
1250  {
1251  for (const auto &span : rowSpans())
1252  {
1253  //printf(" found row span: column=%d rs=%d cs=%d rowIdx=%d cell->rowIdx=%d i=%d c=%d\n",
1254  // span->column, span->rowSpan,span->colSpan,row->rowIndex(),span->cell->rowIndex(),i,c);
1255  if (span.rowSpan>0 && span.column==c && // we are at a cell in a row span
1256  row->rowIndex()>span.cell->rowIndex() // but not the row that started the span
1257  )
1258  {
1259  m_t << "&";
1260  if (span.colSpan>1) // row span is also part of a column span
1261  {
1262  m_t << "\\multicolumn{" << span.colSpan << "}{";
1263  m_t << "}|}{}";
1264  }
1265  else // solitary row span
1266  {
1267  m_t << "\\multicolumn{1}{c|}{}";
1268  }
1269  }
1270  }
1271  c++;
1272  }
1273 
1274  m_t << "\\\\";
1275 
1276  int col = 1;
1277  for (auto &span : rowSpans())
1278  {
1279  if (span.rowSpan>0) span.rowSpan--;
1280  if (span.rowSpan<=0)
1281  {
1282  // inactive span
1283  }
1284  else if (span.column>col)
1285  {
1286  m_t << "\\cline{" << col << "-" << (span.column-1) << "}";
1287  col = span.column+span.colSpan;
1288  }
1289  else
1290  {
1291  col = span.column+span.colSpan;
1292  }
1293  }
1294 
1295  if (col <= numCols())
1296  {
1297  m_t << "\\cline{" << col << "-" << numCols() << "}";
1298  }
1299 
1300  m_t << "\n";
1301 
1302 
1303  if (row->isHeading() && row->rowIndex()==1 && !tableIsNested(n))
1304  {
1305  if (firstRow())
1306  {
1307  m_t << "\\endfirsthead\n";
1308  m_t << "\\hline\n";
1309  m_t << "\\endfoot\n";
1310  m_t << "\\hline\n";
1311  }
1312  else
1313  {
1314  m_t << "\\endhead\n";
1315  }
1316  }
1317 }
1318 
1320 {
1321  if (m_hide) return;
1322 
1323  DocHtmlRow *row = 0;
1324  if (c->parent() && c->parent()->kind()==DocNode::Kind_HtmlRow)
1325  {
1326  row = (DocHtmlRow*)c->parent();
1327  }
1328 
1330 
1331  //Skip columns that span from above.
1332  for (const auto &span : rowSpans())
1333  {
1334  if (span.rowSpan>0 && span.column==currentColumn())
1335  {
1336  if (row && span.colSpan>1)
1337  {
1338  m_t << "\\multicolumn{" << span.colSpan << "}{";
1339  if (currentColumn() /*c->columnIndex()*/==1) // add extra | for first column
1340  {
1341  m_t << "|";
1342  }
1343  m_t << "l|}{" << (c->isHeading()? "\\columncolor{\\tableheadbgcolor}" : "") << "}"; // alignment not relevant, empty column
1344  setCurrentColumn(currentColumn()+span.colSpan);
1345  }
1346  else
1347  {
1349  }
1350  m_t << "&";
1351  }
1352  }
1353 
1354  int cs = c->colSpan();
1355  int a = c->alignment();
1356  if (cs>1 && row)
1357  {
1358  setInColSpan(TRUE);
1359  m_t << "\\multicolumn{" << cs << "}{";
1360  if (c->columnIndex()==1) // add extra | for first column
1361  {
1362  m_t << "|";
1363  }
1364  switch (a)
1365  {
1366  case DocHtmlCell::Right:
1367  m_t << "r|}{";
1368  break;
1369  case DocHtmlCell::Center:
1370  m_t << "c|}{";
1371  break;
1372  default:
1373  m_t << "l|}{";
1374  break;
1375  }
1376  }
1377  int rs = c->rowSpan();
1378  int va = c->valignment();
1379  if (rs>0)
1380  {
1381  setInRowSpan(TRUE);
1382  m_t << "\\multirow";
1383  switch(va)
1384  {
1385  case DocHtmlCell::Top:
1386  m_t << "[t]";
1387  break;
1388  case DocHtmlCell::Bottom:
1389  m_t << "[b]";
1390  break;
1391  case DocHtmlCell::Middle:
1392  break; // No alignment option needed
1393  default:
1394  break;
1395  }
1396  //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%d\n",
1397  // c->rowIndex(),c->columnIndex(),c->rowSpan(),c->colSpan(),
1398  // currentColumn());
1400  m_t << "{" << rs << "}{*}{";
1401  }
1402  if (a==DocHtmlCell::Center)
1403  {
1404  m_t << "\\PBS\\centering ";
1405  }
1406  else if (a==DocHtmlCell::Right)
1407  {
1408  m_t << "\\PBS\\raggedleft ";
1409  }
1410  if (c->isHeading())
1411  {
1412  m_t << "\\cellcolor{\\tableheadbgcolor}\\textbf{ ";
1413  }
1414  if (cs>1)
1415  {
1417  }
1418 }
1419 
1421 {
1422  if (m_hide) return;
1423  if (c->isHeading())
1424  {
1425  m_t << "}";
1426  }
1427  if (inRowSpan())
1428  {
1430  m_t << "}";
1431  }
1432  if (inColSpan())
1433  {
1435  m_t << "}";
1436  }
1437  if (!c->isLast()) m_t << "&";
1438 }
1439 
1441 {
1442  if (m_hide) return;
1443  //m_t << "\\begin{DoxyInternal}{";
1444  //filter(theTranslator->trForInternalUseOnly());
1445  //m_t << "}\n";
1446 }
1447 
1449 {
1450  if (m_hide) return;
1451  //m_t << "\\end{DoxyInternal}\n";
1452 }
1453 
1455 {
1456  if (m_hide) return;
1457  if (Config_getBool(PDF_HYPERLINKS))
1458  {
1459  m_t << "\\href{";
1460  m_t << latexFilterURL(href->url());
1461  m_t << "}";
1462  }
1463  m_t << "{\\texttt{ ";
1464 }
1465 
1467 {
1468  if (m_hide) return;
1469  m_t << "}}";
1470 }
1471 
1473 {
1474  if (m_hide) return;
1475  m_t << "\\" << getSectionName(header->level()) << "*{";
1476 }
1477 
1479 {
1480  if (m_hide) return;
1481  m_t << "}";
1482 }
1484 {
1485  if (img->type()==DocImage::Latex)
1486  {
1487  if (m_hide) return;
1488  QCString gfxName = img->name();
1489  if (gfxName.right(4)==".eps" || gfxName.right(4)==".pdf")
1490  {
1491  gfxName=gfxName.left(gfxName.length()-4);
1492  }
1493 
1494  visitPreStart(m_t,img->hasCaption(), gfxName, img->width(), img->height(), img->isInlineImage());
1495  }
1496  else // other format -> skip
1497  {
1498  pushHidden(m_hide);
1499  m_hide=TRUE;
1500  }
1501 }
1502 
1504 {
1505  if (img->type()==DocImage::Latex)
1506  {
1507  if (m_hide) return;
1508  visitPostEnd(m_t,img->hasCaption(), img->isInlineImage());
1509  }
1510  else // other format
1511  {
1512  m_hide = popHidden();
1513  }
1514 }
1515 
1517 {
1518  if (m_hide) return;
1519  startDotFile(df->file(),df->width(),df->height(),df->hasCaption(),df->srcFile(),df->srcLine());
1520 }
1521 
1523 {
1524  if (m_hide) return;
1525  endDotFile(df->hasCaption());
1526 }
1528 {
1529  if (m_hide) return;
1530  startMscFile(df->file(),df->width(),df->height(),df->hasCaption(),df->srcFile(),df->srcLine());
1531 }
1532 
1534 {
1535  if (m_hide) return;
1536  endMscFile(df->hasCaption());
1537 }
1538 
1540 {
1541  if (m_hide) return;
1542  startDiaFile(df->file(),df->width(),df->height(),df->hasCaption(),df->srcFile(),df->srcLine());
1543 }
1544 
1546 {
1547  if (m_hide) return;
1548  endDiaFile(df->hasCaption());
1549 }
1551 {
1552  if (m_hide) return;
1553  startLink(lnk->ref(),lnk->file(),lnk->anchor());
1554 }
1555 
1557 {
1558  if (m_hide) return;
1559  endLink(lnk->ref(),lnk->file(),lnk->anchor());
1560 }
1561 
1563 {
1564  if (m_hide) return;
1565  // when ref->isSubPage()==TRUE we use ref->file() for HTML and
1566  // ref->anchor() for LaTeX/RTF
1567  if (ref->isSubPage())
1568  {
1569  startLink(ref->ref(),QCString(),ref->anchor());
1570  }
1571  else
1572  {
1573  if (!ref->file().isEmpty()) startLink(ref->ref(),ref->file(),ref->anchor(),ref->refToTable());
1574  }
1575  if (!ref->hasLinkText()) filter(ref->targetTitle());
1576 }
1577 
1579 {
1580  if (m_hide) return;
1581  if (ref->isSubPage())
1582  {
1583  endLink(ref->ref(),QCString(),ref->anchor());
1584  }
1585  else
1586  {
1587  if (!ref->file().isEmpty()) endLink(ref->ref(),ref->file(),ref->anchor(),ref->refToTable());
1588  }
1589 }
1590 
1592 {
1593  if (m_hide) return;
1594  m_t << "\\item \\contentsline{section}{";
1595  if (ref->isSubPage())
1596  {
1597  startLink(ref->ref(),QCString(),ref->anchor());
1598  }
1599  else
1600  {
1601  if (!ref->file().isEmpty())
1602  {
1603  startLink(ref->ref(),ref->file(),ref->anchor(),ref->refToTable());
1604  }
1605  }
1606 }
1607 
1609 {
1610  if (m_hide) return;
1611  if (ref->isSubPage())
1612  {
1613  endLink(ref->ref(),QCString(),ref->anchor());
1614  }
1615  else
1616  {
1617  if (!ref->file().isEmpty()) endLink(ref->ref(),ref->file(),ref->anchor(),ref->refToTable());
1618  }
1619  m_t << "}{\\ref{";
1620  if (!ref->file().isEmpty()) m_t << stripPath(ref->file());
1621  if (!ref->file().isEmpty() && !ref->anchor().isEmpty()) m_t << "_";
1622  if (!ref->anchor().isEmpty()) m_t << ref->anchor();
1623  m_t << "}}{}\n";
1624 }
1625 
1627 {
1628  if (m_hide) return;
1629  m_t << "\\footnotesize\n";
1630  m_t << "\\begin{multicols}{2}\n";
1631  m_t << "\\begin{DoxyCompactList}\n";
1632  incIndentLevel();
1633 }
1634 
1636 {
1637  if (m_hide) return;
1638  decIndentLevel();
1639  m_t << "\\end{DoxyCompactList}\n";
1640  m_t << "\\end{multicols}\n";
1641  m_t << "\\normalsize\n";
1642 }
1643 
1645 {
1646  if (m_hide) return;
1647  bool hasInOutSpecs = s->hasInOutSpecifier();
1648  bool hasTypeSpecs = s->hasTypeSpecifier();
1650  switch(s->type())
1651  {
1652  case DocParamSect::Param:
1653  m_t << "\n\\begin{DoxyParams}";
1654  if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1655  else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1656  m_t << "{";
1658  break;
1659  case DocParamSect::RetVal:
1660  m_t << "\n\\begin{DoxyRetVals}{";
1662  break;
1664  m_t << "\n\\begin{DoxyExceptions}{";
1666  break;
1668  m_t << "\n\\begin{DoxyTemplParams}{";
1670  break;
1671  default:
1672  ASSERT(0);
1673  incIndentLevel();
1674  }
1675  m_t << "}\n";
1676 }
1677 
1679 {
1680  if (m_hide) return;
1682  switch(s->type())
1683  {
1684  case DocParamSect::Param:
1685  m_t << "\\end{DoxyParams}\n";
1686  break;
1687  case DocParamSect::RetVal:
1688  m_t << "\\end{DoxyRetVals}\n";
1689  break;
1691  m_t << "\\end{DoxyExceptions}\n";
1692  break;
1694  m_t << "\\end{DoxyTemplParams}\n";
1695  break;
1696  default:
1697  ASSERT(0);
1698  decIndentLevel();
1699  }
1700 }
1701 
1703 {
1704  if (m_hide) return;
1706  DocParamSect *sect = 0;
1707  if (pl->parent() && pl->parent()->kind()==DocNode::Kind_ParamSect)
1708  {
1709  parentType = ((DocParamSect*)pl->parent())->type();
1710  sect=(DocParamSect*)pl->parent();
1711  }
1712  bool useTable = parentType==DocParamSect::Param ||
1713  parentType==DocParamSect::RetVal ||
1714  parentType==DocParamSect::Exception ||
1715  parentType==DocParamSect::TemplateParam;
1716  if (!useTable)
1717  {
1718  m_t << "\\item[";
1719  }
1720  if (sect && sect->hasInOutSpecifier())
1721  {
1723  {
1724  m_t << "\\mbox{\\texttt{ ";
1725  if (pl->direction()==DocParamSect::In)
1726  {
1727  m_t << "in";
1728  }
1729  else if (pl->direction()==DocParamSect::Out)
1730  {
1731  m_t << "out";
1732  }
1733  else if (pl->direction()==DocParamSect::InOut)
1734  {
1735  m_t << "in,out";
1736  }
1737  m_t << "}} ";
1738  }
1739  if (useTable) m_t << " & ";
1740  }
1741  if (sect && sect->hasTypeSpecifier())
1742  {
1743  for (const auto &type : pl->paramTypes())
1744  {
1745  if (type->kind()==DocNode::Kind_Word)
1746  {
1747  visit((DocWord*)type.get());
1748  }
1749  else if (type->kind()==DocNode::Kind_LinkedWord)
1750  {
1751  visit((DocLinkedWord*)type.get());
1752  }
1753  else if (type->kind()==DocNode::Kind_Sep)
1754  {
1755  m_t << " " << ((DocSeparator *)type.get())->chars() << " ";
1756  }
1757  }
1758  if (useTable) m_t << " & ";
1759  }
1760  m_t << "{\\em ";
1761  bool first=TRUE;
1762  for (const auto &param : pl->parameters())
1763  {
1764  if (!first) m_t << ","; else first=FALSE;
1766  if (param->kind()==DocNode::Kind_Word)
1767  {
1768  visit((DocWord*)param.get());
1769  }
1770  else if (param->kind()==DocNode::Kind_LinkedWord)
1771  {
1772  visit((DocLinkedWord*)param.get());
1773  }
1775  }
1776  m_t << "}";
1777  if (useTable)
1778  {
1779  m_t << " & ";
1780  }
1781  else
1782  {
1783  m_t << "]";
1784  }
1785 }
1786 
1788 {
1789  if (m_hide) return;
1791  if (pl->parent() && pl->parent()->kind()==DocNode::Kind_ParamSect)
1792  {
1793  parentType = ((DocParamSect*)pl->parent())->type();
1794  }
1795  bool useTable = parentType==DocParamSect::Param ||
1796  parentType==DocParamSect::RetVal ||
1797  parentType==DocParamSect::Exception ||
1798  parentType==DocParamSect::TemplateParam;
1799  if (useTable)
1800  {
1801  m_t << "\\\\\n"
1802  << "\\hline\n";
1803  }
1804 }
1805 
1807 {
1808  static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1809  if (m_hide) return;
1810  if (x->title().isEmpty()) return;
1811  incIndentLevel();
1812  m_t << "\\begin{DoxyRefDesc}{";
1813  filter(x->title());
1814  m_t << "}\n";
1815  bool anonymousEnum = x->file()=="@";
1816  m_t << "\\item[";
1817  if (pdfHyperlinks && !anonymousEnum)
1818  {
1819  m_t << "\\mbox{\\hyperlink{" << stripPath(x->file()) << "_" << x->anchor() << "}{";
1820  }
1821  else
1822  {
1823  m_t << "\\textbf{ ";
1824  }
1826  filter(x->title());
1828  if (pdfHyperlinks && !anonymousEnum)
1829  {
1830  m_t << "}";
1831  }
1832  m_t << "}]";
1833 }
1834 
1836 {
1837  if (m_hide) return;
1838  if (x->title().isEmpty()) return;
1839  decIndentLevel();
1840  m_t << "\\end{DoxyRefDesc}\n";
1841 }
1842 
1844 {
1845  if (m_hide) return;
1846  startLink(QCString(),ref->file(),ref->anchor());
1847 }
1848 
1850 {
1851  if (m_hide) return;
1852  endLink(QCString(),ref->file(),ref->anchor());
1853 }
1854 
1856 {
1857 }
1858 
1860 {
1861 }
1862 
1864 {
1865  if (m_hide) return;
1866  m_t << "\\begin{quote}\n";
1867  incIndentLevel();
1868 }
1869 
1871 {
1872  if (m_hide) return;
1873  m_t << "\\end{quote}\n";
1874  decIndentLevel();
1875 }
1876 
1878 {
1879  if (m_hide) return;
1880 }
1881 
1883 {
1884  if (m_hide) return;
1885 }
1886 
1888 {
1889  if (m_hide) return;
1890 }
1891 
1893 {
1894  if (m_hide) return;
1895 }
1896 
1898 {
1899  filterLatexString(m_t,str,
1901  m_insidePre,
1902  m_insideItem,
1903  m_ci.usedTableLevel()>0, // insideTable
1904  false // keepSpaces
1905  );
1906 }
1907 
1908 void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,bool refToTable)
1909 {
1910  static bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1911  if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1912  {
1913  if (refToTable)
1914  {
1915  m_t << "\\doxytablelink{";
1916  }
1917  else
1918  {
1919  m_t << "\\mbox{\\hyperlink{";
1920  }
1921  if (!file.isEmpty()) m_t << stripPath(file);
1922  if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1923  if (!anchor.isEmpty()) m_t << anchor;
1924  m_t << "}{";
1925  }
1926  else if (ref.isEmpty() && refToTable)
1927  {
1928  m_t << "\\doxytableref{";
1929  }
1930  else if (ref.isEmpty()) // internal non-PDF link
1931  {
1932  m_t << "\\doxyref{";
1933  }
1934  else // external link
1935  {
1936  m_t << "\\textbf{ ";
1937  }
1938 }
1939 
1940 void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool refToTable)
1941 {
1942  m_t << "}";
1943  static bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1944  if (ref.isEmpty() && !pdfHyperLinks)
1945  {
1946  m_t << "{";
1948  m_t << "}{" << file;
1949  if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1950  m_t << anchor << "}";
1951  }
1952  if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1953  {
1954  if (!refToTable)
1955  {
1956  m_t << "}";
1957  }
1958  }
1959 }
1960 
1962  const QCString &width,
1963  const QCString &height,
1964  bool hasCaption,
1965  const QCString &srcFile,
1966  int srcLine
1967  )
1968 {
1969  QCString baseName=fileName;
1970  int i;
1971  if ((i=baseName.findRev('/'))!=-1)
1972  {
1973  baseName=baseName.right(baseName.length()-i-1);
1974  }
1975  if ((i=baseName.find('.'))!=-1)
1976  {
1977  baseName=baseName.left(i);
1978  }
1979  baseName.prepend("dot_");
1980  QCString outDir = Config_getString(LATEX_OUTPUT);
1981  QCString name = fileName;
1982  writeDotGraphFromFile(name,outDir,baseName,GOF_EPS,srcFile,srcLine);
1983  visitPreStart(m_t,hasCaption, baseName, width, height);
1984 }
1985 
1986 void LatexDocVisitor::endDotFile(bool hasCaption)
1987 {
1988  if (m_hide) return;
1989  visitPostEnd(m_t,hasCaption);
1990 }
1991 
1993  const QCString &width,
1994  const QCString &height,
1995  bool hasCaption,
1996  const QCString &srcFile,
1997  int srcLine
1998  )
1999 {
2000  QCString baseName=fileName;
2001  int i;
2002  if ((i=baseName.findRev('/'))!=-1)
2003  {
2004  baseName=baseName.right(baseName.length()-i-1);
2005  }
2006  if ((i=baseName.find('.'))!=-1)
2007  {
2008  baseName=baseName.left(i);
2009  }
2010  baseName.prepend("msc_");
2011 
2012  QCString outDir = Config_getString(LATEX_OUTPUT);
2013  writeMscGraphFromFile(fileName,outDir,baseName,MSC_EPS,srcFile,srcLine);
2014  visitPreStart(m_t,hasCaption, baseName, width, height);
2015 }
2016 
2017 void LatexDocVisitor::endMscFile(bool hasCaption)
2018 {
2019  if (m_hide) return;
2020  visitPostEnd(m_t,hasCaption);
2021 }
2022 
2023 
2025 {
2026  QCString shortName = baseName;
2027  int i;
2028  if ((i=shortName.findRev('/'))!=-1)
2029  {
2030  shortName=shortName.right(shortName.length()-i-1);
2031  }
2032  QCString outDir = Config_getString(LATEX_OUTPUT);
2033  writeMscGraphFromFile(baseName+".msc",outDir,shortName,MSC_EPS,s->srcFile(),s->srcLine());
2034  visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height());
2035  visitCaption(this, s->children());
2036  visitPostEnd(m_t, s->hasCaption());
2037 }
2038 
2039 
2041  const QCString &width,
2042  const QCString &height,
2043  bool hasCaption,
2044  const QCString &srcFile,
2045  int srcLine
2046  )
2047 {
2048  QCString baseName=fileName;
2049  int i;
2050  if ((i=baseName.findRev('/'))!=-1)
2051  {
2052  baseName=baseName.right(baseName.length()-i-1);
2053  }
2054  if ((i=baseName.find('.'))!=-1)
2055  {
2056  baseName=baseName.left(i);
2057  }
2058  baseName.prepend("dia_");
2059 
2060  QCString outDir = Config_getString(LATEX_OUTPUT);
2061  writeDiaGraphFromFile(fileName,outDir,baseName,DIA_EPS,srcFile,srcLine);
2062  visitPreStart(m_t,hasCaption, baseName, width, height);
2063 }
2064 
2065 void LatexDocVisitor::endDiaFile(bool hasCaption)
2066 {
2067  if (m_hide) return;
2068  visitPostEnd(m_t,hasCaption);
2069 }
2070 
2071 
2073 {
2074  QCString shortName = baseName;
2075  int i;
2076  if ((i=shortName.findRev('/'))!=-1)
2077  {
2078  shortName=shortName.right(shortName.length()-i-1);
2079  }
2080  QCString outDir = Config_getString(LATEX_OUTPUT);
2081  writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DIA_EPS,s->srcFile(),s->srcLine());
2082  visitPreStart(m_t, s->hasCaption(), shortName, s->width(), s->height());
2083  visitCaption(this, s->children());
2084  visitPostEnd(m_t, s->hasCaption());
2085 }
2086 
2088 {
2089  QCString shortName = baseName;
2090  int i;
2091  if ((i=shortName.findRev('/'))!=-1)
2092  {
2093  shortName=shortName.right(shortName.length()-i-1);
2094  }
2095  if (s->useBitmap())
2096  {
2097  if (shortName.find('.')==-1) shortName += ".png";
2098  }
2099  QCString outDir = Config_getString(LATEX_OUTPUT);
2102  visitPreStart(m_t, s->hasCaption(), shortName, s->width(), s->height());
2103  visitCaption(this, s->children());
2104  visitPostEnd(m_t, s->hasCaption());
2105 }
2106 
2108 {
2109  return std::min(m_indentLevel,maxIndentLevels-1);
2110 }
2111 
2113 {
2114  m_indentLevel++;
2116  {
2117  err("Maximum indent level (%d) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2118  }
2119 }
2120 
2122 {
2123  if (m_indentLevel>0)
2124  {
2125  m_indentLevel--;
2126  }
2127 }
2128 
DocHtmlBlockQuote
Node representing an HTML blockquote
Definition: docparser.h:1433
DocAutoListItem
Node representing an item of a auto list
Definition: docparser.h:720
writeDiaGraphFromFile
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition: dia.cpp:26
PlantumlManager::writePlantUMLSource
QCString writePlantUMLSource(const QCString &outDir, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine)
Write a PlantUML compatible file.
Definition: plantuml.cpp:26
DocHRef
Node representing a Hypertext reference
Definition: docparser.h:936
DocStyleChange
Node representing a style change
Definition: docparser.h:343
DocVerbatim::isExample
bool isExample() const
Definition: docparser.h:522
HtmlEntityMapper::latex
const char * latex(DocSymbol::SymType symb) const
Access routine to the LaTeX code of the HTML entity
Definition: htmlentity.cpp:426
DocVerbatim
Node representing a verbatim, unparsed text fragment
Definition: docparser.h:510
DocHtmlTable::caption
DocHtmlCaption * caption() const
Definition: docparser.h:1419
Translator::trCopyright
virtual QCString trCopyright()=0
integerToRoman
QCString integerToRoman(int n, bool upper)
Definition: util.cpp:7363
DocParamList::paramTypes
DocNodeList & paramTypes()
Definition: docparser.h:1239
DocTitle
Node representing a simple section title
Definition: docparser.h:736
writeStartTableCommand
static void writeStartTableCommand(TextStream &t, const DocNode *n, int cols)
Definition: latexdocvisitor.cpp:1149
DocXRefItem::file
QCString file() const
Definition: docparser.h:754
Translator::trPostcondition
virtual QCString trPostcondition()=0
DocPara
Node representing a paragraph in the documentation tree
Definition: docparser.h:1178
DocImage::isInlineImage
bool isInlineImage() const
Definition: docparser.h:785
fileinfo.h
latexgen.h
DocInclude::HtmlInclude
@ HtmlInclude
Definition: docparser.h:566
DocParamSect::In
@ In
Definition: docparser.h:1160
DocHtmlCell::rowSpan
uint rowSpan() const
Definition: docparser.cpp:3341
LatexDocVisitor::firstRow
bool firstRow() const
Definition: latexdocvisitor.h:259
latexFilterURL
QCString latexFilterURL(const QCString &s)
Definition: util.cpp:5197
LatexDocVisitor::endMscFile
void endMscFile(bool hasCaption)
Definition: latexdocvisitor.cpp:2017
cite.h
DocSimpleSect::Return
@ Return
Definition: docparser.h:1116
DocHtmlCell::alignment
Alignment alignment() const
Definition: docparser.cpp:3365
DocHtmlCell::colSpan
uint colSpan() const
Definition: docparser.cpp:3353
DocImage::width
QCString width() const
Definition: docparser.h:781
DocVerbatim::text
QCString text() const
Definition: docparser.h:519
DocDotFile
Node representing a dot file
Definition: docparser.h:830
DocVisitor::pushHidden
void pushHidden(bool hide)
Definition: docvisitor.cpp:62
DocHtmlTable
Node representing a HTML table
Definition: docparser.h:1405
LatexDocVisitor::m_indentLevel
int m_indentLevel
Definition: latexdocvisitor.h:210
Translator::trNote
virtual QCString trNote()=0
LatexDocVisitor::m_listItemInfo
LatexListItemInfo m_listItemInfo[maxIndentLevels]
Definition: latexdocvisitor.h:217
DIA_EPS
@ DIA_EPS
Definition: dia.h:23
DocIncOperator::showLineNo
bool showLineNo() const
Definition: docparser.h:629
LatexDocVisitor::m_insideTabbing
bool m_insideTabbing
Definition: latexdocvisitor.h:194
DocSimpleSect::Warning
@ Warning
Definition: docparser.h:1117
Dir::remove
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition: dir.cpp:256
DocHtmlCaption::file
QCString file() const
Definition: docparser.h:1360
Dir
Class representing a directory in the file system
Definition: dir.h:68
DocNode::Kind_Word
@ Kind_Word
Definition: docparser.h:101
visitCaption
static void visitCaption(LatexDocVisitor *parent, const DocNodeList &children)
Definition: latexdocvisitor.cpp:146
DocRoot
Root node of documentation tree
Definition: docparser.h:1457
LatexCodeGenerator::startCodeFragment
void startCodeFragment(const QCString &style) override
Definition: latexgen.cpp:247
DocVerbatim::HtmlOnly
@ HtmlOnly
Definition: docparser.h:513
visitPreStart
static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage=FALSE)
Definition: latexdocvisitor.cpp:55
getSectionName
static const char * getSectionName(int level)
Definition: latexdocvisitor.cpp:46
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
DocStyleChange::Center
@ Center
Definition: docparser.h:349
HtmlAttribList
Class representing a list of HTML attributes.
Definition: htmlattrib.h:30
DocImage::hasCaption
bool hasCaption() const
Definition: docparser.h:780
LatexDocVisitor::m_insidePre
bool m_insidePre
Definition: latexdocvisitor.h:190
DocVisitor::popHidden
bool popHidden()
Definition: docvisitor.cpp:67
DocHtmlHeader
Node Html heading
Definition: docparser.h:957
DocParamSect::Out
@ Out
Definition: docparser.h:1160
DocSimpleSect::Unknown
@ Unknown
Definition: docparser.h:1116
LatexDocVisitor::endDiaFile
void endDiaFile(bool hasCaption)
Definition: latexdocvisitor.cpp:2065
DocStyleChange::Strike
@ Strike
Definition: docparser.h:356
DocVerbatim::context
QCString context() const
Definition: docparser.h:520
LatexDocVisitor::rowSpans
RowSpanList & rowSpans()
Definition: latexdocvisitor.h:267
QCString::findRev
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:86
DocDiagramFileBase::height
QCString height() const
Definition: docparser.h:813
DocParamSect::InOut
@ InOut
Definition: docparser.h:1160
Translator::trExceptions
virtual QCString trExceptions()=0
DocInclude::Snippet
@ Snippet
Definition: docparser.h:567
DocHtmlListItem
Node representing a HTML list item
Definition: docparser.h:1286
DocHtmlRow::rowIndex
uint rowIndex() const
Definition: docparser.h:1395
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
DocHtmlTable::numColumns
size_t numColumns() const
Definition: docparser.h:1417
DocStyleChange::Del
@ Del
Definition: docparser.h:358
DocRef::isSubPage
bool isSubPage() const
Definition: docparser.h:906
LatexDocVisitor::m_insideItem
bool m_insideItem
Definition: latexdocvisitor.h:191
DocVhdlFlow
Node representing a VHDL flow chart
Definition: docparser.h:860
DocNode
Abstract node interface with type information.
Definition: docparser.h:96
LatexDocVisitor::writePlantUMLFile
void writePlantUMLFile(const QCString &fileName, DocVerbatim *s)
Definition: latexdocvisitor.cpp:2087
DocInclude::isExample
bool isExample() const
Definition: docparser.h:588
visitPostEnd
static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)
Definition: latexdocvisitor.cpp:125
DocVerbatim::Msc
@ Msc
Definition: docparser.h:513
DocDiagramFileBase::file
QCString file() const
Definition: docparser.h:809
DocHtmlDescData
Node representing a HTML description data
Definition: docparser.h:1303
DocSimpleSect::type
Type type() const
Definition: docparser.h:1122
LatexDocVisitor::visitPost
void visitPost(DocAutoList *)
Definition: latexdocvisitor.cpp:696
DocHtmlDescTitle
Node representing a Html description item
Definition: docparser.h:973
DocAnchor::anchor
QCString anchor() const
Definition: docparser.h:308
DocInclude::XmlInclude
@ XmlInclude
Definition: docparser.h:568
DocVerbatim::PlantUML
@ PlantUML
Definition: docparser.h:513
msc.h
DocEmoji
Node representing a n emoji
Definition: docparser.h:469
DocRef::ref
QCString ref() const
Definition: docparser.h:899
latexdocvisitor.h
DocLinkedWord::anchor
QCString anchor() const
Definition: docparser.h:242
DocInternalRef::anchor
QCString anchor() const
Definition: docparser.h:927
DocStyleChange::Italic
@ Italic
Definition: docparser.h:347
DocMscFile
Node representing a msc file
Definition: docparser.h:840
SrcLangExt
SrcLangExt
Language as given by extension
Definition: types.h:41
Translator::trReturns
virtual QCString trReturns()=0
DocHtmlRow::isHeading
bool isHeading() const
Definition: docparser.h:1382
LatexDocVisitor::escapeMakeIndexChars
QCString escapeMakeIndexChars(const char *s)
Definition: latexdocvisitor.cpp:151
DocNode::Kind_HtmlDescList
@ Kind_HtmlDescList
Definition: docparser.h:118
DocVerbatim::Code
@ Code
Definition: docparser.h:513
htmlattrib.h
DocStyleChange::Bold
@ Bold
Definition: docparser.h:346
DocRef::targetTitle
QCString targetTitle() const
Definition: docparser.h:901
DocInclude::IncludeDoc
@ IncludeDoc
Definition: docparser.h:567
DocRef::anchor
QCString anchor() const
Definition: docparser.h:900
DocEmoji::name
QCString name() const
Definition: docparser.h:473
DocVerbatim::RtfOnly
@ RtfOnly
Definition: docparser.h:513
QCString::str
std::string str() const
Definition: qcstring.h:442
DocIncOperator::exampleFile
QCString exampleFile() const
Definition: docparser.h:639
DocParamSect::TemplateParam
@ TemplateParam
Definition: docparser.h:1156
DocVerbatim::type
Type type() const
Definition: docparser.h:518
DocIndexEntry::entry
QCString entry() const
Definition: docparser.h:691
DocHtmlTable::hasCaption
bool hasCaption()
Definition: docparser.h:1413
DocSecRefItem
Node representing a reference to a section
Definition: docparser.h:1023
classEqualsReflist
static bool classEqualsReflist(const DocNode *n)
Definition: latexdocvisitor.cpp:1055
DocStyleChange::Span
@ Span
Definition: docparser.h:354
PlantumlManager::instance
static PlantumlManager & instance()
Definition: plantuml.cpp:124
MSC_EPS
@ MSC_EPS
Definition: msc.h:22
DocAnchor
Node representing an anchor
Definition: docparser.h:303
LatexCodeGenerator::decUsedTableLevel
void decUsedTableLevel()
Definition: latexgen.h:60
DocFormula::text
QCString text() const
Definition: docparser.h:664
DocXRefItem::anchor
QCString anchor() const
Definition: docparser.h:755
DocNode::Kind_HtmlRow
@ Kind_HtmlRow
Definition: docparser.h:122
Translator::trPrecondition
virtual QCString trPrecondition()=0
DocRef::hasLinkText
bool hasLinkText() const
Definition: docparser.h:902
DocStyleChange::Superscript
@ Superscript
Definition: docparser.h:352
err
void err(const char *fmt,...)
Definition: message.cpp:203
DocInclude::text
QCString text() const
Definition: docparser.h:585
DocDiagramFileBase::srcLine
int srcLine() const
Definition: docparser.h:816
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
LatexDocVisitor::ActiveRowSpan
Definition: latexdocvisitor.h:140
QCString::find
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:38
DocText
Root node of a text fragment
Definition: docparser.h:1447
CitationManager::instance
static CitationManager & instance()
Definition: cite.cpp:56
DocHtmlList::attribs
const HtmlAttribList & attribs() const
Definition: docparser.h:1101
DocVisitor
Abstract visitor that participates in the visitor pattern.
Definition: docvisitor.h:92
LatexDocVisitor::pushTableState
void pushTableState()
Definition: latexdocvisitor.h:219
LatexDocVisitor::writeDiaFile
void writeDiaFile(const QCString &fileName, DocVerbatim *s)
Definition: latexdocvisitor.cpp:2072
DocSimpleSect::Author
@ Author
Definition: docparser.h:1116
DocHtmlCell::Middle
@ Middle
Definition: docparser.h:1321
LatexDocVisitor::setInColSpan
void setInColSpan(bool b)
Definition: latexdocvisitor.h:255
DocSimpleSect::Note
@ Note
Definition: docparser.h:1117
DocURL::isEmail
bool isEmail() const
Definition: docparser.h:264
LatexDocVisitor::endDotFile
void endDotFile(bool hasCaption)
Definition: latexdocvisitor.cpp:1986
DocInclude::DocbookInclude
@ DocbookInclude
Definition: docparser.h:568
DocImage::name
QCString name() const
Definition: docparser.h:779
DocInclude::DontInclude
@ DontInclude
Definition: docparser.h:566
HtmlEntityMapper::instance
static HtmlEntityMapper * instance()
Returns the one and only instance of the HTML entity mapper
Definition: htmlentity.cpp:341
DocInclude::VerbInclude
@ VerbInclude
Definition: docparser.h:566
DocHtmlCell::Top
@ Top
Definition: docparser.h:1321
DocIncOperator::isFirst
bool isFirst() const
Definition: docparser.h:634
LatexDocVisitor::LatexListItemInfo::isEnum
bool isEnum
Definition: latexdocvisitor.h:214
DocFormula
Node representing an item of a cross-referenced list
Definition: docparser.h:658
LatexDocVisitor::addRowSpan
void addRowSpan(ActiveRowSpan &&span)
Definition: latexdocvisitor.h:271
DocVerbatim::DocbookOnly
@ DocbookOnly
Definition: docparser.h:513
listIsNested
static bool listIsNested(const DocNode *n)
Definition: latexdocvisitor.cpp:1068
DocLinkedWord::word
QCString word() const
Definition: docparser.h:237
DocHtmlDescList
Node representing a Html description list
Definition: docparser.h:987
LatexDocVisitor::startDiaFile
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
Definition: latexdocvisitor.cpp:2040
DocVisitor::getCodeParser
CodeParserInterface & getCodeParser(const QCString &langExt)
Definition: docvisitor.cpp:41
DocIncOperator
Node representing a include/dontinclude operator block
Definition: docparser.h:606
DocSymbol::symbol
SymType symbol() const
Definition: docparser.h:459
DocHtmlList::Ordered
@ Ordered
Definition: docparser.h:1096
DocIndexEntry
Node representing an entry in the index.
Definition: docparser.h:682
LatexDocVisitor::startDotFile
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
Definition: latexdocvisitor.cpp:1961
DocSymbol::Sym_Less
@ Sym_Less
Definition: docparser.h:445
DocSimpleSect::User
@ User
Definition: docparser.h:1117
DocSecRefList
Node representing a list of section references
Definition: docparser.h:1048
secLabels
static const char * secLabels[maxLevels]
Definition: latexdocvisitor.cpp:43
DocHtmlTable::firstRow
DocHtmlRow * firstRow() const
Definition: docparser.h:1420
Translator::trSeeAlso
virtual QCString trSeeAlso()=0
DocLineBreak
Node representing a line break
Definition: docparser.h:272
DocWord
Node representing a word
Definition: docparser.h:217
DocSymbol
Node representing a special symbol
Definition: docparser.h:385
uint
unsigned uint
Definition: qcstring.h:40
EmojiEntityMapper::name
const char * name(int index) const
Access routine to the name of the Emoji entity
Definition: emoji.cpp:1590
LatexDocVisitor::m_langExt
QCString m_langExt
Definition: latexdocvisitor.h:195
outputgen.h
LatexDocVisitor::LatexDocVisitor
LatexDocVisitor(TextStream &t, LatexCodeGenerator &ci, const QCString &langExt, bool insideTabbing)
Definition: latexdocvisitor.cpp:179
dot.h
extractBlock
QCString extractBlock(const QCString &text, const QCString &marker)
Returns the section of text, in between a pair of markers.
Definition: util.cpp:6453
PlantumlManager::PUML_BITMAP
@ PUML_BITMAP
Definition: plantuml.h:44
DocXRefItem
Node representing an item of a cross-referenced list
Definition: docparser.h:749
DocURL::url
QCString url() const
Definition: docparser.h:261
DocSection::level
int level() const
Definition: docparser.h:1007
DocSecRefItem::refToTable
bool refToTable() const
Definition: docparser.h:1033
createFileDef
FileDef * createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition: filedef.cpp:190
DocImage
Node representing an image
Definition: docparser.h:771
DocSecRefItem::ref
QCString ref() const
Definition: docparser.h:1032
DocNode::kind
virtual Kind kind() const =0
DocInclude::file
QCString file() const
Definition: docparser.h:577
Translator::trVersion
virtual QCString trVersion()=0
DocNodeList
std::vector< std::unique_ptr< DocNode > > DocNodeList
Definition: docparser.h:190
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
DocURL
Node representing a URL (or email address)
Definition: docparser.h:256
message.h
writeDotGraphFromFile
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition: dot.cpp:272
DocParamSect::Unspecified
@ Unspecified
Definition: docparser.h:1160
DocSimpleSect::See
@ See
Definition: docparser.h:1116
LatexDocVisitor::decIndentLevel
void decIndentLevel()
Definition: latexdocvisitor.cpp:2121
DocHtmlCaption
Node representing a HTML table caption
Definition: docparser.h:1352
DocIncOperator::isExample
bool isExample() const
Definition: docparser.h:638
DocStyleChange::Ins
@ Ins
Definition: docparser.h:359
DocHtmlCell::Right
@ Right
Definition: docparser.h:1320
DocInclude::SnipWithLines
@ SnipWithLines
Definition: docparser.h:567
LatexDocVisitor::visit
void visit(DocWord *)
Definition: latexdocvisitor.cpp:191
DocImage::Latex
@ Latex
Definition: docparser.h:774
DocParamList
Node representing a parameter list.
Definition: docparser.h:1228
DocSimpleSect::Rcs
@ Rcs
Definition: docparser.h:1117
Translator::trAttention
virtual QCString trAttention()=0
theTranslator
Translator * theTranslator
Definition: language.cpp:156
LatexDocVisitor::setFirstRow
void setFirstRow(bool b)
Definition: latexdocvisitor.h:263
LatexDocVisitor::startMscFile
void startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
Definition: latexdocvisitor.cpp:1992
DocSecRefItem::file
QCString file() const
Definition: docparser.h:1029
doxygen.h
DocSeparator
Node representing a separator
Definition: docparser.h:497
LatexDocVisitor::m_ci
LatexCodeGenerator & m_ci
Definition: latexdocvisitor.h:189
parserintf.h
DocInternalRef::file
QCString file() const
Definition: docparser.h:925
DocIncOperator::Skip
@ Skip
Definition: docparser.h:609
DocVerbatim::exampleFile
QCString exampleFile() const
Definition: docparser.h:523
DocParBlock
Node representing an block of paragraphs
Definition: docparser.h:1070
DocVerbatim::ManOnly
@ ManOnly
Definition: docparser.h:513
DocSimpleSectSep
Node representing a separator between two simple sections of the same type.
Definition: docparser.h:1139
language.h
LatexDocVisitor::endLink
void endLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=FALSE)
Definition: latexdocvisitor.cpp:1940
LatexCodeGenerator
Definition: latexgen.h:28
DocVisitor_Latex
const int DocVisitor_Latex
Definition: docvisitor.h:25
stripPath
QCString stripPath(const QCString &s)
Definition: util.cpp:5318
LatexDocVisitor
Concrete visitor implementation for LaTeX output.
Definition: latexdocvisitor.h:29
DocHRef::url
QCString url() const
Definition: docparser.h:943
LatexDocVisitor::incIndentLevel
void incIndentLevel()
Definition: latexdocvisitor.cpp:2112
DocIncOperator::line
int line() const
Definition: docparser.h:628
DocVerbatim::useBitmap
bool useBitmap() const
Definition: docparser.h:531
Translator::trPageAbbreviation
virtual QCString trPageAbbreviation()=0
latexEscapeLabelName
QCString latexEscapeLabelName(const QCString &s)
Definition: util.cpp:5086
DocStyleChange::Small
@ Small
Definition: docparser.h:350
DocCite
Node representing a citation of some bibliographic reference
Definition: docparser.h:321
Translator::trParameters
virtual QCString trParameters()=0
LatexCodeGenerator::usedTableLevel
int usedTableLevel() const
Definition: latexgen.h:61
LatexDocVisitor::currentColumn
int currentColumn() const
Definition: latexdocvisitor.h:227
DocRef
Node representing a reference to some item
Definition: docparser.h:891
DocSimpleSect::Date
@ Date
Definition: docparser.h:1116
docparser.h
getLanguageFromFileName
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition: util.cpp:5574
TRUE
#define TRUE
Definition: qcstring.h:36
DocSimpleSect::Authors
@ Authors
Definition: docparser.h:1116
DocSymbol::Sym_Greater
@ Sym_Greater
Definition: docparser.h:445
LatexDocVisitor::m_t
TextStream & m_t
Definition: latexdocvisitor.h:188
DocParamSect
Node representing a parameter section
Definition: docparser.h:1150
DocInclude::IncWithLines
@ IncWithLines
Definition: docparser.h:567
DocVerbatim::children
const DocNodeList & children() const
Definition: docparser.h:532
maxLevels
const int maxLevels
Definition: latexdocvisitor.cpp:42
DocVerbatim::srcFile
QCString srcFile() const
Definition: docparser.h:534
DocHtmlList
Node representing a Html list
Definition: docparser.h:1093
filedef.h
DocHtmlCaption::anchor
QCString anchor() const
Definition: docparser.h:1361
Translator::trRemarks
virtual QCString trRemarks()=0
LatexDocVisitor::maxIndentLevels
static const int maxIndentLevels
Definition: latexdocvisitor.h:209
lineBlock
int lineBlock(const QCString &text, const QCString &marker)
Returns the line number of the line following the line with the marker.
Definition: util.cpp:6498
dia.h
DocNode::Kind_ParamSect
@ Kind_ParamSect
Definition: docparser.h:143
DocRef::file
QCString file() const
Definition: docparser.h:897
DocVerbatim::hasCaption
bool hasCaption() const
Definition: docparser.h:527
DocParamSect::type
Type type() const
Definition: docparser.h:1167
LatexDocVisitor::setInRowSpan
void setInRowSpan(bool b)
Definition: latexdocvisitor.h:247
DocParamList::direction
DocParamSect::Direction direction() const
Definition: docparser.h:1241
DocSimpleSect
Node representing a simple section
Definition: docparser.h:1111
DocSection
Node representing a normal section
Definition: docparser.h:1001
DocHorRuler
Node representing a horizontal ruler
Definition: docparser.h:288
DocVerbatim::language
QCString language() const
Definition: docparser.h:525
tableIsNested
static bool tableIsNested(const DocNode *n)
Definition: latexdocvisitor.cpp:1138
LatexDocVisitor::setNumCols
void setNumCols(int num)
Definition: latexdocvisitor.h:239
DocAnchor::file
QCString file() const
Definition: docparser.h:309
DocWord::word
QCString word() const
Definition: docparser.h:221
DocInclude
Node representing an included text block from file
Definition: docparser.h:563
DocNode::Kind_HtmlTable
@ Kind_HtmlTable
Definition: docparser.h:121
DocStyleChange::Subscript
@ Subscript
Definition: docparser.h:351
DocLinkedWord::ref
QCString ref() const
Definition: docparser.h:241
CodeParserInterface::parseCode
virtual void parseCode(CodeOutputInterface &codeOutIntf, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=0, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=0, bool showLineNumbers=TRUE, const Definition *searchCtx=0, bool collectXRefs=TRUE)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
DocAutoList
Node representing an auto List
Definition: docparser.h:703
Translator::trSince
virtual QCString trSince()=0
LatexCodeGenerator::endCodeFragment
void endCodeFragment(const QCString &style) override
Definition: latexgen.cpp:252
DocImage::height
QCString height() const
Definition: docparser.h:782
DocNode::Kind_Sep
@ Kind_Sep
Definition: docparser.h:154
DocWhiteSpace::chars
QCString chars() const
Definition: docparser.h:490
DocNode::Kind_LinkedWord
@ Kind_LinkedWord
Definition: docparser.h:142
DocXRefItem::title
QCString title() const
Definition: docparser.h:756
DocInternal
Node representing an internal section of documentation
Definition: docparser.h:1059
Translator::trInvariant
virtual QCString trInvariant()=0
DocParamSect::Exception
@ Exception
Definition: docparser.h:1156
writeMscGraphFromFile
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition: msc.cpp:92
DocHtmlList::type
Type type() const
Definition: docparser.h:1100
DocInclude::RtfInclude
@ RtfInclude
Definition: docparser.h:568
DocInclude::SnippetDoc
@ SnippetDoc
Definition: docparser.h:567
DocSymbol::Sym_lt
@ Sym_lt
Definition: docparser.h:433
DocInclude::LatexInclude
@ LatexInclude
Definition: docparser.h:566
LatexDocVisitor::indentLevel
int indentLevel() const
Definition: latexdocvisitor.cpp:2107
DocParamSect::hasTypeSpecifier
bool hasTypeSpecifier() const
Definition: docparser.h:1169
DocSection::title
QCString title() const
Definition: docparser.h:1008
DocEmoji::index
int index() const
Definition: docparser.h:474
QCString::mid
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition: qcstring.h:224
FileInfo::dirPath
std::string dirPath(bool absPath=true) const
Definition: fileinfo.cpp:137
DocCite::anchor
QCString anchor() const
Definition: docparser.h:329
DocVerbatim::engine
QCString engine() const
Definition: docparser.h:530
DocStyleChange::style
Style style() const
Definition: docparser.h:368
DocLinkedWord
Node representing a word that can be linked to something
Definition: docparser.h:231
DocStyleChange::Code
@ Code
Definition: docparser.h:348
DocDiagramFileBase::hasCaption
bool hasCaption() const
Definition: docparser.h:811
LatexCodeGenerator::incUsedTableLevel
void incUsedTableLevel()
Definition: latexgen.h:59
DocInclude::Include
@ Include
Definition: docparser.h:566
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
DocCite::file
QCString file() const
Definition: docparser.h:326
LatexDocVisitor::m_hideCaption
bool m_hideCaption
Definition: latexdocvisitor.h:193
DocDiagramFileBase::width
QCString width() const
Definition: docparser.h:812
DocHtmlCell::isHeading
bool isHeading() const
Definition: docparser.h:1324
LatexDocVisitor::filter
void filter(const QCString &str)
Definition: latexdocvisitor.cpp:1897
DocDiagramFileBase::srcFile
QCString srcFile() const
Definition: docparser.h:815
DocIncOperator::type
Type type() const
Definition: docparser.h:616
PlantumlManager::PUML_EPS
@ PUML_EPS
Definition: plantuml.h:44
getLanguageFromCodeLang
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command
Definition: util.cpp:5592
DocParamSect::Type
Type
Definition: docparser.h:1154
DocParamSect::Param
@ Param
Definition: docparser.h:1156
DocSection::file
QCString file() const
Definition: docparser.h:1011
DocAutoList::isEnumList
bool isEnumList() const
Definition: docparser.h:708
DocSimpleSect::Copyright
@ Copyright
Definition: docparser.h:1117
DocDiaFile
Node representing a dia file
Definition: docparser.h:850
DocParamSect::Unknown
@ Unknown
Definition: docparser.h:1156
DocVerbatim::LatexOnly
@ LatexOnly
Definition: docparser.h:513
FileInfo
Minimal replacement for QFileInfo.
Definition: fileinfo.h:22
DocSecRefItem::isSubPage
bool isSubPage() const
Definition: docparser.h:1034
LatexDocVisitor::inColSpan
bool inColSpan() const
Definition: latexdocvisitor.h:251
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
DocHtmlCell::Bottom
@ Bottom
Definition: docparser.h:1321
writeEndTableCommand
static void writeEndTableCommand(TextStream &t, const DocNode *n)
Definition: latexdocvisitor.cpp:1162
DocStyleChange::Preformatted
@ Preformatted
Definition: docparser.h:353
LatexDocVisitor::insideTable
bool insideTable() const
Definition: latexdocvisitor.h:275
LatexDocVisitor::numCols
int numCols() const
Definition: latexdocvisitor.h:235
Config_getString
#define Config_getString(name)
Definition: config.h:32
DocInclude::blockId
QCString blockId() const
Definition: docparser.h:587
DocStyleChange::enable
bool enable() const
Definition: docparser.h:370
Doxygen::insideMainPage
static bool insideMainPage
Definition: doxygen.h:84
LatexDocVisitor::visitPre
void visitPre(DocAutoList *)
Definition: latexdocvisitor.cpp:680
DocSection::anchor
QCString anchor() const
Definition: docparser.h:1009
config.h
DocSimpleSect::Post
@ Post
Definition: docparser.h:1117
convertCharEntitiesToUTF8
QCString convertCharEntitiesToUTF8(const QCString &str)
Definition: util.cpp:4170
DocSimpleSect::Pre
@ Pre
Definition: docparser.h:1117
DocSimpleList
Node representing a simple list
Definition: docparser.h:1082
DocSimpleSect::Remark
@ Remark
Definition: docparser.h:1117
ASSERT
#define ASSERT(x)
Definition: qcstring.h:44
getFileNameExtension
QCString getFileNameExtension(const QCString &fn)
Definition: util.cpp:5621
DocLinkedWord::file
QCString file() const
Definition: docparser.h:239
DocRef::refToTable
bool refToTable() const
Definition: docparser.h:905
QCString::data
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:153
DocStyleChange::Underline
@ Underline
Definition: docparser.h:357
DocSimpleListItem
Node representing a simple list item
Definition: docparser.h:1266
emoji.h
DocIncOperator::includeFileName
QCString includeFileName() const
Definition: docparser.h:640
FileDef
A model of a file symbol.
Definition: filedef.h:73
DocInclude::type
Type type() const
Definition: docparser.h:584
CompAccept::children
const DocNodeList & children() const
Definition: docparser.h:207
DocWhiteSpace
Node representing some amount of white space
Definition: docparser.h:484
DocVerbatim::XmlOnly
@ XmlOnly
Definition: docparser.h:513
DocVerbatim::height
QCString height() const
Definition: docparser.h:529
DocParamSect::RetVal
@ RetVal
Definition: docparser.h:1156
plantuml.h
DocInclude::DontIncWithLines
@ DontIncWithLines
Definition: docparser.h:568
DocHtmlCell::columnIndex
uint columnIndex() const
Definition: docparser.h:1334
DocIncOperator::context
QCString context() const
Definition: docparser.h:632
DocStyleChange::Div
@ Div
Definition: docparser.h:355
EmojiEntityMapper::instance
static EmojiEntityMapper * instance()
Returns the one and only instance of the Emoji entity mapper
Definition: emoji.cpp:1536
FileInfo::fileName
std::string fileName() const
Definition: fileinfo.cpp:118
DocSymbol::Sym_gt
@ Sym_gt
Definition: docparser.h:433
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DocHtmlCell
Node representing a HTML table cell
Definition: docparser.h:1316
GOF_EPS
@ GOF_EPS
Definition: dotgraph.h:27
DocHtmlCell::isLast
bool isLast() const
Definition: docparser.h:1326
DocInclude::extension
QCString extension() const
Definition: docparser.h:578
LatexDocVisitor::inRowSpan
bool inRowSpan() const
Definition: latexdocvisitor.h:243
DocCite::text
QCString text() const
Definition: docparser.h:330
PlantumlManager::generatePlantUMLOutput
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition: plantuml.cpp:91
Translator::trDate
virtual QCString trDate()=0
htmlentity.h
DocParamSect::hasInOutSpecifier
bool hasInOutSpecifier() const
Definition: docparser.h:1168
DocInternalRef
Node representing an internal reference to some item
Definition: docparser.h:919
filterLatexString
void filterLatexString(TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces)
Definition: util.cpp:4934
DocVerbatim::width
QCString width() const
Definition: docparser.h:528
DocParamList::parameters
DocNodeList & parameters()
Definition: docparser.h:1238
DocStyleChange::S
@ S
Definition: docparser.h:360
DocVerbatim::Verbatim
@ Verbatim
Definition: docparser.h:513
util.h
A bunch of utility functions.
DocHtmlCell::Center
@ Center
Definition: docparser.h:1320
DocHtmlCell::valignment
Valignment valignment() const
Definition: docparser.cpp:3403
DocSecRefItem::anchor
QCString anchor() const
Definition: docparser.h:1030
DocImage::type
Type type() const
Definition: docparser.h:778
DocVerbatim::srcLine
int srcLine() const
Definition: docparser.h:535
DocHtmlRow
Node representing a HTML table row
Definition: docparser.h:1371
LatexDocVisitor::setCurrentColumn
void setCurrentColumn(int col)
Definition: latexdocvisitor.h:231
latexEscapeIndexChars
QCString latexEscapeIndexChars(const QCString &s)
Definition: util.cpp:5129
LatexDocVisitor::m_hide
bool m_hide
Definition: latexdocvisitor.h:192
DocInclude::ManInclude
@ ManInclude
Definition: docparser.h:568
QCString::right
QCString right(size_t len) const
Definition: qcstring.h:217
QCString::prepend
QCString & prepend(const char *s)
Definition: qcstring.h:339
DocSimpleSect::Invar
@ Invar
Definition: docparser.h:1117
QCString::sprintf
QCString & sprintf(const char *format,...)
Definition: qcstring.cpp:24
DocIncOperator::isLast
bool isLast() const
Definition: docparser.h:635
LatexDocVisitor::startLink
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=FALSE)
Definition: latexdocvisitor.cpp:1908
DocSimpleSect::Version
@ Version
Definition: docparser.h:1116
CitationManager::anchorPrefix
QCString anchorPrefix() const
Definition: cite.cpp:101
Translator::trTemplateParameters
virtual QCString trTemplateParameters()=0
LatexDocVisitor::writeMscFile
void writeMscFile(const QCString &fileName, DocVerbatim *s)
Definition: latexdocvisitor.cpp:2024
DocHtmlHeader::level
int level() const
Definition: docparser.h:962
DocInclude::exampleFile
QCString exampleFile() const
Definition: docparser.h:589
LatexDocVisitor::popTableState
void popTableState()
Definition: latexdocvisitor.h:223
DocIncOperator::text
QCString text() const
Definition: docparser.h:630
FALSE
#define FALSE
Definition: qcstring.h:33
DocSimpleSect::Since
@ Since
Definition: docparser.h:1116
Translator::trReturnValues
virtual QCString trReturnValues()=0
Translator::trAuthor
virtual QCString trAuthor(bool first_capital, bool singular)=0
Translator::trWarning
virtual QCString trWarning()=0
DocSimpleSect::Attention
@ Attention
Definition: docparser.h:1117
DocPara::isLast
bool isLast() const
Definition: docparser.h:1189
DocInclude::context
QCString context() const
Definition: docparser.h:586
DocHtmlListItem::attribs
const HtmlAttribList & attribs() const
Definition: docparser.h:1293
DocVerbatim::Dot
@ Dot
Definition: docparser.h:513
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108