Skip to main content

The LatexDocVisitor Class Reference

Concrete visitor implementation for LaTeX output. More...

Declaration

class LatexDocVisitor { ... }

Included Headers

Base class

classDocVisitor

Helper base class for functionality shared by all visitors. More...

Private Member Typedefs Index

typedefstd::vector< ActiveRowSpan > RowSpanList

Public Constructors Index

LatexDocVisitor (TextStream &t, OutputCodeList &ci, LatexCodeGenerator &lcg, const QCString &langExt, int hierarchyLevel=0)

Public Operators Index

voidoperator() (const DocWord &)
voidoperator() (const DocLinkedWord &)
voidoperator() (const DocWhiteSpace &)
voidoperator() (const DocSymbol &)
voidoperator() (const DocEmoji &)
voidoperator() (const DocURL &)
voidoperator() (const DocLineBreak &)
voidoperator() (const DocHorRuler &)
voidoperator() (const DocStyleChange &)
voidoperator() (const DocVerbatim &)
voidoperator() (const DocAnchor &)
voidoperator() (const DocInclude &)
voidoperator() (const DocIncOperator &)
voidoperator() (const DocFormula &)
voidoperator() (const DocIndexEntry &)
voidoperator() (const DocSimpleSectSep &)
voidoperator() (const DocCite &)
voidoperator() (const DocSeparator &)
voidoperator() (const DocAutoList &)
voidoperator() (const DocAutoListItem &)
voidoperator() (const DocPara &)
voidoperator() (const DocRoot &)
voidoperator() (const DocSimpleSect &)
voidoperator() (const DocTitle &)
voidoperator() (const DocSimpleList &)
voidoperator() (const DocSimpleListItem &)
voidoperator() (const DocSection &s)
voidoperator() (const DocHtmlList &s)
voidoperator() (const DocHtmlListItem &)
voidoperator() (const DocHtmlDescList &)
voidoperator() (const DocHtmlDescTitle &)
voidoperator() (const DocHtmlDescData &)
voidoperator() (const DocHtmlTable &t)
voidoperator() (const DocHtmlCaption &)
voidoperator() (const DocHtmlRow &)
voidoperator() (const DocHtmlCell &)
voidoperator() (const DocInternal &)
voidoperator() (const DocHRef &)
voidoperator() (const DocHtmlSummary &)
voidoperator() (const DocHtmlDetails &)
voidoperator() (const DocHtmlHeader &)
voidoperator() (const DocImage &)
voidoperator() (const DocDotFile &)
voidoperator() (const DocMscFile &)
voidoperator() (const DocDiaFile &)
voidoperator() (const DocPlantUmlFile &)
voidoperator() (const DocLink &lnk)
voidoperator() (const DocRef &ref)
voidoperator() (const DocSecRefItem &)
voidoperator() (const DocSecRefList &)
voidoperator() (const DocParamSect &)
voidoperator() (const DocParamList &)
voidoperator() (const DocXRefItem &)
voidoperator() (const DocInternalRef &)
voidoperator() (const DocText &)
voidoperator() (const DocHtmlBlockQuote &)
voidoperator() (const DocVhdlFlow &)
voidoperator() (const DocParBlock &)

Private Member Functions Index

template <class T>
voidvisitChildren (const T &t)
voidfilter (const QCString &str, const bool retainNewLine=false)
voidstartLink (const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false)
voidendLink (const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)
QCStringescapeMakeIndexChars (const char *s)
voidstartDotFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
voidendDotFile (bool hasCaption)
voidstartMscFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
voidendMscFile (bool hasCaption)
voidwriteMscFile (const QCString &fileName, const DocVerbatim &s)
voidstartDiaFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
voidendDiaFile (bool hasCaption)
voidwriteDiaFile (const QCString &fileName, const DocVerbatim &s)
voidwritePlantUMLFile (const QCString &fileName, const DocVerbatim &s)
voidstartPlantUmlFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
voidendPlantUmlFile (bool hasCaption)
voidvisitCaption (const DocNodeList &children)
voidincIndentLevel ()
voiddecIndentLevel ()
intindentLevel () const
const char *getSectionName (int level) const
voidpushTableState ()
voidpopTableState ()
size_tcurrentColumn () const
voidsetCurrentColumn (size_t col)
size_tnumCols () const
voidsetNumCols (size_t num)
boolinRowSpan () const
voidsetInRowSpan (bool b)
boolinColSpan () const
voidsetInColSpan (bool b)
boolfirstRow () const
voidsetFirstRow (bool b)
RowSpanList &rowSpans ()
voidaddRowSpan (ActiveRowSpan &&span)
boolinsideTable () const
boolisTableNested (const DocNodeVariant *n) const
voidwriteStartTableCommand (const DocNodeVariant *n, size_t cols)
voidwriteEndTableCommand (const DocNodeVariant *n)

Private Member Attributes Index

TextStream &m_t
OutputCodeList &m_ci
LatexCodeGenerator &m_lcg
boolm_insidePre
boolm_insideItem
boolm_hide
QCStringm_langExt
intm_hierarchyLevel
TexOrPdfm_texOrPdf = TexOrPdf::NO
std::stack< TableState >m_tableStateStack
RowSpanListm_emptyRowSpanList
intm_indentLevel = 0
LatexListItemInfom_listItemInfo[maxIndentLevels]

Private Static Attributes Index

static const intmaxIndentLevels = 13

Description

Concrete visitor implementation for LaTeX output.

Definition at line 37 of file latexdocvisitor.h.

Private Member Typedefs

RowSpanList

typedef std::vector<ActiveRowSpan> LatexDocVisitor::RowSpanList

Definition at line 131 of file latexdocvisitor.h.

131 typedef std::vector<ActiveRowSpan> RowSpanList;

Public Constructors

LatexDocVisitor()

LatexDocVisitor::LatexDocVisitor (TextStream & t, OutputCodeList & ci, LatexCodeGenerator & lcg, const QCString & langExt, int hierarchyLevel=0)

Declaration at line 40 of file latexdocvisitor.h, definition at line 268 of file latexdocvisitor.cpp.

269 const QCString &langExt, int hierarchyLevel)
270 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(FALSE),
272 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
273{
274}

References FALSE, m_ci, m_hide, m_hierarchyLevel, m_insideItem, m_insidePre, m_langExt, m_lcg and m_t.

Public Operators

operator()()

void LatexDocVisitor::operator() (const DocWord & w)

Declaration at line 47 of file latexdocvisitor.h, definition at line 280 of file latexdocvisitor.cpp.

281{
282 if (m_hide) return;
283 filter(w.word());
284}

References filter, m_hide and DocWord::word.

operator()()

void LatexDocVisitor::operator() (const DocLinkedWord & w)

Declaration at line 48 of file latexdocvisitor.h, definition at line 286 of file latexdocvisitor.cpp.

287{
288 if (m_hide) return;
289 startLink(w.ref(),w.file(),w.anchor());
290 filter(w.word());
291 endLink(w.ref(),w.file(),w.anchor());
292}

References DocLinkedWord::anchor, endLink, DocLinkedWord::file, filter, m_hide, DocLinkedWord::ref, startLink and DocLinkedWord::word.

operator()()

void LatexDocVisitor::operator() (const DocWhiteSpace & w)

Declaration at line 49 of file latexdocvisitor.h, definition at line 294 of file latexdocvisitor.cpp.

295{
296 if (m_hide) return;
297 if (m_insidePre)
298 {
299 m_t << w.chars();
300 }
301 else
302 {
303 m_t << " ";
304 }
305}

References DocWhiteSpace::chars, m_hide, m_insidePre and m_t.

operator()()

void LatexDocVisitor::operator() (const DocSymbol & s)

Declaration at line 50 of file latexdocvisitor.h, definition at line 307 of file latexdocvisitor.cpp.

308{
309 if (m_hide) return;
310 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
311 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
312 if (res)
313 {
315 {
316 if (pdfHyperlinks)
317 {
318 m_t << "\\texorpdfstring{$<$}{<}";
319 }
320 else
321 {
322 m_t << "$<$";
323 }
324 }
326 {
327 if (pdfHyperlinks)
328 {
329 m_t << "\\texorpdfstring{$>$}{>}";
330 }
331 else
332 {
333 m_t << "$>$";
334 }
335 }
336 else
337 {
338 m_t << res;
339 }
340 }
341 else
342 {
343 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
344 }
345}

References Config_getBool, err, HtmlEntityMapper::instance, HtmlEntityMapper::latex, m_hide, m_insidePre, m_t, HtmlEntityMapper::Sym_Greater, HtmlEntityMapper::Sym_gt, HtmlEntityMapper::Sym_Less, HtmlEntityMapper::Sym_lt, DocSymbol::symbol and TRUE.

operator()()

void LatexDocVisitor::operator() (const DocEmoji & s)

Declaration at line 51 of file latexdocvisitor.h, definition at line 347 of file latexdocvisitor.cpp.

348{
349 if (m_hide) return;
351 if (!emojiName.isEmpty())
352 {
353 QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
354 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
355 filter(emojiName);
356 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
357 }
358 else
359 {
360 m_t << s.name();
361 }
362}

References filter, DocEmoji::index, EmojiEntityMapper::instance, QCString::isEmpty, QCString::length, m_hide, m_t, m_texOrPdf, QCString::mid, DocEmoji::name, EmojiEntityMapper::name and PDF.

operator()()

void LatexDocVisitor::operator() (const DocURL & u)

Declaration at line 52 of file latexdocvisitor.h, definition at line 364 of file latexdocvisitor.cpp.

365{
366 if (m_hide) return;
367 if (Config_getBool(PDF_HYPERLINKS))
368 {
369 m_t << "\\href{";
370 if (u.isEmail()) m_t << "mailto:";
371 m_t << latexFilterURL(u.url()) << "}";
372 }
373 m_t << "{\\texttt{";
374 filter(u.url());
375 m_t << "}}";
376}

References Config_getBool, filter, DocURL::isEmail, latexFilterURL, m_hide, m_t and DocURL::url.

operator()()

void LatexDocVisitor::operator() (const DocLineBreak &)

Declaration at line 53 of file latexdocvisitor.h, definition at line 378 of file latexdocvisitor.cpp.

379{
380 if (m_hide) return;
381 m_t << "~\\newline\n";
382}

References m_hide and m_t.

operator()()

void LatexDocVisitor::operator() (const DocHorRuler &)

Declaration at line 54 of file latexdocvisitor.h, definition at line 384 of file latexdocvisitor.cpp.

