Permalink
Browse files

Added \latexinclude command (thanks to Juan Zaratiegui for the patch)

  • Loading branch information...
Dimitri van Heesch
Dimitri van Heesch committed Mar 27, 2014
1 parent 904ad3f commit 1134237afe25f86fcf7c7e2a76a3542eee8acc79
@@ -117,6 +117,7 @@ documentation:
\refitem cmdinternal \\internal
\refitem cmdinvariant \\invariant
\refitem cmdinterface \\interface
\refitem cmdlatexinclude \\latexinclude
\refitem cmdlatexonly \\latexonly
\refitem cmdli \\li
\refitem cmdline \\line
@@ -2224,6 +2225,19 @@ Commands for displaying examples
<hr>
\section cmdlatexinclude \\latexinclude <file-name>
\addindex \\latexinclude
This command includes the file \<file-name\> as is in the LaTeX documentation.
The command is equivalent to pasting the file in the documentation and
placing \ref cmdlatexonly "\\latexonly" and \ref cmdendlatexonly "\\endlatexonly"
commands around it.
Files or directories that doxygen should look for can be specified using the
\ref cfg_example_path "EXAMPLE_PATH" tag of doxygen's configuration file.
<hr>
\htmlonly <center> \endhtmlonly
<h2>
\htmlonly --- \endhtmlonly
@@ -63,6 +63,7 @@ CommandMap cmdMap[] =
{ "internal", CMD_INTERNAL },
{ "invariant", CMD_INVARIANT },
{ "javalink", CMD_JAVALINK },
{ "latexinclude", CMD_LATEXINCLUDE },
{ "latexonly", CMD_LATEXONLY },
{ "li", CMD_LI },
{ "line", CMD_LINE },
@@ -124,7 +124,8 @@ enum CommandType
CMD_ENDINTERNAL = 94,
CMD_PARBLOCK = 95,
CMD_ENDPARBLOCK = 96,
CMD_DIAFILE = 97
CMD_DIAFILE = 97,
CMD_LATEXINCLUDE = 98
};
enum HtmlTagType
@@ -234,6 +234,7 @@ static DocCmdMap docCmdMap[] =
{ "include", 0, TRUE },
{ "includelineno", 0, TRUE },
{ "invariant", 0, TRUE },
{ "latexinclude", 0, FALSE },
{ "li", 0, TRUE },
{ "line", 0, TRUE },
{ "note", 0, TRUE },
@@ -879,7 +880,7 @@ DCMD1 ("arg"|"attention"|"author"|"cite"|"code")
DCMD2 ("date"|"dot"|"msc"|"dotfile"|"example")
DCMD3 ("htmlinclude"|"htmlonly"|"image"|"include")
DCMD4 ("includelineno"|"internal"|"invariant")
DCMD5 ("latexonly"|"li"|"line"|"manonly"|"name")
DCMD5 ("latexinclude"|"latexonly"|"li"|"line"|"manonly"|"name")
DCMD6 ("note"|"par"|"paragraph"|"param"|"post")
DCMD7 ("pre"|"remarks"|(("relate"[sd])("also")?))
DCMD8 ("remarks"|("return"[s]?)|"retval"|"sa"|"section")
@@ -285,6 +285,8 @@ void DocbookDocVisitor::visit(DocInclude *inc)
break;
case DocInclude::HtmlInclude:
break;
case DocInclude::LatexInclude:
break;
case DocInclude::VerbInclude:
m_t << "<verbatim>";
filter(inc->text());
@@ -1777,6 +1777,9 @@ void DocInclude::parse()
case HtmlInclude:
readTextFileByName(m_file,m_text);
break;
case LatexInclude:
readTextFileByName(m_file,m_text);
break;
case Snippet:
readTextFileByName(m_file,m_text);
// check here for the existence of the blockId inside the file, so we
@@ -5628,6 +5631,9 @@ int DocPara::handleCommand(const QCString &cmdName)
case CMD_HTMLINCLUDE:
handleInclude(cmdName,DocInclude::HtmlInclude);
break;
case CMD_LATEXINCLUDE:
handleInclude(cmdName,DocInclude::LatexInclude);
break;
case CMD_VERBINCLUDE:
handleInclude(cmdName,DocInclude::VerbInclude);
break;
@@ -462,7 +462,7 @@ class DocVerbatim : public DocNode
class DocInclude : public DocNode
{
public:
enum Type { Include, DontInclude, VerbInclude, HtmlInclude, IncWithLines, Snippet };
enum Type { Include, DontInclude, VerbInclude, HtmlInclude, LatexInclude, IncWithLines, Snippet };
DocInclude(DocNode *parent,const QCString &file,
const QCString context, Type t,
bool isExample,const QCString exampleFile,
@@ -490,6 +490,8 @@ void HtmlDocVisitor::visit(DocInclude *inc)
case DocInclude::HtmlInclude:
m_t << inc->text();
break;
case DocInclude::LatexInclude:
break;
case DocInclude::VerbInclude:
forceEndParagraph(inc);
m_t << /*PREFRAG_START <<*/ "<pre class=\"fragment\">";
@@ -362,6 +362,9 @@ void LatexDocVisitor::visit(DocInclude *inc)
break;
case DocInclude::HtmlInclude:
break;
case DocInclude::LatexInclude:
m_t << inc->text();
break;
case DocInclude::VerbInclude:
m_t << "\n\\begin{DoxyVerbInclude}\n";
m_t << inc->text();
@@ -262,6 +262,8 @@ void ManDocVisitor::visit(DocInclude *inc)
break;
case DocInclude::HtmlInclude:
break;
case DocInclude::LatexInclude:
break;
case DocInclude::VerbInclude:
if (!m_firstCol) m_t << endl;
m_t << ".PP" << endl;
@@ -704,6 +704,7 @@ void PerlModDocVisitor::visit(DocInclude *inc)
return;
case DocInclude::DontInclude: return;
case DocInclude::HtmlInclude: type = "htmlonly"; break;
case DocInclude::LatexInclude: type = "latexonly"; break;
case DocInclude::VerbInclude: type = "preformatted"; break;
case DocInclude::Snippet: return;
}
@@ -165,6 +165,7 @@ class PrintDocVisitor : public DocVisitor
case DocInclude::IncWithLines: printf("incwithlines"); break;
case DocInclude::DontInclude: printf("dontinclude"); break;
case DocInclude::HtmlInclude: printf("htmlinclude"); break;
case DocInclude::LatexInclude: printf("latexinclude"); break;
case DocInclude::VerbInclude: printf("verbinclude"); break;
case DocInclude::Snippet: printf("snippet"); break;
}
@@ -382,6 +382,8 @@ void RTFDocVisitor::visit(DocInclude *inc)
break;
case DocInclude::HtmlInclude:
break;
case DocInclude::LatexInclude:
break;
case DocInclude::VerbInclude:
m_t << "{" << endl;
m_t << "\\par" << endl;
@@ -255,6 +255,11 @@ void XmlDocVisitor::visit(DocInclude *inc)
filter(inc->text());
m_t << "</htmlonly>";
break;
case DocInclude::LatexInclude:
m_t << "<latexonly>";
filter(inc->text());
m_t << "</latexonly>";
break;
case DocInclude::VerbInclude:
m_t << "<verbatim>";
filter(inc->text());
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="indexpage" kind="page">
<compoundname>index</compoundname>
<title>My Project</title>
<detaileddescription>
<para>Some text. <latexonly>\section{Hello world}
</latexonly> More text. </para>
</detaileddescription>
</compounddef>
</doxygen>
@@ -0,0 +1,8 @@
// objective: test the \latexinclude command
// check: indexpage.xml
// config: EXAMPLE_PATH = .
/** \mainpage
* Some text.
* \latexinclude sample.tex
* More text.
*/
@@ -0,0 +1 @@
\section{Hello world}

0 comments on commit 1134237

Please sign in to comment.