diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2018-05-22 18:59:21 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2018-05-22 18:59:21 (GMT) |
commit | 979ffc63974d094563e929945561bf0a7f389f42 (patch) | |
tree | b16e4035e34d616bd1b2c2e2fde3957eb48a7364 /src | |
parent | f10c9a42cd3b506cb5bb5cf0192c9e221adafa72 (diff) | |
parent | 7c25ba13e1639e40357012d76a0a79b0de237f00 (diff) | |
download | Doxygen-979ffc63974d094563e929945561bf0a7f389f42.zip Doxygen-979ffc63974d094563e929945561bf0a7f389f42.tar.gz Doxygen-979ffc63974d094563e929945561bf0a7f389f42.tar.bz2 |
Merge branch 'feature/bug_latex_languages' of https://github.com/albert-github/doxygen into albert-github-feature/bug_latex_languages
Diffstat (limited to 'src')
36 files changed, 218 insertions, 67 deletions
diff --git a/src/config.xml b/src/config.xml index fa0ae26..2dcc0f4 100644 --- a/src/config.xml +++ b/src/config.xml @@ -2533,13 +2533,14 @@ EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... ]]> </docs> </option> - <option type='string' id='LATEX_CMD_NAME' format='file' defval='latex' depends='GENERATE_LATEX'> + <option type='string' id='LATEX_CMD_NAME' format='file' defval='' depends='GENERATE_LATEX'> <docs> <![CDATA[ The \c LATEX_CMD_NAME tag can be used to specify the \f$\mbox{\LaTeX}\f$ command name to be invoked. - <br>Note that when enabling \ref cfg_use_pdflatex "USE_PDFLATEX" this option is only used for - generating bitmaps for formulas in the HTML output, but not in the - \c Makefile that is written to the output directory. + <br>Note that when not enabling \ref cfg_use_pdflatex "USE_PDFLATEX" the default is \c latex when + enabling \ref cfg_use_pdflatex "USE_PDFLATEX" the default is \c pdflatex and when in the later case + \c latex is chosen this is overwritten by \c pdflatex. For specific output languages the default can + have been set differently, this depends on the implementation of the output language. ]]> </docs> </option> diff --git a/src/dirdef.cpp b/src/dirdef.cpp index 6631ed7..9a94050 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -5,12 +5,12 @@ #include "doxygen.h" #include "util.h" #include "outputlist.h" +#include "config.h" #include "language.h" #include "message.h" #include "dot.h" #include "layout.h" #include "ftextstream.h" -#include "config.h" #include "docparser.h" //---------------------------------------------------------------------- diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp index ab10da0..768acda 100644 --- a/src/docbookvisitor.cpp +++ b/src/docbookvisitor.cpp @@ -20,6 +20,7 @@ #include "docbookvisitor.h" #include "docparser.h" +#include "config.h" #include "language.h" #include "doxygen.h" #include "outputgen.h" @@ -29,7 +30,6 @@ #include "util.h" #include "parserintf.h" #include "filename.h" -#include "config.h" #include "filedef.h" #include "msc.h" #include "dia.h" diff --git a/src/docparser.cpp b/src/docparser.cpp index 29c6ca7..e767862 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -38,6 +38,7 @@ #include "message.h" #include "section.h" #include "searchindex.h" +#include "config.h" #include "language.h" #include "portable.h" #include "cite.h" @@ -50,7 +51,6 @@ #include "namespacedef.h" #include "reflist.h" #include "formula.h" -#include "config.h" #include "growbuf.h" #include "markdown.h" #include "htmlentity.h" diff --git a/src/filedef.cpp b/src/filedef.cpp index e2df9be..312f865 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -23,6 +23,7 @@ #include "classdef.h" #include "namespacedef.h" #include "util.h" +#include "config.h" #include "language.h" #include "outputlist.h" #include "dot.h" @@ -40,7 +41,6 @@ #include "filename.h" #include "membergroup.h" #include "dirdef.h" -#include "config.h" #include "clangparser.h" #include "settings.h" diff --git a/src/formula.cpp b/src/formula.cpp index 6fe617d..9e48b2d 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -25,6 +25,7 @@ #include "util.h" #include "message.h" #include "config.h" +#include "language.h" #include "portable.h" #include "index.h" #include "doxygen.h" @@ -96,8 +97,7 @@ void FormulaList::generateBitmaps(const char *path) { //printf("Running latex...\n"); //system("latex _formulas.tex </dev/null >/dev/null"); - QCString latexCmd = Config_getString(LATEX_CMD_NAME); - if (latexCmd.isEmpty()) latexCmd="latex"; + QCString latexCmd = theTranslator->latexCommandName(); portable_sysTimerStart(); if (portable_system(latexCmd,"_formulas.tex")!=0) { diff --git a/src/groupdef.cpp b/src/groupdef.cpp index ccfa0df..3a060b9 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -23,6 +23,7 @@ #include "classlist.h" #include "outputlist.h" #include "namespacedef.h" +#include "config.h" #include "language.h" #include "util.h" #include "memberlist.h" @@ -39,7 +40,6 @@ #include "entry.h" #include "membername.h" #include "dirdef.h" -#include "config.h" //--------------------------------------------------------------------------- diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 6a9c142..e0f9038 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -19,12 +19,12 @@ #include <qdir.h> #include "htmldocvisitor.h" #include "docparser.h" +#include "config.h" #include "language.h" #include "doxygen.h" #include "outputgen.h" #include "dot.h" #include "message.h" -#include "config.h" #include "htmlgen.h" #include "parserintf.h" #include "msc.h" diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 86ceade..7080d02 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -19,6 +19,7 @@ #include <qfileinfo.h> #include "latexdocvisitor.h" #include "docparser.h" +#include "config.h" #include "language.h" #include "doxygen.h" #include "outputgen.h" @@ -30,7 +31,6 @@ #include "dia.h" #include "cite.h" #include "filedef.h" -#include "config.h" #include "htmlentity.h" #include "plantuml.h" diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 00826e6..0a52465 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -286,13 +286,15 @@ static void writeLatexMakefile() exit(1); } // inserted by KONNO Akihisa <konno@researchers.jp> 2002-03-05 - QCString latex_command = Config_getString(LATEX_CMD_NAME); + QCString latex_command = theTranslator->latexCommandName(); QCString mkidx_command = Config_getString(MAKEINDEX_CMD_NAME); // end insertion by KONNO Akihisa <konno@researchers.jp> 2002-03-05 FTextStream t(&file); if (!Config_getBool(USE_PDFLATEX)) // use plain old latex { - t << "all: refman.dvi" << endl + t << "LATEX_CMD=" << latex_command << endl + << endl + << "all: refman.dvi" << endl << endl << "ps: refman.ps" << endl << endl @@ -309,7 +311,7 @@ static void writeLatexMakefile() t << "\tps2pdf refman.ps refman.pdf" << endl << endl; t << "refman.dvi: clean refman.tex doxygen.sty" << endl << "\techo \"Running latex...\"" << endl - << "\t" << latex_command << " refman.tex" << endl + << "\t$(LATEX_CMD) refman.tex" << endl << "\techo \"Running makeindex...\"" << endl << "\t" << mkidx_command << " refman.idx" << endl; if (generateBib) @@ -317,19 +319,19 @@ static void writeLatexMakefile() t << "\techo \"Running bibtex...\"" << endl; t << "\tbibtex refman" << endl; t << "\techo \"Rerunning latex....\"" << endl; - t << "\t" << latex_command << " refman.tex" << endl; + t << "\t$(LATEX_CMD) refman.tex" << endl; } t << "\techo \"Rerunning latex....\"" << endl - << "\t" << latex_command << " refman.tex" << endl + << "\t$(LATEX_CMD) refman.tex" << endl << "\tlatex_count=8 ; \\" << endl << "\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\" << endl << "\t do \\" << endl << "\t echo \"Rerunning latex....\" ;\\" << endl - << "\t " << latex_command << " refman.tex ;\\" << endl + << "\t $(LATEX_CMD) refman.tex ; \\" << endl << "\t latex_count=`expr $$latex_count - 1` ;\\" << endl << "\t done" << endl << "\t" << mkidx_command << " refman.idx" << endl - << "\t" << latex_command << " refman.tex" << endl << endl + << "\t$(LATEX_CMD) refman.tex" << endl << endl << "refman_2on1.ps: refman.ps" << endl << "\tpsnup -2 refman.ps >refman_2on1.ps" << endl << endl @@ -338,26 +340,28 @@ static void writeLatexMakefile() } else // use pdflatex for higher quality output { + t << "LATEX_CMD=" << latex_command << endl + << endl; t << "all: refman.pdf" << endl << endl << "pdf: refman.pdf" << endl << endl; t << "refman.pdf: clean refman.tex" << endl; - t << "\tpdflatex refman" << endl; + t << "\t$(LATEX_CMD) refman" << endl; t << "\t" << mkidx_command << " refman.idx" << endl; if (generateBib) { t << "\tbibtex refman" << endl; - t << "\tpdflatex refman" << endl; + t << "\t$(LATEX_CMD) refman" << endl; } - t << "\tpdflatex refman" << endl + t << "\t$(LATEX_CMD) refman" << endl << "\tlatex_count=8 ; \\" << endl << "\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\" << endl << "\t do \\" << endl << "\t echo \"Rerunning latex....\" ;\\" << endl - << "\t pdflatex refman ;\\" << endl + << "\t $(LATEX_CMD) refman ;\\" << endl << "\t latex_count=`expr $$latex_count - 1` ;\\" << endl << "\t done" << endl << "\t" << mkidx_command << " refman.idx" << endl - << "\tpdflatex refman" << endl << endl; + << "\t$(LATEX_CMD) refman" << endl << endl; } t << endl @@ -371,7 +375,7 @@ static void writeMakeBat() #if defined(_MSC_VER) QCString dir=Config_getString(LATEX_OUTPUT); QCString fileName=dir+"/make.bat"; - QCString latex_command = Config_getString(LATEX_CMD_NAME); + QCString latex_command = theTranslator->latexCommandName(); QCString mkidx_command = Config_getString(MAKEINDEX_CMD_NAME); QFile file(fileName); bool generateBib = !Doxygen::citeDict->isEmpty(); @@ -386,14 +390,15 @@ static void writeMakeBat() t << "del /s /f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf\n\n"; if (!Config_getBool(USE_PDFLATEX)) // use plain old latex { - t << latex_command << " refman.tex\n"; + t << "set LATEX_CMD=" << latex_command << "\n"; + t << "%LATEX_CMD% refman.tex\n"; t << "echo ----\n"; t << mkidx_command << " refman.idx\n"; if (generateBib) { t << "bibtex refman\n"; t << "echo ----\n"; - t << latex_command << " refman.tex\n"; + t << "\t%LATEX_CMD% refman.tex\n"; } t << "setlocal enabledelayedexpansion\n"; t << "set count=8\n"; @@ -405,28 +410,29 @@ static void writeMakeBat() t << "set /a count-=1\n"; t << "if !count! EQU 0 goto :skip\n\n"; t << "echo ----\n"; - t << latex_command << " refman.tex\n"; + t << "%LATEX_CMD% refman.tex\n"; t << "goto :repeat\n"; t << ":skip\n"; t << "endlocal\n"; t << mkidx_command << " refman.idx\n"; - t << latex_command << " refman.tex\n"; + t << "%LATEX_CMD% refman.tex\n"; t << "dvips -o refman.ps refman.dvi\n"; t << "gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite " "-sOutputFile=refman.pdf -c save pop -f refman.ps\n"; } else // use pdflatex { - t << "pdflatex refman\n"; + t << "set LATEX_CMD=" << latex_command << "\n"; + t << "%LATEX_CMD% refman\n"; t << "echo ----\n"; t << mkidx_command << " refman.idx\n"; if (generateBib) { t << "bibtex refman" << endl; - t << "pdflatex refman" << endl; + t << "%LATEX_CMD% refman" << endl; } t << "echo ----\n"; - t << "pdflatex refman\n\n"; + t << "%LATEX_CMD% refman\n\n"; t << "setlocal enabledelayedexpansion\n"; t << "set count=8\n"; t << ":repeat\n"; @@ -437,12 +443,12 @@ static void writeMakeBat() t << "set /a count-=1\n"; t << "if !count! EQU 0 goto :skip\n\n"; t << "echo ----\n"; - t << "pdflatex refman\n"; + t << "%LATEX_CMD% refman\n"; t << "goto :repeat\n"; t << ":skip\n"; t << "endlocal\n"; t << mkidx_command << " refman.idx\n"; - t << "pdflatex refman\n"; + t << "%LATEX_CMD% refman\n"; t << "cd /D %Dir_Old%\n"; t << "set Dir_Old=\n"; } @@ -517,6 +523,8 @@ static void writeDefaultHeaderPart1(FTextStream &t) "\\PassOptionsToPackage{warn}{textcomp}\n" "\\usepackage{textcomp}\n" "\\usepackage[nointegrals]{wasysym}\n" + "\\usepackage[table]{xcolor}\n" + "\\usepackage{ifpdf,ifxetex}\n" "\n"; // Language support @@ -529,9 +537,13 @@ static void writeDefaultHeaderPart1(FTextStream &t) } // Define default fonts - t << "% Font selection\n" - "\\usepackage[T1]{fontenc}\n" - "\\usepackage[scaled=.90]{helvet}\n" + t << "% Font selection\n"; + QCString fontenc = theTranslator->latexFontenc(); + if (!fontenc.isEmpty()) + { + t << "\\usepackage[" << fontenc << "]{fontenc}\n"; + } + t << "\\usepackage[scaled=.90]{helvet}\n" "\\usepackage{courier}\n" "\\usepackage{amssymb}\n" "\\usepackage{sectsty}\n" @@ -659,7 +671,11 @@ static void writeDefaultHeaderPart1(FTextStream &t) "\\ifpdf\n" " \\usepackage[pdftex,pagebackref=true]{hyperref}\n" "\\else\n" - " \\usepackage[ps2pdf,pagebackref=true]{hyperref}\n" + " \\ifxetex\n" + " \\usepackage[pagebackref=true]{hyperref}\n" + " \\else\n" + " \\usepackage[ps2pdf,pagebackref=true]{hyperref}\n" + " \\fi\n" "\\fi\n" "\\ifpdf\n" " \\DeclareUnicodeCharacter{207B}{${}^{-}$}% Superscript minus\n" @@ -701,8 +717,11 @@ static void writeDefaultHeaderPart1(FTextStream &t) t << "%===== C O N T E N T S =====\n" "\n" "\\begin{document}\n"; - if (theTranslator->idLanguage()=="greek") - t << "\\selectlanguage{greek}\n"; + QCString documentPre = theTranslator->latexDocumentPre(); + if (!documentPre.isEmpty()) + { + t << documentPre; + } t << "\n"; // Front matter @@ -795,8 +814,13 @@ static void writeDefaultFooter(FTextStream &t) "\\clearemptydoublepage\n" "\\addcontentsline{toc}{" << unit << "}{\\indexname}\n" "\\printindex\n" - "\n" - "\\end{document}\n"; + "\n"; + QCString documentPost = theTranslator->latexDocumentPost(); + if (!documentPost.isEmpty()) + { + t << documentPost; + } + t << "\\end{document}\n"; } void LatexGenerator::writeHeaderFile(QFile &f) diff --git a/src/layout.cpp b/src/layout.cpp index fdc9f4c..cce68cd 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -18,12 +18,12 @@ #include "layout.h" #include "message.h" +#include "config.h" #include "language.h" #include "vhdldocgen.h" #include "util.h" #include "doxygen.h" #include "version.h" -#include "config.h" #include <assert.h> #include <qxml.h> diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp index 2233cc6..2ed557c 100644 --- a/src/mandocvisitor.cpp +++ b/src/mandocvisitor.cpp @@ -20,6 +20,7 @@ #include "mandocvisitor.h" #include "docparser.h" +#include "config.h" #include "language.h" #include "doxygen.h" #include "outputgen.h" diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 0bd0701..256865b 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -25,6 +25,7 @@ #include "code.h" #include "message.h" #include "htmlhelp.h" +#include "config.h" #include "language.h" #include "outputlist.h" #include "example.h" @@ -43,7 +44,6 @@ #include "memberlist.h" #include "namespacedef.h" #include "filedef.h" -#include "config.h" //----------------------------------------------------------------------------- diff --git a/src/membergroup.cpp b/src/membergroup.cpp index aaa504f..c5144e2 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -22,6 +22,7 @@ #include "classdef.h" #include "namespacedef.h" #include "filedef.h" +#include "config.h" #include "language.h" #include "groupdef.h" #include "doxygen.h" diff --git a/src/memberlist.cpp b/src/memberlist.cpp index e19cead..5e3dfcf 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -21,6 +21,7 @@ #include "classdef.h" #include "message.h" #include "util.h" +#include "config.h" #include "language.h" #include "doxygen.h" #include "outputlist.h" @@ -30,7 +31,6 @@ #include "namespacedef.h" #include "filedef.h" #include "membergroup.h" -#include "config.h" #include "docparser.h" MemberList::MemberList() : m_listType(MemberListType_pubMethods) diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index d3eb0df..e78b4e9 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -18,6 +18,7 @@ #include "namespacedef.h" #include "outputlist.h" #include "util.h" +#include "config.h" #include "language.h" #include "classdef.h" #include "classlist.h" @@ -29,7 +30,6 @@ #include "vhdldocgen.h" #include "layout.h" #include "membergroup.h" -#include "config.h" //------------------------------------------------------------------ diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index c85b638..d015757 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -20,6 +20,7 @@ #include "rtfdocvisitor.h" #include "docparser.h" +#include "config.h" #include "language.h" #include "doxygen.h" #include "outputgen.h" @@ -32,7 +33,6 @@ #include "msc.h" #include "dia.h" #include "filedef.h" -#include "config.h" #include "htmlentity.h" #include "plantuml.h" diff --git a/src/translator.h b/src/translator.h index 7092174..2c15c81 100644 --- a/src/translator.h +++ b/src/translator.h @@ -41,6 +41,36 @@ class Translator virtual QCString idLanguage() = 0; virtual QCString latexLanguageSupportCommand() = 0; + /*! + * Sets the LaTeX font encoding to be used. The default is set to `T1`, + * in case another font encoding has to be used this can be specified with + * this routine. In case no font encoding is required the empty string + * can be returned. + */ + virtual QCString latexFontenc() { return "T1"; } + /*! + * Sets the commands to be insered directly after the `\\begin{document}` + * in the LaTeX document. + */ + virtual QCString latexDocumentPre() { return ""; } + /*! + * Sets the commands to be insered directly before the `\\end{document}` + * in the LaTeX document. + */ + virtual QCString latexDocumentPost() { return ""; } + /*! + * Set the name to be used as latex command. + */ + virtual QCString latexCommandName() + { + QCString latex_command = Config_getString(LATEX_CMD_NAME); + if (latex_command.isEmpty()) latex_command = "latex"; + if (Config_getBool(USE_PDFLATEX)) + { + if (latex_command == "latex") latex_command = "pdflatex"; + } + return latex_command; + } // --- Language translation methods ------------------- diff --git a/src/translator_am.h b/src/translator_am.h index 6f5e671..5b4c446 100644 --- a/src/translator_am.h +++ b/src/translator_am.h @@ -32,8 +32,8 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0 /* Used to get the command(s) for the language support. */
virtual QCString latexLanguageSupportCommand()
{
- return "<pre>\\usepackage[latin]{armtex}\n"
- "\\usepackage[armscii8]{inputenc}\n</pre>";
+ return "\\usepackage[latin]{armtex}\n"
+ "\\usepackage[armscii8]{inputenc}\n";
}
// --- Language translation methods -------------------
diff --git a/src/translator_cn.h b/src/translator_cn.h index fc0cf3c..e53f31d 100644 --- a/src/translator_cn.h +++ b/src/translator_cn.h @@ -53,8 +53,20 @@ class TranslatorChinese : public Translator */ virtual QCString latexLanguageSupportCommand() { + return "\\usepackage{CJKutf8}\n"; + } + virtual QCString latexFontenc() + { return ""; } + virtual QCString latexDocumentPre() + { + return "\\begin{CJK}{UTF8}{min}\n"; + } + virtual QCString latexDocumentPost() + { + return "\\end{CJK}\n"; + } /*! used in the compound documentation before a list of related functions. */ diff --git a/src/translator_dk.h b/src/translator_dk.h index e98cfa8..70e9032 100644 --- a/src/translator_dk.h +++ b/src/translator_dk.h @@ -116,8 +116,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0 virtual QCString latexLanguageSupportCommand() { return - "\\usepackage[danish]{babel}\n" - "\\usepackage[T1]{fontenc}\n"; + "\\usepackage[danish]{babel}\n"; } // --- Language translation methods ------------------- diff --git a/src/translator_gr.h b/src/translator_gr.h index 8b7afe1..0ae3e2f 100644 --- a/src/translator_gr.h +++ b/src/translator_gr.h @@ -59,8 +59,8 @@ class TranslatorGreek : public Translator virtual QCString latexLanguageSupportCommand() { - //return "\\usepackage[greek,english]{babel}\n\\usepackage[iso-8859-7]{inputenc}\n"; - return "\\usepackage[greek,english]{babel}\n"; + return "\\usepackage[greek,english]{babel}\n" + "\\usepackage{alphabeta}\n"; } // --- Language translation methods ------------------- diff --git a/src/translator_je.h b/src/translator_je.h index 835a516..d555421 100644 --- a/src/translator_je.h +++ b/src/translator_je.h @@ -36,7 +36,19 @@ class TranslatorJapaneseEn : public TranslatorEnglish { return "japanese-en"; } virtual QCString latexLanguageSupportCommand() { - return "platex"; + return "\\usepackage{CJKutf8}\n"; + } + virtual QCString latexFontenc() + { + return ""; + } + virtual QCString latexDocumentPre() + { + return "\\begin{CJK}{UTF8}{min}\n"; + } + virtual QCString latexDocumentPost() + { + return "\\end{CJK}\n"; } virtual QCString trRTFansicp() { diff --git a/src/translator_jp.h b/src/translator_jp.h index c4f92c2..43c5dc2 100644 --- a/src/translator_jp.h +++ b/src/translator_jp.h @@ -77,8 +77,20 @@ class TranslatorJapanese : public Translator virtual QCString latexLanguageSupportCommand() { + return "\\usepackage{CJKutf8}\n"; + } + virtual QCString latexFontenc() + { return ""; } + virtual QCString latexDocumentPre() + { + return "\\begin{CJK}{UTF8}{min}\n"; + } + virtual QCString latexDocumentPost() + { + return "\\end{CJK}\n"; + } /*! used in the compound documentation before a list of related functions. */ virtual QCString trRelatedFunctions() diff --git a/src/translator_ke.h b/src/translator_ke.h index 525cf84..c9f488c 100644 --- a/src/translator_ke.h +++ b/src/translator_ke.h @@ -35,12 +35,22 @@ class TranslatorKoreanEn : public TranslatorEnglish { return "korean-en"; } virtual QCString latexLanguageSupportCommand() { - return "\\usepackage{hfont}\n"; + return "\\usepackage{kotex}\n"; } virtual QCString trRTFansicp() { return "949"; } + virtual QCString latexCommandName() + { + QCString latex_command = Config_getString(LATEX_CMD_NAME); + if (latex_command.isEmpty()) latex_command = "latex"; + if (Config_getBool(USE_PDFLATEX)) + { + if (latex_command == "latex") latex_command = "xelatex"; + } + return latex_command; + } /*! Used as ansicpg for RTF fcharset * \see trRTFansicp() for a table of possible values. diff --git a/src/translator_kr.h b/src/translator_kr.h index 7e95e3b..80ccc78 100644 --- a/src/translator_kr.h +++ b/src/translator_kr.h @@ -86,7 +86,17 @@ class TranslatorKorean : public Translator // I'm not sure what this should be. // When I figure it out, I'll update this. // see http://www.ktug.or.kr/jsboard/read.php?table=operate&no=4422&page=1 - return "\\usepackage{hfont}\n"; + return "\\usepackage{kotex}\n"; + } + virtual QCString latexCommandName() + { + QCString latex_command = Config_getString(LATEX_CMD_NAME); + if (latex_command.isEmpty()) latex_command = "latex"; + if (Config_getBool(USE_PDFLATEX)) + { + if (latex_command == "latex") latex_command = "xelatex"; + } + return latex_command; } // --- Language translation methods ------------------- diff --git a/src/translator_lv.h b/src/translator_lv.h index 2736bb0..bd579da 100644 --- a/src/translator_lv.h +++ b/src/translator_lv.h @@ -76,7 +76,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4 */ virtual QCString latexLanguageSupportCommand() { - return "\\usepackage[LV]{fontenc}\n" + return "\\usepackage[T2A]{fontenc}\n" "\\usepackage[latvian]{babel}\n"; } diff --git a/src/translator_no.h b/src/translator_no.h index 58b596a..eccd952 100644 --- a/src/translator_no.h +++ b/src/translator_no.h @@ -72,8 +72,7 @@ class TranslatorNorwegian : public TranslatorAdapter_1_4_6 virtual QCString latexLanguageSupportCommand() { return - "\\usepackage[norwegian]{babel}\n" - "\\usepackage[T1]{fontenc}\n"; + "\\usepackage[norsk]{babel}\n"; } // --- Language translation methods ------------------- diff --git a/src/translator_pl.h b/src/translator_pl.h index 421f407..e0ecc8f 100644 --- a/src/translator_pl.h +++ b/src/translator_pl.h @@ -44,8 +44,14 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2 */ QCString latexLanguageSupportCommand() { - return "\\usepackage{polski}\n" - "\\usepackage[T1]{fontenc}\n"; + return "\\usepackage[polish]{babel}\n" + "\\let\\lll\\undefined\n"; /* to overcome problems with the <<< + symbol as defined in the amssymb + package, and the Polish symbol + "Latin Small Letter L With Stroke" + ł or ł or ł + We take the amssymb symbol as leading. + */ } // --- Language translation methods ------------------- diff --git a/src/translator_pt.h b/src/translator_pt.h index c58bf64..25c5762 100644 --- a/src/translator_pt.h +++ b/src/translator_pt.h @@ -85,7 +85,10 @@ class TranslatorPortuguese : public Translator * the empty string is returned in this implementation. */ virtual QCString latexLanguageSupportCommand() - { return "Portuguese"; } + { + return + "\\usepackage[portuges]{babel}\n"; + } // --- Language translation methods ------------------- diff --git a/src/translator_sc.h b/src/translator_sc.h index d2b3954..e8191df 100644 --- a/src/translator_sc.h +++ b/src/translator_sc.h @@ -71,6 +71,11 @@ class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0 */ virtual QCString latexLanguageSupportCommand() { + return "\\usepackage[T2A]{fontenc}\n" + "\\usepackage[russian]{babel}\n"; + } + virtual QCString latexFontenc() + { return ""; } diff --git a/src/translator_si.h b/src/translator_si.h index 792053e..2dd7e5b 100644 --- a/src/translator_si.h +++ b/src/translator_si.h @@ -36,7 +36,7 @@ class TranslatorSlovene : public TranslatorAdapter_1_4_6 */ QCString latexLanguageSupportCommand() { - return "\\usepackage[slovene]{babel}\n\\usepackage[T1]{fontenc}\n"; + return "\\usepackage[slovene]{babel}\n"; } QCString trRelatedFunctions() { return "Povezane funkcije"; } diff --git a/src/translator_tw.h b/src/translator_tw.h index 26a6db6..46237ca 100644 --- a/src/translator_tw.h +++ b/src/translator_tw.h @@ -72,8 +72,20 @@ class TranslatorChinesetraditional : public Translator */ virtual QCString latexLanguageSupportCommand() { + return "\\usepackage{CJKutf8}\n"; + } + virtual QCString latexFontenc() + { return ""; } + virtual QCString latexDocumentPre() + { + return "\\begin{CJK}{UTF8}{min}\n"; + } + virtual QCString latexDocumentPost() + { + return "\\end{CJK}\n"; + } // --- Language translation methods ------------------- diff --git a/src/translator_vi.h b/src/translator_vi.h index a0046b0..b391b0c 100644 --- a/src/translator_vi.h +++ b/src/translator_vi.h @@ -78,9 +78,23 @@ class TranslatorVietnamese : public TranslatorAdapter_1_6_0 */ virtual QCString latexLanguageSupportCommand() { + return + "\\usepackage[vietnamese]{babel}\n"; + } + virtual QCString latexFontenc() + { return ""; } - + virtual QCString latexCommandName() + { + QCString latex_command = Config_getString(LATEX_CMD_NAME); + if (latex_command.isEmpty()) latex_command = "latex"; + if (Config_getBool(USE_PDFLATEX)) + { + if (latex_command == "latex") latex_command = "xelatex"; + } + return latex_command; + } // --- Language translation methods ------------------- /*! used in the compound documentation before a list of related functions. */ diff --git a/src/util.cpp b/src/util.cpp index ff0d0c6..37608bd 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -35,8 +35,8 @@ #include "doxygen.h" #include "outputlist.h" #include "defargs.h" -#include "language.h" #include "config.h" +#include "language.h" #include "htmlhelp.h" #include "example.h" #include "version.h" diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 93765b1..a4bc40b 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -20,6 +20,7 @@ #include "xmldocvisitor.h" #include "docparser.h" +#include "config.h" #include "language.h" #include "doxygen.h" #include "outputgen.h" @@ -29,7 +30,6 @@ #include "util.h" #include "parserintf.h" #include "filename.h" -#include "config.h" #include "htmlentity.h" static void visitCaption(XmlDocVisitor *parent, QList<DocNode> children) |