385{
386 if (m_hide) return;
387 if (insideTable())
388 m_t << "\\DoxyHorRuler{1}\n";
389 else
390 m_t << "\\DoxyHorRuler{0}\n";
391}

References insideTable, m_hide and m_t.

operator()()

void LatexDocVisitor::operator() (const DocStyleChange & s)

Declaration at line 55 of file latexdocvisitor.h, definition at line 393 of file latexdocvisitor.cpp.

394{
395 if (m_hide) return;
396 switch (s.style())
397 {
399 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
400 break;
404 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
405 break;
408 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
409 break;
411 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
412 break;
416 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
417 break;
419 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
420 break;
422 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
423 break;
425 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
426 break;
428 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
429 break;
431 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
432 break;
434 if (s.enable())
435 {
436 m_t << "\n\\begin{DoxyPre}";
438 }
439 else
440 {
442 m_t << "\\end{DoxyPre}\n";
443 }
444 break;
445 case DocStyleChange::Div: /* HTML only */ break;
446 case DocStyleChange::Span: /* HTML only */ break;
447 }
448}

References DocStyleChange::Bold, DocStyleChange::Center, DocStyleChange::Cite, DocStyleChange::Code, DocStyleChange::Del, DocStyleChange::Div, DocStyleChange::enable, FALSE, DocStyleChange::Ins, DocStyleChange::Italic, DocStyleChange::Kbd, m_hide, m_insidePre, m_t, DocStyleChange::Preformatted, DocStyleChange::S, DocStyleChange::Small, DocStyleChange::Span, DocStyleChange::Strike, DocStyleChange::style, DocStyleChange::Subscript, DocStyleChange::Superscript, TRUE, DocStyleChange::Typewriter and DocStyleChange::Underline.

operator()()

void LatexDocVisitor::operator() (const DocVerbatim & s)

Declaration at line 56 of file latexdocvisitor.h, definition at line 450 of file latexdocvisitor.cpp.

451{
452 if (m_hide) return;
453 QCString lang = m_langExt;
454 if (!s.language().isEmpty()) // explicit language setting
455 {
456 lang = s.language();
457 }
458 SrcLangExt langExt = getLanguageFromCodeLang(lang);
459 switch(s.type())
460 {
462 {
463 m_ci.startCodeFragment("DoxyCode");
464 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
465 Config_getBool(STRIP_CODE_COMMENTS),
466 s.isExample(),s.exampleFile());
467 m_ci.endCodeFragment("DoxyCode");
468 }
469 break;
471 filter(s.text(), true);
472 break;
474 m_t << "{\\ttfamily ";
475 filter(s.text(), true);
476 m_t << "}";
477 break;
479 m_t << "\\begin{DoxyVerb}";
480 m_t << s.text();
481 m_t << "\\end{DoxyVerb}\n";
482 break;
488 /* nothing */
489 break;
491 m_t << s.text();
492 break;
494 {
495 static int dotindex = 1;
496 QCString fileName(4096, QCString::ExplicitSize);
497
498 fileName.sprintf("%s%d%s",
499 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_"),
500 dotindex++,
501 ".dot"
502 );
503 std::ofstream file = Portable::openOutputStream(fileName);
504 if (!file.is_open())
505 {
506 err("Could not open file {} for writing\n",fileName);
507 }
508 else
509 {
510 file.write( s.text().data(), s.text().length() );
511 file.close();
512
513 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine());
516
517 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
518 }
519 }
520 break;
522 {
523 static int mscindex = 1;
524 QCString baseName(4096, QCString::ExplicitSize);
525
526 baseName.sprintf("%s%d",
527 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_"),
528 mscindex++
529 );
530 QCString fileName = baseName+".msc";
531 std::ofstream file = Portable::openOutputStream(fileName);
532 if (!file.is_open())
533 {
534 err("Could not open file {} for writing\n",fileName);
535 }
536 else
537 {
538 QCString text = "msc {";
539 text+=s.text();
540 text+="}";
541 file.write( text.data(), text.length() );
542 file.close();
543
544 writeMscFile(baseName, s);
545
546 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
547 }
548 }
549 break;
551 {
552 QCString latexOutput = Config_getString(LATEX_OUTPUT);
554 latexOutput,s.exampleFile(),s.text(),
556 s.engine(),s.srcFile(),s.srcLine(),true);
557
558 writePlantUMLFile(baseName, s);
559 }
560 break;
561 }
562}

References DocVerbatim::Code, Config_getBool, Config_getString, DocVerbatim::context, QCString::data, DocVerbatim::DocbookOnly, DocVerbatim::Dot, endDotFile, DocVerbatim::engine, err, DocVerbatim::exampleFile, QCString::ExplicitSize, filter, DocVisitor::getCodeParser, getLanguageFromCodeLang, DocVerbatim::hasCaption, DocVerbatim::height, DocVerbatim::HtmlOnly, PlantumlManager::instance, QCString::isEmpty, DocVerbatim::isExample, DocVerbatim::JavaDocCode, DocVerbatim::JavaDocLiteral, DocVerbatim::language, DocVerbatim::LatexOnly, QCString::length, m_ci, m_hide, m_langExt, m_t, DocVerbatim::ManOnly, DocVerbatim::Msc, Portable::openOutputStream, CodeParserInterface::parseCode, DocVerbatim::PlantUML, PlantumlManager::PUML_BITMAP, PlantumlManager::PUML_EPS, qPrint, Dir::remove, DocVerbatim::RtfOnly, QCString::sprintf, DocVerbatim::srcFile, DocVerbatim::srcLine, startDotFile, QCString::str, DocVerbatim::text, DocVerbatim::type, DocVerbatim::useBitmap, DocVerbatim::Verbatim, visitChildren, DocVerbatim::width, writeMscFile, writePlantUMLFile, PlantumlManager::writePlantUMLSource and DocVerbatim::XmlOnly.

operator()()

void LatexDocVisitor::operator() (const DocAnchor & anc)

Declaration at line 57 of file latexdocvisitor.h, definition at line 564 of file latexdocvisitor.cpp.

565{
566 if (m_hide) return;
567 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
568 if (!anc.file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
569 {
570 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
571 << "}%\n";
572 }
573}

References DocAnchor::anchor, Config_getBool, DocAnchor::file, QCString::isEmpty, m_hide, m_t and stripPath.

operator()()

void LatexDocVisitor::operator() (const DocInclude & inc)

Declaration at line 58 of file latexdocvisitor.h, definition at line 575 of file latexdocvisitor.cpp.

576{
577 if (m_hide) return;
579 switch(inc.type())
580 {
582 {
583 m_ci.startCodeFragment("DoxyCodeInclude");
584 FileInfo cfi( inc.file().str() );
585 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
587 inc.text(),
588 langExt,
590 inc.isExample(),
591 inc.exampleFile(),
592 fd.get(), // fileDef,
593 -1, // start line
594 -1, // end line
595 FALSE, // inline fragment
596 nullptr, // memberDef
597 TRUE // show line numbers
598 );
599 m_ci.endCodeFragment("DoxyCodeInclude");
600 }
601 break;
603 {
604 m_ci.startCodeFragment("DoxyCodeInclude");
606 inc.text(),langExt,
608 inc.isExample(),
609 inc.exampleFile(),
610 nullptr, // fileDef
611 -1, // startLine
612 -1, // endLine
613 TRUE, // inlineFragment
614 nullptr, // memberDef
615 FALSE
616 );
617 m_ci.endCodeFragment("DoxyCodeInclude");
618 }
619 break;
627 break;
629 m_t << inc.text();
630 break;
632 m_t << "\n\\begin{DoxyVerbInclude}\n";
633 m_t << inc.text();
634 m_t << "\\end{DoxyVerbInclude}\n";
635 break;
638 {
639 m_ci.startCodeFragment("DoxyCodeInclude");
641 inc.file(),
642 inc.blockId(),
643 inc.context(),
645 inc.trimLeft(),
647 );
648 m_ci.endCodeFragment("DoxyCodeInclude");
649 }
650 break;
651 }
652}

References DocInclude::blockId, DocInclude::context, createFileDef, FileInfo::dirPath, DocInclude::DocbookInclude, DocInclude::DontInclude, DocInclude::DontIncWithLines, DocInclude::exampleFile, DocInclude::extension, FALSE, DocInclude::file, FileInfo::fileName, DocVisitor::getCodeParser, getLanguageFromFileName, DocInclude::HtmlInclude, DocInclude::Include, DocInclude::IncWithLines, CodeFragmentManager::instance, DocInclude::isExample, DocInclude::LatexInclude, m_ci, m_hide, m_t, DocInclude::ManInclude, CodeParserInterface::parseCode, CodeFragmentManager::parseCodeFragment, DocInclude::RtfInclude, DocInclude::Snippet, DocInclude::SnippetWithLines, QCString::str, DocInclude::stripCodeComments, DocInclude::text, DocInclude::trimLeft, TRUE, DocInclude::type, DocInclude::VerbInclude and DocInclude::XmlInclude.

operator()()

void LatexDocVisitor::operator() (const DocIncOperator & op)

Declaration at line 59 of file latexdocvisitor.h, definition at line 654 of file latexdocvisitor.cpp.

655{
656 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
657 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
658 if (op.isFirst())
659 {
660 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
662 m_hide = TRUE;
663 }
665 if (locLangExt.isEmpty()) locLangExt = m_langExt;
666 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
667 if (op.type()!=DocIncOperator::Skip)
668 {
669 m_hide = popHidden();
670 if (!m_hide)
671 {
672 std::unique_ptr<FileDef> fd;
673 if (!op.includeFileName().isEmpty())
674 {
675 FileInfo cfi( op.includeFileName().str() );
676 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
677 }
678
679 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
681 op.isExample(),op.exampleFile(),
682 fd.get(), // fileDef
683 op.line(), // startLine
684 -1, // endLine
685 FALSE, // inline fragment
686 nullptr, // memberDef
687 op.showLineNo() // show line numbers
688 );
689 }
692 }
693 if (op.isLast())
694 {
696 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
697 }
698 else
699 {
700 if (!m_hide) m_t << "\n";
701 }
702}

References DocIncOperator::context, createFileDef, FileInfo::dirPath, DocIncOperator::exampleFile, FALSE, FileInfo::fileName, DocVisitor::getCodeParser, getFileNameExtension, getLanguageFromFileName, DocIncOperator::includeFileName, QCString::isEmpty, DocIncOperator::isExample, DocIncOperator::isFirst, DocIncOperator::isLast, DocIncOperator::line, m_ci, m_hide, m_langExt, m_t, CodeParserInterface::parseCode, DocVisitor::popHidden, DocVisitor::pushHidden, DocIncOperator::showLineNo, DocIncOperator::Skip, QCString::str, DocIncOperator::stripCodeComments, DocIncOperator::text, TRUE and DocIncOperator::type.

