summaryrefslogtreecommitdiffstats
path: root/src/latexgen.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2018-05-26 15:54:53 (GMT)
committeralbert-github <albert.tests@gmail.com>2018-05-26 15:54:53 (GMT)
commited86c707318c1cb005702ef88dbdaa3a2bee5581 (patch)
tree99838f3b8b9400c81e572daf3e4c2c088c9824f2 /src/latexgen.cpp
parent63696c08425fc1662c5e76280e3cc74fb3769d80 (diff)
downloadDoxygen-ed86c707318c1cb005702ef88dbdaa3a2bee5581.zip
Doxygen-ed86c707318c1cb005702ef88dbdaa3a2bee5581.tar.gz
Doxygen-ed86c707318c1cb005702ef88dbdaa3a2bee5581.tar.bz2
Problem with code inside a Doxy table in LaTeX
When code is used inside a problem occurs with \discretionary - Inside a table \discretionary is disabled when code is used. - \newline should not be appended to a code line (is already implicitly done by the command).
Diffstat (limited to 'src/latexgen.cpp')
-rw-r--r--src/latexgen.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index 7a2ea59..076b354 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -39,6 +39,7 @@
#include "resourcemgr.h"
static bool DoxyCodeOpen = FALSE;
+static bool DoxyCodeLineOpen = FALSE;
//-------------------------------
LatexCodeGenerator::LatexCodeGenerator(FTextStream &t,const QCString &relPath,const QCString &sourceFileName)
@@ -101,7 +102,7 @@ void LatexCodeGenerator::codify(const char *str)
m_col+=spacesToNextTabStop;
p++;
break;
- case '\n': (usedTableLevels()>0) ? m_t << "\\newline\n" : m_t << '\n'; m_col=0; p++;
+ case '\n': (usedTableLevels()>0 && !DoxyCodeOpen) ? m_t << "\\newline\n" : m_t << '\n'; m_col=0; p++;
break;
default:
i=0;
@@ -190,10 +191,10 @@ void LatexCodeGenerator::writeLineNumber(const char *ref,const char *fileName,co
{
static bool usePDFLatex = Config_getBool(USE_PDFLATEX);
static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
- if (!DoxyCodeOpen)
+ if (!DoxyCodeLineOpen)
{
m_t << "\\DoxyCodeLine{";
- DoxyCodeOpen = TRUE;
+ DoxyCodeLineOpen = TRUE;
}
if (m_prettyCode)
{
@@ -228,19 +229,19 @@ void LatexCodeGenerator::writeLineNumber(const char *ref,const char *fileName,co
void LatexCodeGenerator::startCodeLine(bool)
{
m_col=0;
- if (!DoxyCodeOpen)
+ if (!DoxyCodeLineOpen)
{
m_t << "\\DoxyCodeLine{";
- DoxyCodeOpen = TRUE;
+ DoxyCodeLineOpen = TRUE;
}
}
void LatexCodeGenerator::endCodeLine()
{
- if (DoxyCodeOpen)
+ if (DoxyCodeLineOpen)
{
m_t << "}";
- DoxyCodeOpen = FALSE;
+ DoxyCodeLineOpen = FALSE;
}
codify("\n");
}
@@ -255,6 +256,10 @@ void LatexCodeGenerator::endFontClass()
m_t << "}";
}
+void LatexCodeGenerator::setDoxyCodeOpen(bool val)
+{
+ DoxyCodeOpen = val;
+}
//-------------------------------
@@ -2228,12 +2233,14 @@ void LatexGenerator::endConstraintList()
void LatexGenerator::startCodeFragment()
{
- t << "\n\\begin{DoxyCode}\n";
+ t << "\n\\begin{DoxyCode}{" << usedTableLevels() << "}\n";
+ DoxyCodeOpen = TRUE;
}
void LatexGenerator::endCodeFragment()
{
t << "\\end{DoxyCode}\n";
+ DoxyCodeOpen = FALSE;
}
void LatexGenerator::startInlineHeader()