diff options
author | Thadeus Fleming <thadeus.fleming@fireflyspace.com> | 2016-05-20 18:56:29 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2016-05-20 19:29:07 (GMT) |
commit | 4d2e203a55a2af8f15a3933b86201e6e9b6901b3 (patch) | |
tree | 24df9e34288a4a7375117147e85afec04bcc8558 /src | |
parent | 14b04be2af279e1093f17d6b933d1e9ab530e128 (diff) | |
download | Doxygen-4d2e203a55a2af8f15a3933b86201e6e9b6901b3.zip Doxygen-4d2e203a55a2af8f15a3933b86201e6e9b6901b3.tar.gz Doxygen-4d2e203a55a2af8f15a3933b86201e6e9b6901b3.tar.bz2 |
Unify handling of extra packages in formula.cpp and latexgen.cpp so formula.cpp handles package arguments correctly
Diffstat (limited to 'src')
-rw-r--r-- | src/formula.cpp | 7 | ||||
-rw-r--r-- | src/latexgen.cpp | 16 | ||||
-rwxr-xr-x | src/util.cpp | 20 | ||||
-rwxr-xr-x | src/util.h | 1 |
4 files changed, 23 insertions, 21 deletions
diff --git a/src/formula.cpp b/src/formula.cpp index a4415a9..6fe617d 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -70,12 +70,7 @@ void FormulaList::generateBitmaps(const char *path) if (Config_getBool(LATEX_BATCHMODE)) t << "\\batchmode" << endl; t << "\\documentclass{article}" << endl; t << "\\usepackage{epsfig}" << endl; // for those who want to include images - const char *s=Config_getList(EXTRA_PACKAGES).first(); - while (s) - { - t << "\\usepackage{" << s << "}\n"; - s=Config_getList(EXTRA_PACKAGES).next(); - } + writeExtraLatexPackages(t); t << "\\pagestyle{empty}" << endl; t << "\\begin{document}" << endl; int page=0; diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 7082485..53fc9db 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -619,21 +619,7 @@ static void writeDefaultHeaderPart1(FTextStream &t) "\\makeindex\n" "\n"; - // User-specified packages - QStrList &extraPackages = Config_getList(EXTRA_PACKAGES); - if (!extraPackages.isEmpty()) { - t << "% Packages requested by user\n"; - const char *pkgName=extraPackages.first(); - while (pkgName) - { - if ((pkgName[0] == '[') || (pkgName[0] == '{')) - t << "\\usepackage" << pkgName << "\n"; - else - t << "\\usepackage{" << pkgName << "}\n"; - pkgName=extraPackages.next(); - } - t << "\n"; - } + writeExtraLatexPackages(t); // Hyperlinks bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); diff --git a/src/util.cpp b/src/util.cpp index 592398d..c630449 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -8679,3 +8679,23 @@ bool openOutputFile(const char *outFile,QFile &f) return fileOpened; } +void writeExtraLatexPackages(FTextStream &t) +{ + // User-specified packages + QStrList &extraPackages = Config_getList(EXTRA_PACKAGES); + if (!extraPackages.isEmpty()) + { + t << "% Packages requested by user\n"; + const char *pkgName=extraPackages.first(); + while (pkgName) + { + if ((pkgName[0] == '[') || (pkgName[0] == '{')) + t << "\\usepackage" << pkgName << "\n"; + else + t << "\\usepackage{" << pkgName << "}\n"; + pkgName=extraPackages.next(); + } + t << "\n"; + } +} + @@ -475,6 +475,7 @@ void convertProtectionLevel( bool mainPageHasTitle(); bool openOutputFile(const char *outFile,QFile &f); +void writeExtraLatexPackages(FTextStream &t); #endif |