operator()()

void LatexDocVisitor::operator() (const DocFormula & f)

Declaration at line 60 of file latexdocvisitor.h, definition at line 704 of file latexdocvisitor.cpp.

705{
706 if (m_hide) return;
707 QCString s = f.text();
708 const char *p = s.data();
709 char c = 0;
710 if (p)
711 {
712 while ((c=*p++))
713 {
714 switch (c)
715 {
716 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
717 default: m_t << c; break;
718 }
719 }
720 }
721}

References QCString::data, m_hide, m_t and DocFormula::text.

operator()()

void LatexDocVisitor::operator() (const DocIndexEntry & i)

Declaration at line 61 of file latexdocvisitor.h, definition at line 723 of file latexdocvisitor.cpp.

724{
725 if (m_hide) return;
726 m_t << "\\index{";
728 m_t << "@{";
730 m_t << "}}";
731}

References DocIndexEntry::entry, latexEscapeIndexChars, latexEscapeLabelName, m_hide and m_t.

operator()()

void LatexDocVisitor::operator() (const DocSimpleSectSep &)

Declaration at line 62 of file latexdocvisitor.h, definition at line 733 of file latexdocvisitor.cpp.

operator()()

void LatexDocVisitor::operator() (const DocCite & cite)

Declaration at line 63 of file latexdocvisitor.h, definition at line 737 of file latexdocvisitor.cpp.

738{
739 if (m_hide) return;
740 auto opt = cite.option();
741 QCString txt;
742 if (opt.noCite())
743 {
744 if (!cite.file().isEmpty())
745 {
746 txt = cite.getText();
747 }
748 else
749 {
750 if (!opt.noPar()) txt += "[";
751 txt += cite.target();
752 if (!opt.noPar()) txt += "]";
753 }
754 m_t << "{\\bfseries ";
755 filter(txt);
756 m_t << "}";
757 }
758 else
759 {
760 if (!cite.file().isEmpty())
761 {
762 QCString anchor = cite.anchor();
764 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
765
766 txt = "\\DoxyCite{" + anchor + "}";
767 if (opt.isNumber())
768 {
769 txt += "{number}";
770 }
771 else if (opt.isShortAuthor())
772 {
773 txt += "{shortauthor}";
774 }
775 else if (opt.isYear())
776 {
777 txt += "{year}";
778 }
779 if (!opt.noPar()) txt += "{1}";
780 else txt += "{0}";
781
782 m_t << txt;
783 }
784 else
785 {
786 if (!opt.noPar()) txt += "[";
787 txt += cite.target();
788 if (!opt.noPar()) txt += "]";
789 m_t << "{\\bfseries ";
790 filter(txt);
791 m_t << "}";
792 }
793 }
794}

References DocCite::anchor, CitationManager::anchorPrefix, DocCite::file, filter, DocCite::getText, CitationManager::instance, QCString::isEmpty, QCString::length, m_hide, m_t, QCString::mid, DocCite::option and DocCite::target.

operator()()

void LatexDocVisitor::operator() (const DocSeparator & sep)

Declaration at line 64 of file latexdocvisitor.h, definition at line 1773 of file latexdocvisitor.cpp.

1774{
1775 m_t << " " << sep.chars() << " ";
1776}

References DocSeparator::chars and m_t.

operator()()

void LatexDocVisitor::operator() (const DocAutoList & l)

Declaration at line 70 of file latexdocvisitor.h, definition at line 800 of file latexdocvisitor.cpp.

801{
802 if (m_hide) return;
803 if (m_indentLevel>=maxIndentLevels-1) return;
804 if (l.isEnumList())
805 {
806 m_t << "\n\\begin{DoxyEnumerate}";
807 m_listItemInfo[indentLevel()].isEnum = true;
808 }
809 else
810 {
811 m_listItemInfo[indentLevel()].isEnum = false;
812 m_t << "\n\\begin{DoxyItemize}";
813 }
815 if (l.isEnumList())
816 {
817 m_t << "\n\\end{DoxyEnumerate}";
818 }
819 else
820 {
821 m_t << "\n\\end{DoxyItemize}";
822 }
823}

References indentLevel, DocAutoList::isEnumList, m_hide, m_indentLevel, m_listItemInfo, m_t, maxIndentLevels and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocAutoListItem & li)

Declaration at line 71 of file latexdocvisitor.h, definition at line 825 of file latexdocvisitor.cpp.

826{
827 if (m_hide) return;
828 switch (li.itemNumber())
829 {
830 case DocAutoList::Unchecked: // unchecked
831 m_t << "\n\\item[\\DoxyUnchecked] ";
832 break;
833 case DocAutoList::Checked_x: // checked with x
834 case DocAutoList::Checked_X: // checked with X
835 m_t << "\n\\item[\\DoxyChecked] ";
836 break;
837 default:
838 m_t << "\n\\item ";
839 break;
840 }
842 visitChildren(li);
844}

References DocAutoList::Checked_X, DocAutoList::Checked_x, decIndentLevel, incIndentLevel, DocAutoListItem::itemNumber, m_hide, m_t, DocAutoList::Unchecked and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocPara & p)

Declaration at line 72 of file latexdocvisitor.h, definition at line 846 of file latexdocvisitor.cpp.

847{
848 if (m_hide) return;
850 if (!p.isLast() && // omit <p> for last paragraph
851 !(p.parent() && // and for parameter sections
852 std::get_if<DocParamSect>(p.parent())
853 )
854 )
855 {
856 if (insideTable())
857 {
858 m_t << "~\\newline\n";
859 }
860 else
861 {
862 m_t << "\n\n";
863 }
864 }
865}

References insideTable, DocPara::isLast, m_hide, m_t, DocNode::parent and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocRoot & r)

Declaration at line 73 of file latexdocvisitor.h, definition at line 867 of file latexdocvisitor.cpp.

868{
870}

Reference visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocSimpleSect & s)

Declaration at line 74 of file latexdocvisitor.h, definition at line 872 of file latexdocvisitor.cpp.

873{
874 if (m_hide) return;
875 switch(s.type())
876 {
878 m_t << "\\begin{DoxySeeAlso}{";
879 filter(theTranslator->trSeeAlso());
880 break;
882 m_t << "\\begin{DoxyReturn}{";
883 filter(theTranslator->trReturns());
884 break;
886 m_t << "\\begin{DoxyAuthor}{";
887 filter(theTranslator->trAuthor(TRUE,TRUE));
888 break;
890 m_t << "\\begin{DoxyAuthor}{";
891 filter(theTranslator->trAuthor(TRUE,FALSE));
892 break;
894 m_t << "\\begin{DoxyVersion}{";
895 filter(theTranslator->trVersion());
896 break;
898 m_t << "\\begin{DoxySince}{";
899 filter(theTranslator->trSince());
900 break;
902 m_t << "\\begin{DoxyDate}{";
903 filter(theTranslator->trDate());
904 break;
906 m_t << "\\begin{DoxyNote}{";
907 filter(theTranslator->trNote());
908 break;
910 m_t << "\\begin{DoxyWarning}{";
911 filter(theTranslator->trWarning());
912 break;
914 m_t << "\\begin{DoxyPrecond}{";
915 filter(theTranslator->trPrecondition());
916 break;
918 m_t << "\\begin{DoxyPostcond}{";
919 filter(theTranslator->trPostcondition());
920 break;
922 m_t << "\\begin{DoxyCopyright}{";
923 filter(theTranslator->trCopyright());
924 break;
926 m_t << "\\begin{DoxyInvariant}{";
927 filter(theTranslator->trInvariant());
928 break;
930 m_t << "\\begin{DoxyRemark}{";
931 filter(theTranslator->trRemarks());
932 break;
934 m_t << "\\begin{DoxyAttention}{";
935 filter(theTranslator->trAttention());
936 break;
938 m_t << "\\begin{DoxyImportant}{";
939 filter(theTranslator->trImportant());
940 break;
942 m_t << "\\begin{DoxyParagraph}{";
943 break;
945 m_t << "\\begin{DoxyParagraph}{";
946 break;
947 case DocSimpleSect::Unknown: break;
948 }
949
950 if (s.title())
951 {
953 std::visit(*this,*s.title());
955 }
956 m_t << "}\n";
959 switch(s.type())
960 {
962 m_t << "\n\\end{DoxySeeAlso}\n";
963 break;
965 m_t << "\n\\end{DoxyReturn}\n";
966 break;
968 m_t << "\n\\end{DoxyAuthor}\n";
969 break;
971 m_t << "\n\\end{DoxyAuthor}\n";
972 break;
974 m_t << "\n\\end{DoxyVersion}\n";
975 break;
977 m_t << "\n\\end{DoxySince}\n";
978 break;
980 m_t << "\n\\end{DoxyDate}\n";
981 break;
983 m_t << "\n\\end{DoxyNote}\n";
984 break;
986 m_t << "\n\\end{DoxyWarning}\n";
987 break;
989 m_t << "\n\\end{DoxyPrecond}\n";
990 break;
992 m_t << "\n\\end{DoxyPostcond}\n";
993 break;
995 m_t << "\n\\end{DoxyCopyright}\n";
996 break;
998 m_t << "\n\\end{DoxyInvariant}\n";
999 break;
1001 m_t << "\n\\end{DoxyRemark}\n";
1002 break;
1004 m_t << "\n\\end{DoxyAttention}\n";
1005 break;
1007 m_t << "\n\\end{DoxyImportant}\n";
1008 break;
1010 m_t << "\n\\end{DoxyParagraph}\n";
1011 break;
1013 m_t << "\n\\end{DoxyParagraph}\n";
1014 break;
1015 default:
1016 break;
1017 }
1019}

References DocSimpleSect::Attention, DocSimpleSect::Author, DocSimpleSect::Authors, DocSimpleSect::Copyright, DocSimpleSect::Date, decIndentLevel, FALSE, filter, DocSimpleSect::Important, incIndentLevel, DocSimpleSect::Invar, m_hide, m_insideItem, m_t, DocSimpleSect::Note, DocSimpleSect::Post, DocSimpleSect::Pre, DocSimpleSect::Rcs, DocSimpleSect::Remark, DocSimpleSect::Return, DocSimpleSect::See, DocSimpleSect::Since, theTranslator, DocSimpleSect::title, TRUE, DocSimpleSect::type, DocSimpleSect::Unknown, DocSimpleSect::User, DocSimpleSect::Version, visitChildren and DocSimpleSect::Warning.

