diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2018-11-11 13:57:38 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2018-11-11 14:07:44 (GMT) |
commit | 70c7e8f3491e1fa30a2eaa89b960dd5b4d7a2185 (patch) | |
tree | 2f1d9530d716cc9328c7f6644b778d4fb33d0504 /src/latexdocvisitor.cpp | |
parent | 933a6e3d74f9109ad6ec921aded645d87111585b (diff) | |
parent | 4682b91364247aafe66b6af472e321511e115e7c (diff) | |
download | Doxygen-70c7e8f3491e1fa30a2eaa89b960dd5b4d7a2185.zip Doxygen-70c7e8f3491e1fa30a2eaa89b960dd5b4d7a2185.tar.gz Doxygen-70c7e8f3491e1fa30a2eaa89b960dd5b4d7a2185.tar.bz2 |
Merge branch 'feature/bug_inline_image' of https://github.com/albert-github/doxygen into albert-github-feature/bug_inline_image
Diffstat (limited to 'src/latexdocvisitor.cpp')
-rw-r--r-- | src/latexdocvisitor.cpp | 59 |
1 files changed, 44 insertions, 15 deletions
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 3a6efaa..7663572 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -49,16 +49,23 @@ static const char *getSectionName(int level) return secLabels[QMIN(maxLevels-1,l)]; } -static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height) +static void visitPreStart(FTextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage = FALSE) { - if (hasCaption) + if (inlineImage) { - t << "\n\\begin{DoxyImage}\n"; + t << "\n\\begin{DoxyInlineImage}\n"; } else { - t << "\n\\begin{DoxyImageNoCaption}\n" - " \\mbox{"; + if (hasCaption) + { + t << "\n\\begin{DoxyImage}\n"; + } + else + { + t << "\n\\begin{DoxyImageNoCaption}\n" + " \\mbox{"; + } } t << "\\includegraphics"; @@ -81,7 +88,14 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, if (width.isEmpty() && height.isEmpty()) { /* default setting */ - t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]"; + if (inlineImage) + { + t << "[height=\\baselineskip,keepaspectratio=true]"; + } + else + { + t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]"; + } } else { @@ -92,21 +106,36 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, if (hasCaption) { - t << "\n\\doxyfigcaption{"; + if (!inlineImage) + { + t << "\n\\doxyfigcaption{"; + } + else + { + t << "%"; // to catch the caption + } } } -static void visitPostEnd(FTextStream &t, const bool hasCaption) +static void visitPostEnd(FTextStream &t, bool hasCaption, bool inlineImage = FALSE) { - t << "}\n"; // end mbox or caption - if (hasCaption) + if (inlineImage) { - t << "\\end{DoxyImage}\n"; + t << "\n\\end{DoxyInlineImage}\n"; } - else{ - t << "\\end{DoxyImageNoCaption}\n"; + else + { + t << "}\n"; // end mbox or caption + if (hasCaption) + { + t << "\\end{DoxyImage}\n"; + } + else + { + t << "\\end{DoxyImageNoCaption}\n"; + } } } @@ -1338,7 +1367,7 @@ void LatexDocVisitor::visitPre(DocImage *img) gfxName=gfxName.left(gfxName.length()-4); } - visitPreStart(m_t,img->hasCaption(), gfxName, img->width(), img->height()); + visitPreStart(m_t,img->hasCaption(), gfxName, img->width(), img->height(), img->isInlineImage()); } else // other format -> skip { @@ -1352,7 +1381,7 @@ void LatexDocVisitor::visitPost(DocImage *img) if (img->type()==DocImage::Latex) { if (m_hide) return; - visitPostEnd(m_t,img->hasCaption()); + visitPostEnd(m_t,img->hasCaption(), img->isInlineImage()); } else // other format { |