summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2018-06-05 09:46:03 (GMT)
committeralbert-github <albert.tests@gmail.com>2018-06-05 09:46:03 (GMT)
commit79ac5232cf029f3d40543641e92daa8aaa1c9f7c (patch)
tree92f9b9a839849faadf167225554a053704b4ce57
parent2899a2d6eefed0cef26647e1c89cf08e02b800d5 (diff)
downloadDoxygen-79ac5232cf029f3d40543641e92daa8aaa1c9f7c.zip
Doxygen-79ac5232cf029f3d40543641e92daa8aaa1c9f7c.tar.gz
Doxygen-79ac5232cf029f3d40543641e92daa8aaa1c9f7c.tar.bz2
Add formula (images) to RTF output
The RTF output was lacking the possibility to have formulas in it (were written as text). This patch generates the images analogous to the HTML, non MATHJAX, version and includes them in the output.
-rw-r--r--doc/formulas.doc5
-rw-r--r--src/doxygen.cpp6
-rw-r--r--src/rtfdocvisitor.cpp16
3 files changed, 22 insertions, 5 deletions
diff --git a/doc/formulas.doc b/doc/formulas.doc
index ee4ff61..f505155 100644
--- a/doc/formulas.doc
+++ b/doc/formulas.doc
@@ -17,9 +17,8 @@
/*! \page formulas Including formulas
Doxygen allows you to put \LaTeX formulas in the
-output (this works only for the HTML and \LaTeX output,
-not for the RTF nor for the man page output). To be able to include
-formulas (as images) in the HTML documentation, you will also need to
+output (this works only for the HTML, \LaTeX and RTF output. To be able to include
+formulas (as images) in the HTML and RTF documentation, you will also need to
have the following tools installed
<ul>
<li>\c latex: the \LaTeX compiler, needed to parse the formulas.
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 263b59f..bc244b7 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -11558,6 +11558,12 @@ void generateOutput()
Doxygen::formulaList->generateBitmaps(Config_getString(HTML_OUTPUT));
g_s.end();
}
+ if (Doxygen::formulaList->count()>0 && generateRtf)
+ {
+ g_s.begin("Generating bitmaps for formulas in RTF...\n");
+ Doxygen::formulaList->generateBitmaps(Config_getString(RTF_OUTPUT));
+ g_s.end();
+ }
if (Config_getBool(SORT_GROUP_NAMES))
{
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index c85b638..7e3f104 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -526,9 +526,21 @@ void RTFDocVisitor::visit(DocIncOperator *op)
void RTFDocVisitor::visit(DocFormula *f)
{
if (m_hide) return;
- // TODO: do something sensible here, like including a bitmap
DBG_RTF("{\\comment RTFDocVisitor::visit(DocFormula)}\n");
- m_t << f->text();
+ bool bDisplay = !f->isInline();
+ if (bDisplay)
+ {
+ m_t << "\\par";
+ m_t << "{";
+ m_t << "\\pard\\plain";
+ m_t << "\\pard";
+ m_t << "\\qc";
+ }
+ m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << f->relPath() << f->name() << ".png\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}";
+ if (bDisplay)
+ {
+ m_t << "\\par}";
+ }
m_lastIsPara=FALSE;
}