operator()()

void LatexDocVisitor::operator() (const DocTitle & t)

Declaration at line 75 of file latexdocvisitor.h, definition at line 1021 of file latexdocvisitor.cpp.

1022{
1023 if (m_hide) return;
1024 visitChildren(t);
1025}

References m_hide and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocSimpleList & l)

Declaration at line 76 of file latexdocvisitor.h, definition at line 1027 of file latexdocvisitor.cpp.

1028{
1029 if (m_hide) return;
1030 m_t << "\\begin{DoxyItemize}\n";
1031 m_listItemInfo[indentLevel()].isEnum = false;
1032 visitChildren(l);
1033 m_t << "\\end{DoxyItemize}\n";
1034}

References indentLevel, m_hide, m_listItemInfo, m_t and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocSimpleListItem & li)

Declaration at line 77 of file latexdocvisitor.h, definition at line 1036 of file latexdocvisitor.cpp.

1037{
1038 if (m_hide) return;
1039 m_t << "\\item ";
1041 if (li.paragraph())
1042 {
1043 visit(*this,*li.paragraph());
1044 }
1046}

References decIndentLevel, incIndentLevel, m_hide, m_t and DocSimpleListItem::paragraph.

operator()()

void LatexDocVisitor::operator() (const DocSection & s)

Declaration at line 78 of file latexdocvisitor.h, definition at line 1048 of file latexdocvisitor.cpp.

1049{
1050 if (m_hide) return;
1051 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1052 if (pdfHyperlinks)
1053 {
1054 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1055 }
1056 m_t << "\\" << getSectionName(s.level()) << "{";
1057 if (pdfHyperlinks)
1058 {
1059 m_t << "\\texorpdfstring{";
1060 }
1061 if (s.title())
1062 {
1063 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1064 std::visit(*this,*s.title());
1066 }
1067 if (pdfHyperlinks)
1068 {
1069 m_t << "}{";
1070 if (s.title())
1071 {
1072 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1073 std::visit(*this,*s.title());
1075 }
1076 m_t << "}";
1077 }
1078 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1079 visitChildren(s);
1080}

References DocSection::anchor, Config_getBool, DocSection::file, getSectionName, DocSection::level, m_hide, m_t, m_texOrPdf, NO, PDF, stripPath, TEX, DocSection::title and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHtmlList & s)

Declaration at line 79 of file latexdocvisitor.h, definition at line 1082 of file latexdocvisitor.cpp.

1083{
1084 if (m_hide) return;
1085 if (m_indentLevel>=maxIndentLevels-1) return;
1087 if (s.type()==DocHtmlList::Ordered)
1088 {
1089 bool first = true;
1090 m_t << "\n\\begin{DoxyEnumerate}";
1091 for (const auto &opt : s.attribs())
1092 {
1093 if (opt.name=="type")
1094 {
1095 if (opt.value=="1")
1096 {
1097 m_t << (first ? "[": ",");
1098 m_t << "label=\\arabic*";
1099 first = false;
1100 }
1101 else if (opt.value=="a")
1102 {
1103 m_t << (first ? "[": ",");
1104 m_t << "label=\\enumalphalphcnt*";
1105 first = false;
1106 }
1107 else if (opt.value=="A")
1108 {
1109 m_t << (first ? "[": ",");
1110 m_t << "label=\\enumAlphAlphcnt*";
1111 first = false;
1112 }
1113 else if (opt.value=="i")
1114 {
1115 m_t << (first ? "[": ",");
1116 m_t << "label=\\roman*";
1117 first = false;
1118 }
1119 else if (opt.value=="I")
1120 {
1121 m_t << (first ? "[": ",");
1122 m_t << "label=\\Roman*";
1123 first = false;
1124 }
1125 }
1126 else if (opt.name=="start")
1127 {
1128 m_t << (first ? "[": ",");
1129 bool ok = false;
1130 int val = opt.value.toInt(&ok);
1131 if (ok) m_t << "start=" << val;
1132 first = false;
1133 }
1134 }
1135 if (!first) m_t << "]\n";
1136 }
1137 else
1138 {
1139 m_t << "\n\\begin{DoxyItemize}";
1140 }
1141 visitChildren(s);
1142 if (m_indentLevel>=maxIndentLevels-1) return;
1143 if (s.type()==DocHtmlList::Ordered)
1144 m_t << "\n\\end{DoxyEnumerate}";
1145 else
1146 m_t << "\n\\end{DoxyItemize}";
1147}

References DocHtmlList::attribs, indentLevel, m_hide, m_indentLevel, m_listItemInfo, m_t, maxIndentLevels, DocHtmlList::Ordered, DocHtmlList::type and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHtmlListItem & l)

Declaration at line 80 of file latexdocvisitor.h, definition at line 1149 of file latexdocvisitor.cpp.

1150{
1151 if (m_hide) return;
1152 if (m_listItemInfo[indentLevel()].isEnum)
1153 {
1154 for (const auto &opt : l.attribs())
1155 {
1156 if (opt.name=="value")
1157 {
1158 bool ok = false;
1159 int val = opt.value.toInt(&ok);
1160 if (ok)
1161 {
1162 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1163 }
1164 }
1165 }
1166 }
1167 m_t << "\n\\item ";
1169 visitChildren(l);
1171}

References DocHtmlListItem::attribs, decIndentLevel, incIndentLevel, indentLevel, integerToRoman, m_hide, m_listItemInfo, m_t and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHtmlDescList & dl)

Declaration at line 81 of file latexdocvisitor.h, definition at line 1198 of file latexdocvisitor.cpp.

1199{
1200 if (m_hide) return;
1201 bool eq = classEqualsReflist(dl);
1202 if (eq)
1203 {
1204 m_t << "\n\\begin{DoxyRefList}";
1205 }
1206 else
1207 {
1208 if (listIsNested(dl)) m_t << "\n\\hfill";
1209 m_t << "\n\\begin{DoxyDescription}";
1210 }
1211 visitChildren(dl);
1212 if (eq)
1213 {
1214 m_t << "\n\\end{DoxyRefList}";
1215 }
1216 else
1217 {
1218 m_t << "\n\\end{DoxyDescription}";
1219 }
1220}

References classEqualsReflist, listIsNested, m_hide, m_t and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHtmlDescTitle & dt)

Declaration at line 82 of file latexdocvisitor.h, definition at line 1222 of file latexdocvisitor.cpp.

1223{
1224 if (m_hide) return;
1225 m_t << "\n\\item[";
1227 visitChildren(dt);
1229 m_t << "]";
1230}

References FALSE, m_hide, m_insideItem, m_t, TRUE and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHtmlDescData & dd)

Declaration at line 83 of file latexdocvisitor.h, definition at line 1232 of file latexdocvisitor.cpp.

1233{
1235 if (!m_insideItem) m_t << "\\hfill";
1236 m_t << " \\\\\n";
1237 visitChildren(dd);
1239}

References decIndentLevel, incIndentLevel, m_insideItem, m_t and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHtmlTable & t)

Declaration at line 84 of file latexdocvisitor.h, definition at line 1278 of file latexdocvisitor.cpp.

1279{
1280 if (m_hide) return;
1282 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1283 if (c)
1284 {
1285 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1286 if (!c->file().isEmpty() && pdfHyperLinks)
1287 {
1288 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1289 << "}{}";
1290 }
1291 m_t << "\n";
1292 }
1293
1295
1296 if (c)
1297 {
1298 m_t << "\\caption{";
1299 std::visit(*this, *t.caption());
1300 m_t << "}";
1301 m_t << "\\label{" << stripPath(c->file()) << "_" << c->anchor() << "}";
1302 m_t << "\\\\\n";
1303 }
1304
1306 m_t << "\\hline\n";
1307
1308 // check if first row is a heading and then render the row already here
1309 // and end it with \endfirsthead (triggered via m_firstRow==TRUE)
1310 // then repeat the row as normal and end it with \endhead (m_firstRow==FALSE)
1311 const DocHtmlRow *firstRow = std::get_if<DocHtmlRow>(t.firstRow());
1312 if (firstRow && firstRow->isHeading())
1313 {
1315 if (!isTableNested(t.parent()))
1316 {
1317 std::visit(*this,*t.firstRow());
1318 }
1320 }
1321 visitChildren(t);
1324}

References DocHtmlCaption::anchor, DocHtmlTable::caption, Config_getBool, FALSE, DocHtmlCaption::file, DocHtmlTable::firstRow, firstRow, QCString::isEmpty, isTableNested, m_hide, m_t, DocHtmlTable::numColumns, DocNode::parent, popTableState, pushTableState, setFirstRow, setNumCols, stripPath, TRUE, visitChildren, writeEndTableCommand and writeStartTableCommand.

operator()()

void LatexDocVisitor::operator() (const DocHtmlCaption & c)

Declaration at line 85 of file latexdocvisitor.h, definition at line 1326 of file latexdocvisitor.cpp.

1327{
1328 if (m_hide) return;
1329 visitChildren(c);
1330}

References m_hide and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHtmlRow & row)

Declaration at line 86 of file latexdocvisitor.h, definition at line 1332 of file latexdocvisitor.cpp.

1333{
1334 if (m_hide) return;
1336
1337 visitChildren(row);
1338
1339 size_t c=currentColumn();
1340 while (c<=numCols()) // end of row while inside a row span?
1341 {
1342 for (const auto &span : rowSpans())
1343 {
1344 //printf(" found row span: column=%d rs=%d cs=%d rowIdx=%d cell->rowIdx=%d i=%d c=%d\n",
1345 // span->column, span->rowSpan,span->colSpan,row.rowIndex(),span->cell->rowIndex(),i,c);
1346 if (span.rowSpan>0 && span.column==c && // we are at a cell in a row span
1347 row.rowIndex()>span.cell.rowIndex() // but not the row that started the span
1348 )
1349 {
1350 m_t << "&";
1351 if (span.colSpan>1) // row span is also part of a column span
1352 {
1353 m_t << "\\multicolumn{" << span.colSpan << "}{";
1354 m_t << "}|}{}";
1355 }
1356 else // solitary row span
1357 {
1358 m_t << "\\multicolumn{1}{c|}{}";
1359 }
1360 }
1361 }
1362 c++;
1363 }
1364
1365 m_t << "\\\\";
1366
1367 size_t col = 1;
1368 for (auto &span : rowSpans())
1369 {
1370 if (span.rowSpan>0) span.rowSpan--;
1371 if (span.rowSpan<=0)
1372 {
1373 // inactive span
1374 }
1375 else if (span.column>col)
1376 {
1377 m_t << "\\cline{" << col << "-" << (span.column-1) << "}";
1378 col = span.column+span.colSpan;
1379 }
1380 else
1381 {
1382 col = span.column+span.colSpan;
1383 }
1384 }
1385
1386 if (col <= numCols())
1387 {
1388 m_t << "\\cline{" << col << "-" << numCols() << "}";
1389 }
1390
1391 m_t << "\n";
1392
1393 const DocNodeVariant *n = ::parent(row.parent());
1394 if (row.isHeading() && row.rowIndex()==1 && !isTableNested(n))
1395 {
1396 if (firstRow())
1397 {
1398 m_t << "\\endfirsthead\n";
1399 m_t << "\\hline\n";
1400 m_t << "\\endfoot\n";
1401 m_t << "\\hline\n";
1402 }
1403 else
1404 {
1405 m_t << "\\endhead\n";
1406 }
1407 }
1408}

References currentColumn, firstRow, DocHtmlRow::isHeading, isTableNested, m_hide, m_t, numCols, DocNode::parent, parent, DocHtmlRow::rowIndex, rowSpans, setCurrentColumn and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHtmlCell & c)

Declaration at line 87 of file latexdocvisitor.h, definition at line 1410 of file latexdocvisitor.cpp.

1411{
1412 if (m_hide) return;
1413
1414 const DocHtmlRow *row = std::get_if<DocHtmlRow>(c.parent());
1415
1417
1418 //Skip columns that span from above.
1419 for (const auto &span : rowSpans())
1420 {
1421 if (span.rowSpan>0 && span.column==currentColumn())
1422 {
1423 if (row && span.colSpan>1)
1424 {
1425 m_t << "\\multicolumn{" << span.colSpan << "}{";
1426 if (currentColumn() /*c.columnIndex()*/==1) // add extra | for first column
1427 {
1428 m_t << "|";
1429 }
1430 m_t << "l|}{" << (c.isHeading()? "\\columncolor{\\tableheadbgcolor}" : "") << "}"; // alignment not relevant, empty column
1431 setCurrentColumn(currentColumn()+span.colSpan);
1432 }
1433 else
1434 {
1436 }
1437 m_t << "&";
1438 }
1439 }
1440
1441 int cs = c.colSpan();
1442 int a = c.alignment();
1443 if (cs>1 && row)
1444 {
1446 m_t << "\\multicolumn{" << cs << "}{";
1447 if (c.columnIndex()==1) // add extra | for first column
1448 {
1449 m_t << "|";
1450 }
1451 switch (a)
1452 {
1454 m_t << "r|}{";
1455 break;
1457 m_t << "c|}{";
1458 break;
1459 default:
1460 m_t << "l|}{";
1461 break;
1462 }
1463 }
1464 int rs = c.rowSpan();
1465 int va = c.valignment();
1466 if (rs>0)
1467 {
1469 m_t << "\\multirow";
1470 switch(va)
1471 {
1472 case DocHtmlCell::Top:
1473 m_t << "[t]";
1474 break;
1476 m_t << "[b]";
1477 break;
1479 break; // No alignment option needed
1480 default:
1481 break;
1482 }
1483 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%d\n",
1484 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1485 // currentColumn());
1487 m_t << "{" << rs << "}{*}{";
1488 }
1489 if (a==DocHtmlCell::Center)
1490 {
1491 m_t << "\\PBS\\centering ";
1492 }
1493 else if (a==DocHtmlCell::Right)
1494 {
1495 m_t << "\\PBS\\raggedleft ";
1496 }
1497 if (c.isHeading())
1498 {
1499 m_t << "\\cellcolor{\\tableheadbgcolor}\\textbf{ ";
1500 }
1501 if (cs>1)
1502 {
1504 }
1505
1506 visitChildren(c);
1507
1508 if (c.isHeading())
1509 {
1510 m_t << "}";
1511 }
1512 if (inRowSpan())
1513 {
1515 m_t << "}";
1516 }
1517 if (inColSpan())
1518 {
1520 m_t << "}";
1521 }
1522 if (!c.isLast()) m_t << "&";
1523}

References addRowSpan, DocHtmlCell::alignment, DocHtmlCell::Bottom, DocHtmlCell::Center, DocHtmlCell::colSpan, DocHtmlCell::columnIndex, currentColumn, FALSE, inColSpan, inRowSpan, DocHtmlCell::isHeading, DocHtmlCell::isLast, m_hide, m_t, DocHtmlCell::Middle, DocNode::parent, DocHtmlCell::Right, DocHtmlCell::rowSpan, rowSpans, setCurrentColumn, setInColSpan, setInRowSpan, DocHtmlCell::Top, TRUE, DocHtmlCell::valignment and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocInternal & i)

Declaration at line 88 of file latexdocvisitor.h, definition at line 1525 of file latexdocvisitor.cpp.

1526{
1527 if (m_hide) return;
1528 visitChildren(i);
1529}

References m_hide and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHRef & href)

Declaration at line 89 of file latexdocvisitor.h, definition at line 1531 of file latexdocvisitor.cpp.

1532{
1533 if (m_hide) return;
1534 if (Config_getBool(PDF_HYPERLINKS))
1535 {
1536 m_t << "\\href{";
1537 m_t << latexFilterURL(href.url());
1538 m_t << "}";
1539 }
1540 m_t << "{\\texttt{";
1541 visitChildren(href);
1542 m_t << "}}";
1543}

References Config_getBool, latexFilterURL, m_hide, m_t, DocHRef::url and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHtmlSummary & d)

Declaration at line 90 of file latexdocvisitor.h, definition at line 1545 of file latexdocvisitor.cpp.

1546{
1547 if (m_hide) return;
1548 m_t << "{\\bfseries{";
1549 visitChildren(d);
1550 m_t << "}}";
1551}

References m_hide, m_t and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHtmlDetails & d)

Declaration at line 91 of file latexdocvisitor.h, definition at line 1553 of file latexdocvisitor.cpp.

1554{
1555 if (m_hide) return;
1556 m_t << "\n\n";
1557 auto summary = d.summary();
1558 if (summary)
1559 {
1560 std::visit(*this,*summary);
1561 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1562 }
1563 visitChildren(d);
1564 if (summary)
1565 {
1566 m_t << "\\end{adjustwidth}\n";
1567 }
1568 else
1569 {
1570 m_t << "\n\n";
1571 }
1572}

References m_hide, m_t, DocHtmlDetails::summary and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHtmlHeader & header)

Declaration at line 92 of file latexdocvisitor.h, definition at line 1574 of file latexdocvisitor.cpp.

1575{
1576 if (m_hide) return;
1577 m_t << "\\" << getSectionName(header.level()) << "*{";
1578 visitChildren(header);
1579 m_t << "}";
1580}

References getSectionName, DocHtmlHeader::level, m_hide, m_t and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocImage & img)

Declaration at line 93 of file latexdocvisitor.h, definition at line 1582 of file latexdocvisitor.cpp.

1583{
1584 if (img.type()==DocImage::Latex)
1585 {
1586 if (m_hide) return;
1587 QCString gfxName = img.name();
1588 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1589 {
1590 gfxName=gfxName.left(gfxName.length()-4);
1591 }
1592
1593 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1594 visitChildren(img);
1596 }
1597 else // other format -> skip
1598 {
1599 }
1600}

References QCString::endsWith, DocImage::hasCaption, DocImage::height, DocImage::isInlineImage, DocImage::Latex, QCString::left, QCString::length, m_hide, m_t, DocImage::name, DocImage::type, visitChildren, visitPostEnd, visitPreStart and DocImage::width.

operator()()

void LatexDocVisitor::operator() (const DocDotFile & df)

operator()()

void LatexDocVisitor::operator() (const DocMscFile & df)

operator()()

void LatexDocVisitor::operator() (const DocDiaFile & df)

operator()()

operator()()

void LatexDocVisitor::operator() (const DocLink & lnk)

Declaration at line 98 of file latexdocvisitor.h, definition at line 1638 of file latexdocvisitor.cpp.

1639{
1640 if (m_hide) return;
1641 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1642 visitChildren(lnk);
1643 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1644}

References DocLink::anchor, endLink, DocLink::file, m_hide, DocLink::ref, startLink and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocRef & ref)

Declaration at line 99 of file latexdocvisitor.h, definition at line 1646 of file latexdocvisitor.cpp.

1647{
1648 if (m_hide) return;
1649 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1650 // ref.anchor() for LaTeX/RTF
1651 if (ref.isSubPage())
1652 {
1653 startLink(ref.ref(),QCString(),ref.anchor());
1654 }
1655 else
1656 {
1657 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1658 }
1659 if (!ref.hasLinkText())
1660 {
1661 filter(ref.targetTitle());
1662 }
1663 visitChildren(ref);
1664 if (ref.isSubPage())
1665 {
1666 endLink(ref.ref(),QCString(),ref.anchor());
1667 }
1668 else
1669 {
1670 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1671 }
1672}

References DocRef::anchor, endLink, DocRef::file, filter, DocRef::hasLinkText, QCString::isEmpty, DocRef::isSubPage, m_hide, DocRef::ref, DocRef::refToSection, DocRef::refToTable, DocRef::sectionType, startLink, DocRef::targetTitle and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocSecRefItem & ref)

Declaration at line 100 of file latexdocvisitor.h, definition at line 1674 of file latexdocvisitor.cpp.

1675{
1676 if (m_hide) return;
1677 m_t << "\\item \\contentsline{section}{";
1678 if (ref.isSubPage())
1679 {
1680 startLink(ref.ref(),QCString(),ref.anchor());
1681 }
1682 else
1683 {
1684 if (!ref.file().isEmpty())
1685 {
1686 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1687 }
1688 }
1689 visitChildren(ref);
1690 if (ref.isSubPage())
1691 {
1692 endLink(ref.ref(),QCString(),ref.anchor());
1693 }
1694 else
1695 {
1696 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1697 }
1698 m_t << "}{\\ref{";
1699 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1700 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1701 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1702 m_t << "}}{}\n";
1703}

References DocSecRefItem::anchor, endLink, DocSecRefItem::file, QCString::isEmpty, DocSecRefItem::isSubPage, m_hide, m_t, DocSecRefItem::ref, DocSecRefItem::refToTable, startLink, stripPath and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocSecRefList & l)

Declaration at line 101 of file latexdocvisitor.h, definition at line 1705 of file latexdocvisitor.cpp.

1706{
1707 if (m_hide) return;
1708 m_t << "\\footnotesize\n";
1709 m_t << "\\begin{multicols}{2}\n";
1710 m_t << "\\begin{DoxyCompactList}\n";
1712 visitChildren(l);
1714 m_t << "\\end{DoxyCompactList}\n";
1715 m_t << "\\end{multicols}\n";
1716 m_t << "\\normalsize\n";
1717}

References decIndentLevel, incIndentLevel, m_hide, m_t and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocParamSect & s)

Declaration at line 102 of file latexdocvisitor.h, definition at line 1719 of file latexdocvisitor.cpp.

1720{
1721 if (m_hide) return;
1722 bool hasInOutSpecs = s.hasInOutSpecifier();
1723 bool hasTypeSpecs = s.hasTypeSpecifier();
1724 m_lcg.incUsedTableLevel();
1725 switch(s.type())
1726 {
1728 m_t << "\n\\begin{DoxyParams}";
1729 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1730 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1731 m_t << "{";
1732 filter(theTranslator->trParameters());
1733 break;
1735 m_t << "\n\\begin{DoxyRetVals}{";
1736 filter(theTranslator->trReturnValues());
1737 break;
1739 m_t << "\n\\begin{DoxyExceptions}{";
1740 filter(theTranslator->trExceptions());
1741 break;
1743 m_t << "\n\\begin{DoxyTemplParams}{";
1744 filter(theTranslator->trTemplateParameters());
1745 break;
1746 default:
1747 ASSERT(0);
1749 }
1750 m_t << "}\n";
1751 visitChildren(s);
1752 m_lcg.decUsedTableLevel();
1753 switch(s.type())
1754 {
1756 m_t << "\\end{DoxyParams}\n";
1757 break;
1759 m_t << "\\end{DoxyRetVals}\n";
1760 break;
1762 m_t << "\\end{DoxyExceptions}\n";
1763 break;
1765 m_t << "\\end{DoxyTemplParams}\n";
1766 break;
1767 default:
1768 ASSERT(0);
1770 }
1771}

References ASSERT, decIndentLevel, DocParamSect::Exception, filter, DocParamSect::hasInOutSpecifier, DocParamSect::hasTypeSpecifier, incIndentLevel, m_hide, m_lcg, m_t, DocParamSect::Param, DocParamSect::RetVal, DocParamSect::TemplateParam, theTranslator, DocParamSect::type and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocParamList & pl)

Declaration at line 103 of file latexdocvisitor.h, definition at line 1778 of file latexdocvisitor.cpp.

1779{
1780 if (m_hide) return;
1782 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1783 if (sect)
1784 {
1785 parentType = sect->type();
1786 }
1787 bool useTable = parentType==DocParamSect::Param ||
1788 parentType==DocParamSect::RetVal ||
1789 parentType==DocParamSect::Exception ||
1790 parentType==DocParamSect::TemplateParam;
1791 if (!useTable)
1792 {
1793 m_t << "\\item[";
1794 }
1795 if (sect && sect->hasInOutSpecifier())
1796 {
1798 {
1799 m_t << "\\mbox{\\texttt{";
1800 if (pl.direction()==DocParamSect::In)
1801 {
1802 m_t << "in";
1803 }
1804 else if (pl.direction()==DocParamSect::Out)
1805 {
1806 m_t << "out";
1807 }
1808 else if (pl.direction()==DocParamSect::InOut)
1809 {
1810 m_t << "in,out";
1811 }
1812 m_t << "}} ";
1813 }
1814 if (useTable) m_t << " & ";
1815 }
1816 if (sect && sect->hasTypeSpecifier())
1817 {
1818 for (const auto &type : pl.paramTypes())
1819 {
1820 std::visit(*this,type);
1821 }
1822 if (useTable) m_t << " & ";
1823 }
1824 m_t << "{\\em ";
1825 bool first=TRUE;
1826 for (const auto &param : pl.parameters())
1827 {
1828 if (!first) m_t << ","; else first=FALSE;
1830 std::visit(*this,param);
1832 }
1833 m_t << "}";
1834 if (useTable)
1835 {
1836 m_t << " & ";
1837 }
1838 else
1839 {
1840 m_t << "]";
1841 }
1842 for (const auto &par : pl.paragraphs())
1843 {
1844 std::visit(*this,par);
1845 }
1846 if (useTable)
1847 {
1848 m_t << "\\\\\n"
1849 << "\\hline\n";
1850 }
1851}

References DocParamList::direction, DocParamSect::Exception, FALSE, DocParamSect::hasInOutSpecifier, DocParamSect::hasTypeSpecifier, DocParamSect::In, DocParamSect::InOut, m_hide, m_insideItem, m_t, DocParamSect::Out, DocParamList::paragraphs, DocParamSect::Param, DocParamList::parameters, DocParamList::paramTypes, DocNode::parent, DocParamSect::RetVal, DocParamSect::TemplateParam, TRUE, DocParamSect::type, DocParamSect::Unknown and DocParamSect::Unspecified.

operator()()

void LatexDocVisitor::operator() (const DocXRefItem & x)

Declaration at line 104 of file latexdocvisitor.h, definition at line 1853 of file latexdocvisitor.cpp.

1854{
1855 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1856 if (m_hide) return;
1857 if (x.title().isEmpty()) return;
1859 m_t << "\\begin{DoxyRefDesc}{";
1860 filter(x.title());
1861 m_t << "}\n";
1862 bool anonymousEnum = x.file()=="@";
1863 m_t << "\\item[";
1864 if (pdfHyperlinks && !anonymousEnum)
1865 {
1866 m_t << "\\mbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1867 }
1868 else
1869 {
1870 m_t << "\\textbf{ ";
1871 }
1873 filter(x.title());
1875 if (pdfHyperlinks && !anonymousEnum)
1876 {
1877 m_t << "}";
1878 }
1879 m_t << "}]";
1880 visitChildren(x);
1881 if (x.title().isEmpty()) return;
1883 m_t << "\\end{DoxyRefDesc}\n";
1884}

References DocXRefItem::anchor, Config_getBool, decIndentLevel, FALSE, DocXRefItem::file, filter, incIndentLevel, QCString::isEmpty, m_hide, m_insideItem, m_t, stripPath, DocXRefItem::title, TRUE and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocInternalRef & ref)

Declaration at line 105 of file latexdocvisitor.h, definition at line 1886 of file latexdocvisitor.cpp.

1887{
1888 if (m_hide) return;
1889 startLink(QCString(),ref.file(),ref.anchor());
1890 visitChildren(ref);
1891 endLink(QCString(),ref.file(),ref.anchor());
1892}

References DocInternalRef::anchor, endLink, DocInternalRef::file, m_hide, startLink and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocText & t)

Declaration at line 106 of file latexdocvisitor.h, definition at line 1894 of file latexdocvisitor.cpp.

1895{
1896 if (m_hide) return;
1897 visitChildren(t);
1898}

References m_hide and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocHtmlBlockQuote & q)

Declaration at line 107 of file latexdocvisitor.h, definition at line 1900 of file latexdocvisitor.cpp.

1901{
1902 if (m_hide) return;
1903 m_t << "\\begin{quote}\n";
1905 visitChildren(q);
1906 m_t << "\\end{quote}\n";
1908}

References decIndentLevel, incIndentLevel, m_hide, m_t and visitChildren.

operator()()

void LatexDocVisitor::operator() (const DocVhdlFlow &)

Declaration at line 108 of file latexdocvisitor.h, definition at line 1910 of file latexdocvisitor.cpp.

1911{
1912}

operator()()

void LatexDocVisitor::operator() (const DocParBlock & pb)

Declaration at line 109 of file latexdocvisitor.h, definition at line 1914 of file latexdocvisitor.cpp.

1915{
1916 if (m_hide) return;
1917 visitChildren(pb);
1918}

References m_hide and visitChildren.

Private Member Functions

addRowSpan()

void LatexDocVisitor::addRowSpan (ActiveRowSpan && span)
inline

Definition at line 260 of file latexdocvisitor.h.

261 {
262 if (!m_tableStateStack.empty()) m_tableStateStack.top().rowSpans.push_back(std::move(span));
263 }

Reference m_tableStateStack.

Referenced by operator().

currentColumn()

size_t LatexDocVisitor::currentColumn ()
inline

Definition at line 216 of file latexdocvisitor.h.

216 size_t currentColumn() const
217 {
218 return !m_tableStateStack.empty() ? m_tableStateStack.top().currentColumn : 0;
219 }

Reference m_tableStateStack.

Referenced by operator() and operator().

decIndentLevel()

void LatexDocVisitor::decIndentLevel ()

Declaration at line 168 of file latexdocvisitor.h, definition at line 2157 of file latexdocvisitor.cpp.

2158{
2159 if (m_indentLevel>0)
2160 {
2162 }
2163}

Reference m_indentLevel.

Referenced by operator(), operator(), operator(), operator(), operator(), operator(), operator(), operator() and operator().

endDiaFile()

void LatexDocVisitor::endDiaFile (bool hasCaption)

Declaration at line 157 of file latexdocvisitor.h, definition at line 2077 of file latexdocvisitor.cpp.

2077void LatexDocVisitor::endDiaFile(bool hasCaption)
2078{
2079 if (m_hide) return;
2080 visitPostEnd(m_t,hasCaption);
2081}

References m_hide, m_t and visitPostEnd.

Referenced by operator().

endDotFile()

void LatexDocVisitor::endDotFile (bool hasCaption)

Declaration at line 146 of file latexdocvisitor.h, definition at line 2021 of file latexdocvisitor.cpp.

2021void LatexDocVisitor::endDotFile(bool hasCaption)
2022{
2023 if (m_hide) return;
2024 visitPostEnd(m_t,hasCaption);
2025}

References m_hide, m_t and visitPostEnd.

Referenced by operator() and operator().

endLink()

void LatexDocVisitor::endLink (const QCString & ref, const QCString & file, const QCString & anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)

Declaration at line 140 of file latexdocvisitor.h, definition at line 1980 of file latexdocvisitor.cpp.

1980void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool /*refToTable*/,bool refToSection, SectionType sectionType)
1981{
1982 m_t << "}";
1983 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1984 if (ref.isEmpty() && !pdfHyperLinks)
1985 {
1986 m_t << "{";
1987 filter(theTranslator->trPageAbbreviation());
1988 m_t << "}{" << file;
1989 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1990 m_t << anchor << "}";
1991 if (refToSection)
1992 {
1993 m_t << "{" << sectionType.level() << "}";
1994 }
1995 }
1996 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1997 {
1998 if (refToSection)
1999 {
2000 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
2001 }
2002 }
2003}

References Config_getBool, filter, QCString::isEmpty, SectionType::level, m_t, m_texOrPdf, PDF and theTranslator.

Referenced by operator(), operator(), operator(), operator() and operator().

endMscFile()

void LatexDocVisitor::endMscFile (bool hasCaption)

Declaration at line 151 of file latexdocvisitor.h, definition at line 2043 of file latexdocvisitor.cpp.

2043void LatexDocVisitor::endMscFile(bool hasCaption)
2044{
2045 if (m_hide) return;
2046 visitPostEnd(m_t,hasCaption);
2047}

References m_hide, m_t and visitPostEnd.

Referenced by operator().

endPlantUmlFile()

void LatexDocVisitor::endPlantUmlFile (bool hasCaption)

Declaration at line 163 of file latexdocvisitor.h, definition at line 2137 of file latexdocvisitor.cpp.

2138{
2139 if (m_hide) return;
2140 visitPostEnd(m_t,hasCaption);
2141}

References m_hide, m_t and visitPostEnd.

Referenced by operator().

escapeMakeIndexChars()

QCString LatexDocVisitor::escapeMakeIndexChars (const char * s)

Declaration at line 142 of file latexdocvisitor.h, definition at line 240 of file latexdocvisitor.cpp.

241{
242 QCString result;
243 const char *p=s;
244 char str[2]; str[1]=0;
245 char c = 0;
246 if (p)
247 {
248 while ((c=*p++))
249 {
250 switch (c)
251 {
252 case '!': m_t << "\"!"; break;
253 case '"': m_t << "\"\""; break;
254 case '@': m_t << "\"@"; break;
255 case '|': m_t << "\\texttt{\"|}"; break;
256 case '[': m_t << "["; break;
257 case ']': m_t << "]"; break;
258 case '{': m_t << "\\lcurly{}"; break;
259 case '}': m_t << "\\rcurly{}"; break;
260 default: str[0]=c; filter(str); break;
261 }
262 }
263 }
264 return result;
265}

References filter and m_t.

filter()

void LatexDocVisitor::filter (const QCString & str, const bool retainNewLine=false)

Declaration at line 137 of file latexdocvisitor.h, definition at line 1920 of file latexdocvisitor.cpp.

1920void LatexDocVisitor::filter(const QCString &str, const bool retainNewLine)
1921{
1922 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1924 m_lcg.insideTabbing(),
1927 m_lcg.usedTableLevel()>0, // insideTable
1928 false, // keepSpaces
1929 retainNewLine
1930 );
1931}

References filterLatexString, m_insideItem, m_insidePre, m_lcg and m_t.

Referenced by endLink, escapeMakeIndexChars, operator(), operator(), operator(), operator(), operator(), operator(), operator(), operator(), operator() and operator().

firstRow()

bool LatexDocVisitor::firstRow ()
inline

Definition at line 248 of file latexdocvisitor.h.

248 bool firstRow() const
249 {
250 return !m_tableStateStack.empty() ? m_tableStateStack.top().firstRow : FALSE;
251 }

References FALSE and m_tableStateStack.

Referenced by operator() and operator().

getSectionName()

const char * LatexDocVisitor::getSectionName (int level)

Declaration at line 170 of file latexdocvisitor.h, definition at line 59 of file latexdocvisitor.cpp.

59const char *LatexDocVisitor::getSectionName(int level) const
60{
61 bool compactLatex = Config_getBool(COMPACT_LATEX);
62 int l = level;
63 if (compactLatex) l++;
64
65 if (l < g_maxLevels)
66 {
67 l += m_hierarchyLevel; /* May be -1 if generating main page */
68 // Sections get special treatment because they inherit the parent's level
69 if (l >= g_maxLevels)
70 {
71 l = g_maxLevels - 1;
72 }
73 else if (l < 0)
74 {
75 /* Should not happen; level is always >= 1 and hierarchyLevel >= -1 */
76 l = 0;
77 }
78 return g_secLabels[l];
79 }
80 else if (l == 7)
81 {
82 return g_paragraphLabel;
83 }
84 else
85 {
87 }
88}

References Config_getBool, g_maxLevels, g_paragraphLabel, g_secLabels, g_subparagraphLabel and m_hierarchyLevel.

Referenced by operator() and operator().

incIndentLevel()

void LatexDocVisitor::incIndentLevel ()

Declaration at line 167 of file latexdocvisitor.h, definition at line 2148 of file latexdocvisitor.cpp.

2149{
2152 {
2153 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2154 }
2155}

References err, m_indentLevel and maxIndentLevels.

Referenced by operator(), operator(), operator(), operator(), operator(), operator(), operator(), operator() and operator().

inColSpan()

bool LatexDocVisitor::inColSpan ()
inline

Definition at line 240 of file latexdocvisitor.h.

240 bool inColSpan() const
241 {
242 return !m_tableStateStack.empty() ? m_tableStateStack.top().inColSpan : FALSE;
243 }

References FALSE and m_tableStateStack.

Referenced by operator().

indentLevel()

int LatexDocVisitor::indentLevel ()

Declaration at line 169 of file latexdocvisitor.h, definition at line 2143 of file latexdocvisitor.cpp.

2144{
2145 return std::min(m_indentLevel,maxIndentLevels-1);
2146}

References m_indentLevel and maxIndentLevels.

Referenced by operator(), operator(), operator() and operator().

inRowSpan()

bool LatexDocVisitor::inRowSpan ()
inline

Definition at line 232 of file latexdocvisitor.h.

232 bool inRowSpan() const
233 {
234 return !m_tableStateStack.empty() ? m_tableStateStack.top().inRowSpan : FALSE;
235 }

References FALSE and m_tableStateStack.

Referenced by operator().

insideTable()

bool LatexDocVisitor::insideTable ()
inline

Definition at line 264 of file latexdocvisitor.h.

264 bool insideTable() const
265 {
266 return !m_tableStateStack.empty();
267 }

Reference m_tableStateStack.

Referenced by operator() and operator().

isTableNested()

bool LatexDocVisitor::isTableNested (const DocNodeVariant * n)

Declaration at line 269 of file latexdocvisitor.h, definition at line 1241 of file latexdocvisitor.cpp.

1242{
1243 bool isNested=m_lcg.usedTableLevel()>0;
1244 while (n && !isNested)
1245 {
1247 n = ::parent(n);
1248 }
1249 return isNested;
1250}

References holds_one_of_alternatives, m_lcg and parent.

Referenced by operator(), operator(), writeEndTableCommand and writeStartTableCommand.

numCols()

size_t LatexDocVisitor::numCols ()
inline

Definition at line 224 of file latexdocvisitor.h.

224 size_t numCols() const
225 {
226 return !m_tableStateStack.empty() ? m_tableStateStack.top().numCols : 0;
227 }

Reference m_tableStateStack.

Referenced by operator().

popTableState()

void LatexDocVisitor::popTableState ()
inline

Definition at line 212 of file latexdocvisitor.h.

213 {
215 }

Reference m_tableStateStack.

Referenced by operator().

pushTableState()

void LatexDocVisitor::pushTableState ()
inline

Definition at line 208 of file latexdocvisitor.h.

209 {
210 m_tableStateStack.emplace();
211 }

Reference m_tableStateStack.

Referenced by operator().

rowSpans()

RowSpanList & LatexDocVisitor::rowSpans ()
inline

Definition at line 256 of file latexdocvisitor.h.

257 {
258 return !m_tableStateStack.empty() ? m_tableStateStack.top().rowSpans : m_emptyRowSpanList;
259 }

References m_emptyRowSpanList and m_tableStateStack.

Referenced by operator() and operator().

setCurrentColumn()

void LatexDocVisitor::setCurrentColumn (size_t col)
inline

Definition at line 220 of file latexdocvisitor.h.

220 void setCurrentColumn(size_t col)
221 {
222 if (!m_tableStateStack.empty()) m_tableStateStack.top().currentColumn = col;
223 }

Reference m_tableStateStack.

Referenced by operator() and operator().

setFirstRow()

void LatexDocVisitor::setFirstRow (bool b)
inline

Definition at line 252 of file latexdocvisitor.h.

252 void setFirstRow(bool b)
253 {
254 if (!m_tableStateStack.empty()) m_tableStateStack.top().firstRow = b;
255 }

Reference m_tableStateStack.

Referenced by operator().

setInColSpan()

void LatexDocVisitor::setInColSpan (bool b)
inline

Definition at line 244 of file latexdocvisitor.h.

244 void setInColSpan(bool b)
245 {
246 if (!m_tableStateStack.empty()) m_tableStateStack.top().inColSpan = b;
247 }

Reference m_tableStateStack.

Referenced by operator().

setInRowSpan()

void LatexDocVisitor::setInRowSpan (bool b)
inline

Definition at line 236 of file latexdocvisitor.h.

236 void setInRowSpan(bool b)
237 {
238 if (!m_tableStateStack.empty()) m_tableStateStack.top().inRowSpan = b;
239 }

Reference m_tableStateStack.

Referenced by operator().

setNumCols()

void LatexDocVisitor::setNumCols (size_t num)
inline

Definition at line 228 of file latexdocvisitor.h.

228 void setNumCols(size_t num)
229 {
230 if (!m_tableStateStack.empty()) m_tableStateStack.top().numCols = num;
231 }

Reference m_tableStateStack.

Referenced by operator().

startDiaFile()

void LatexDocVisitor::startDiaFile (const QCString & fileName, const QCString & width, const QCString & height, bool hasCaption, const QCString & srcFile, int srcLine)

Declaration at line 154 of file latexdocvisitor.h, definition at line 2061 of file latexdocvisitor.cpp.

2062 const QCString &width,
2063 const QCString &height,
2064 bool hasCaption,
2065 const QCString &srcFile,
2066 int srcLine
2067 )
2068{
2069 QCString baseName=makeBaseName(fileName);
2070 baseName.prepend("dia_");
2071
2072 QCString outDir = Config_getString(LATEX_OUTPUT);
2073 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
2074 visitPreStart(m_t,hasCaption, baseName, width, height);
2075}

References Config_getString, EPS, m_t, makeBaseName, QCString::prepend, visitPreStart and writeDiaGraphFromFile.

Referenced by operator().

startDotFile()

void LatexDocVisitor::startDotFile (const QCString & fileName, const QCString & width, const QCString & height, bool hasCaption, const QCString & srcFile, int srcLine)

Declaration at line 143 of file latexdocvisitor.h, definition at line 2005 of file latexdocvisitor.cpp.

2006 const QCString &width,
2007 const QCString &height,
2008 bool hasCaption,
2009 const QCString &srcFile,
2010 int srcLine
2011 )
2012{
2013 QCString baseName=makeBaseName(fileName);
2014 baseName.prepend("dot_");
2015 QCString outDir = Config_getString(LATEX_OUTPUT);
2016 QCString name = fileName;
2017 writeDotGraphFromFile(name,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
2018 visitPreStart(m_t,hasCaption, baseName, width, height);
2019}

References Config_getString, EPS, m_t, makeBaseName, QCString::prepend, visitPreStart and writeDotGraphFromFile.

Referenced by operator() and operator().

startLink()

void LatexDocVisitor::startLink (const QCString & ref, const QCString & file, const QCString & anchor, bool refToTable=false, bool refToSection=false)

Declaration at line 138 of file latexdocvisitor.h, definition at line 1933 of file latexdocvisitor.cpp.

1933void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,
1934 bool refToTable,bool refToSection)
1935{
1936 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1937 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1938 {
1939 if (refToTable)
1940 {
1941 m_t << "\\doxytablelink{";
1942 }
1943 else if (refToSection)
1944 {
1945 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1946 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1947 }
1948 else
1949 {
1950 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1951 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1952 }
1953 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1954 {
1955 if (!file.isEmpty()) m_t << stripPath(file);
1956 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1957 if (!anchor.isEmpty()) m_t << anchor;
1958 m_t << "}";
1959 }
1960 m_t << "{";
1961 }
1962 else if (ref.isEmpty() && refToSection)
1963 {
1964 m_t << "\\doxysectref{";
1965 }
1966 else if (ref.isEmpty() && refToTable)
1967 {
1968 m_t << "\\doxytableref{";
1969 }
1970 else if (ref.isEmpty()) // internal non-PDF link
1971 {
1972 m_t << "\\doxyref{";
1973 }
1974 else // external link
1975 {
1976 m_t << "\\textbf{ ";
1977 }
1978}

References Config_getBool, QCString::isEmpty, m_t, m_texOrPdf, PDF, stripPath and TEX.

Referenced by operator(), operator(), operator(), operator() and operator().

startMscFile()

void LatexDocVisitor::startMscFile (const QCString & fileName, const QCString & width, const QCString & height, bool hasCaption, const QCString & srcFile, int srcLine)

Declaration at line 148 of file latexdocvisitor.h, definition at line 2027 of file latexdocvisitor.cpp.

2028 const QCString &width,
2029 const QCString &height,
2030 bool hasCaption,
2031 const QCString &srcFile,
2032 int srcLine
2033 )
2034{
2035 QCString baseName=makeBaseName(fileName);
2036 baseName.prepend("msc_");
2037
2038 QCString outDir = Config_getString(LATEX_OUTPUT);
2039 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
2040 visitPreStart(m_t,hasCaption, baseName, width, height);
2041}

References Config_getString, EPS, m_t, makeBaseName, QCString::prepend, visitPreStart and writeMscGraphFromFile.

Referenced by operator().

startPlantUmlFile()

void LatexDocVisitor::startPlantUmlFile (const QCString & fileName, const QCString & width, const QCString & height, bool hasCaption, const QCString & srcFile, int srcLine)

Declaration at line 160 of file latexdocvisitor.h, definition at line 2109 of file latexdocvisitor.cpp.

2110 const QCString &width,
2111 const QCString &height,
2112 bool hasCaption,
2113 const QCString &srcFile,
2114 int srcLine
2115 )
2116{
2117 QCString outDir = Config_getString(LATEX_OUTPUT);
2118 std::string inBuf;
2119 readInputFile(fileName,inBuf);
2120
2121 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2123 outDir,QCString(),inBuf.c_str(),
2125 QCString(),srcFile,srcLine,false);
2126 baseName=makeBaseName(baseName);
2127 QCString shortName = makeShortName(baseName);
2128 if (useBitmap)
2129 {
2130 if (shortName.find('.')==-1) shortName += ".png";
2131 }
2134 visitPreStart(m_t,hasCaption, shortName, width, height);
2135}

References Config_getString, QCString::find, PlantumlManager::generatePlantUMLOutput, PlantumlManager::instance, m_t, makeBaseName, makeShortName, PlantumlManager::PUML_BITMAP, PlantumlManager::PUML_EPS, readInputFile, visitPreStart and PlantumlManager::writePlantUMLSource.

Referenced by operator().

visitCaption()

void LatexDocVisitor::visitCaption (const DocNodeList & children)

Declaration at line 165 of file latexdocvisitor.h, definition at line 232 of file latexdocvisitor.cpp.

233{
234 for (const auto &n : children)
235 {
236 std::visit(*this,n);
237 }
238}

Referenced by writeDiaFile, writeMscFile and writePlantUMLFile.

visitChildren()

template <class T>
void LatexDocVisitor::visitChildren (const T & t)
inline

writeDiaFile()

void LatexDocVisitor::writeDiaFile (const QCString & fileName, const DocVerbatim & s)

Declaration at line 158 of file latexdocvisitor.h, definition at line 2084 of file latexdocvisitor.cpp.

2085{
2086 QCString shortName = makeShortName(baseName);
2087 QCString outDir = Config_getString(LATEX_OUTPUT);
2088 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::EPS,s.srcFile(),s.srcLine());
2089 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2092}

References DocVerbatim::children, Config_getString, EPS, DocVerbatim::hasCaption, DocVerbatim::height, m_t, makeShortName, DocVerbatim::srcFile, DocVerbatim::srcLine, visitCaption, visitPostEnd, visitPreStart, DocVerbatim::width and writeDiaGraphFromFile.

writeEndTableCommand()

void LatexDocVisitor::writeEndTableCommand (const DocNodeVariant * n)

Declaration at line 271 of file latexdocvisitor.h, definition at line 1265 of file latexdocvisitor.cpp.

1266{
1267 if (isTableNested(n))
1268 {
1269 m_t << "\\end{tabularx}}\n";
1270 }
1271 else
1272 {
1273 m_t << "\\end{longtabu}\n";
1274 }
1275 //return isNested ? "TabularNC" : "TabularC";
1276}

References isTableNested and m_t.

Referenced by operator().

writeMscFile()

void LatexDocVisitor::writeMscFile (const QCString & fileName, const DocVerbatim & s)

Declaration at line 152 of file latexdocvisitor.h, definition at line 2050 of file latexdocvisitor.cpp.

2051{
2052 QCString shortName = makeShortName(baseName);
2053 QCString outDir = Config_getString(LATEX_OUTPUT);
2054 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
2055 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
2058}

References DocVerbatim::children, Config_getString, EPS, DocVerbatim::hasCaption, DocVerbatim::height, m_t, makeShortName, DocVerbatim::srcFile, DocVerbatim::srcLine, visitCaption, visitPostEnd, visitPreStart, DocVerbatim::width and writeMscGraphFromFile.

Referenced by operator().

writePlantUMLFile()

void LatexDocVisitor::writePlantUMLFile (const QCString & fileName, const DocVerbatim & s)

writeStartTableCommand()

void LatexDocVisitor::writeStartTableCommand (const DocNodeVariant * n, size_t cols)

Declaration at line 270 of file latexdocvisitor.h, definition at line 1252 of file latexdocvisitor.cpp.

1253{
1254 if (isTableNested(n))
1255 {
1256 m_t << "{\\begin{tabularx}{\\linewidth}{|*{" << cols << "}{>{\\raggedright\\arraybackslash}X|}}";
1257 }
1258 else
1259 {
1260 m_t << "\\tabulinesep=1mm\n\\begin{longtabu}spread 0pt [c]{*{" << cols << "}{|X[-1]}|}\n";
1261 }
1262 //return isNested ? "TabularNC" : "TabularC";
1263}

References isTableNested and m_t.

Referenced by operator().

Private Member Attributes

m_ci

OutputCodeList& LatexDocVisitor::m_ci

Definition at line 177 of file latexdocvisitor.h.

Referenced by LatexDocVisitor, operator(), operator() and operator().

m_emptyRowSpanList

RowSpanList LatexDocVisitor::m_emptyRowSpanList

Definition at line 196 of file latexdocvisitor.h.

Referenced by rowSpans.

m_hide

m_hierarchyLevel

int LatexDocVisitor::m_hierarchyLevel

Definition at line 183 of file latexdocvisitor.h.

Referenced by getSectionName and LatexDocVisitor.

m_indentLevel

int LatexDocVisitor::m_indentLevel = 0

Definition at line 199 of file latexdocvisitor.h.

Referenced by decIndentLevel, incIndentLevel, indentLevel, operator() and operator().

m_insideItem

bool LatexDocVisitor::m_insideItem

Definition at line 180 of file latexdocvisitor.h.

Referenced by filter, LatexDocVisitor, operator(), operator(), operator(), operator() and operator().

m_insidePre

bool LatexDocVisitor::m_insidePre

Definition at line 179 of file latexdocvisitor.h.

Referenced by filter, LatexDocVisitor, operator(), operator() and operator().

m_langExt

QCString LatexDocVisitor::m_langExt

Definition at line 182 of file latexdocvisitor.h.

Referenced by LatexDocVisitor, operator() and operator().

m_lcg

LatexCodeGenerator& LatexDocVisitor::m_lcg

Definition at line 178 of file latexdocvisitor.h.

Referenced by filter, isTableNested, LatexDocVisitor and operator().

m_listItemInfo

LatexListItemInfo LatexDocVisitor::m_listItemInfo[maxIndentLevels]

m_t

m_tableStateStack

std::stack<TableState> LatexDocVisitor::m_tableStateStack

Definition at line 195 of file latexdocvisitor.h.

195 std::stack<TableState> m_tableStateStack; // needed for nested tables

Referenced by addRowSpan, currentColumn, firstRow, inColSpan, inRowSpan, insideTable, numCols, popTableState, pushTableState, rowSpans, setCurrentColumn, setFirstRow, setInColSpan, setInRowSpan and setNumCols.

m_texOrPdf

TexOrPdf LatexDocVisitor::m_texOrPdf = TexOrPdf::NO

Definition at line 184 of file latexdocvisitor.h.

Referenced by endLink, operator(), operator() and startLink.

Private Static Attributes

maxIndentLevels

const int LatexDocVisitor::maxIndentLevels = 13
static

Definition at line 198 of file latexdocvisitor.h.

198 static const int maxIndentLevels = 13;

Referenced by incIndentLevel, indentLevel, operator() and operator().


The documentation for this class was generated from the following files:


Generated via doxygen2docusaurus by Doxygen 1.14.0.