#include <cstdlib>
#include <sstream>
#include "latexgen.h"
#include "config.h"
#include "message.h"
#include "doxygen.h"
#include "util.h"
#include "diagram.h"
#include "language.h"
#include "version.h"
#include "dot.h"
#include "dotcallgraph.h"
#include "dotclassgraph.h"
#include "dotdirdeps.h"
#include "dotgroupcollaboration.h"
#include "dotincldepgraph.h"
#include "pagedef.h"
#include "docparser.h"
#include "latexdocvisitor.h"
#include "dirdef.h"
#include "cite.h"
#include "groupdef.h"
#include "classlist.h"
#include "namespacedef.h"
#include "filename.h"
#include "resourcemgr.h"
#include "portable.h"
#include "fileinfo.h"
#include "utf8.h"
浏览源代码.
◆ COPYCHAR
值: do { \
if (lresult < (i + bytes + 1)) \
{ \
lresult += 512; \
result = (signed char *)realloc(result, lresult); \
} \
for (int j=0; j<bytes && *p; j++) \
{ \
result[i++]=*p++; \
} \
m_col++; \
} while(0)
◆ extraLatexStyleSheet()
static QCString extraLatexStyleSheet |
( |
| ) |
|
|
static |
◆ makeIndex()
◆ substituteLatexKeywords()
在文件 latexgen.cpp 第 604 行定义.
638 generatedBy = tg.
str();
643 if (latexEmojiDirectory.
isEmpty()) latexEmojiDirectory =
".";
644 latexEmojiDirectory =
substitute(latexEmojiDirectory,
"\\",
"/");
655 if (!formulaMacrofile.
isEmpty())
658 formulaMacrofile=fi.absFilePath();
659 QCString stripMacroFile = fi.fileName();
672 result =
substitute(result,
"$generatedby",generatedBy);
673 result =
substitute(result,
"$latexbibstyle",style);
676 result =
substitute(result,
"$papertype",paperType+
"paper");
679 result =
substitute(result,
"$latexfontenc",latexFontenc);
681 result =
substitute(result,
"$latexemojidirectory",latexEmojiDirectory);
683 result =
substitute(result,
"$extralatexpackages",extraLatexPackages);
684 result =
substitute(result,
"$latexspecialformulachars",latexSpecialFormulaChars);
685 result =
substitute(result,
"$formulamacrofile",formulaMacrofile);
引用了 FileInfo::absFilePath(), Config_getBool, Config_getEnumAsString, Config_getString, convertToLaTeX(), copyFile(), dateToString(), extraLatexStyleSheet(), FileInfo::fileName(), filterLatexString(), CitationManager::instance(), QCString::isEmpty(), OutputGenerator::Latex, Translator::latexDocumentPost(), Translator::latexDocumentPre(), Translator::latexFont(), Translator::latexFontenc(), Translator::latexLanguageSupportCommand(), makeIndex(), removeEmptyLines(), selectBlock(), TextStream::str(), QCString::str(), substitute(), substituteKeywords(), theTranslator, Translator::trCiteReferences(), Translator::trGeneratedAt(), Translator::trGeneratedBy(), TRUE, writeExtraLatexPackages() , 以及 writeLatexSpecialFormulaChars().
被这些函数引用 LatexGenerator::endIndexSection() , 以及 LatexGenerator::startIndexSection().
◆ writeDefaultStyleSheet()
static void writeDefaultStyleSheet |
( |
TextStream & |
t | ) |
|
|
static |
◆ writeLatexMakefile()
static void writeLatexMakefile |
( |
| ) |
|
|
static |
在文件 latexgen.cpp 第 287 行定义.
291 std::ofstream f(fileName.
str(),std::ofstream::out | std::ofstream::binary);
294 term(
"Could not open file %s for writing\n",
qPrint(fileName));
303 t <<
"LATEX_CMD=" << latex_command <<
"\n"
305 <<
"all: refman.dvi\n"
309 <<
"pdf: refman.pdf\n"
311 <<
"ps_2on1: refman_2on1.ps\n"
313 <<
"pdf_2on1: refman_2on1.pdf\n"
315 <<
"refman.ps: refman.dvi\n"
316 <<
"\tdvips -o refman.ps refman.dvi\n"
318 t <<
"refman.pdf: refman.ps\n";
319 t <<
"\tps2pdf refman.ps refman.pdf\n\n";
320 t <<
"refman.dvi: clean refman.tex doxygen.sty\n"
321 <<
"\techo \"Running latex...\"\n"
322 <<
"\t$(LATEX_CMD) refman.tex\n"
323 <<
"\techo \"Running makeindex...\"\n"
324 <<
"\t" << mkidx_command <<
" refman.idx\n";
327 t <<
"\techo \"Running bibtex...\"\n";
328 t <<
"\tbibtex refman\n";
329 t <<
"\techo \"Rerunning latex....\"\n";
330 t <<
"\t$(LATEX_CMD) refman.tex\n";
332 t <<
"\techo \"Rerunning latex....\"\n"
333 <<
"\t$(LATEX_CMD) refman.tex\n"
334 <<
"\tlatex_count=8 ; \\\n"
335 <<
"\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\\n"
337 <<
"\t echo \"Rerunning latex....\" ;\\\n"
338 <<
"\t $(LATEX_CMD) refman.tex ; \\\n"
339 <<
"\t latex_count=`expr $$latex_count - 1` ;\\\n"
341 <<
"\t" << mkidx_command <<
" refman.idx\n"
342 <<
"\t$(LATEX_CMD) refman.tex\n\n"
343 <<
"refman_2on1.ps: refman.ps\n"
344 <<
"\tpsnup -2 refman.ps >refman_2on1.ps\n"
346 <<
"refman_2on1.pdf: refman_2on1.ps\n"
347 <<
"\tps2pdf refman_2on1.ps refman_2on1.pdf\n";
351 t <<
"LATEX_CMD=" << latex_command <<
"\n"
353 t <<
"all: refman.pdf\n\n"
354 <<
"pdf: refman.pdf\n\n";
355 t <<
"refman.pdf: clean refman.tex\n";
356 t <<
"\t$(LATEX_CMD) refman\n";
357 t <<
"\t" << mkidx_command <<
" refman.idx\n";
360 t <<
"\tbibtex refman\n";
361 t <<
"\t$(LATEX_CMD) refman\n";
363 t <<
"\t$(LATEX_CMD) refman\n"
364 <<
"\tlatex_count=8 ; \\\n"
365 <<
"\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\\n"
367 <<
"\t echo \"Rerunning latex....\" ;\\\n"
368 <<
"\t $(LATEX_CMD) refman ;\\\n"
369 <<
"\t latex_count=`expr $$latex_count - 1` ;\\\n"
371 <<
"\t" << mkidx_command <<
" refman.idx\n"
372 <<
"\t$(LATEX_CMD) refman\n\n";
378 <<
"*.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf\n";
引用了 Config_getBool, Config_getString, CitationManager::instance(), CitationManager::isEmpty(), Translator::latexCommandName(), qPrint(), QCString::str(), term() , 以及 theTranslator.
被这些函数引用 LatexGenerator::init().
◆ writeMakeBat()
static void writeMakeBat |
( |
| ) |
|
|
static |
在文件 latexgen.cpp 第 381 行定义.
383 #if defined(_MSC_VER)
389 std::ofstream t(fileName.
str(),std::ofstream::out | std::ofstream::binary);
392 term(
"Could not open file %s for writing\n",
qPrint(fileName));
394 t <<
"set Dir_Old=%cd%\r\n";
395 t <<
"cd /D %~dp0\r\n\r\n";
396 t <<
"del /s /f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf\r\n\r\n";
399 t <<
"set LATEX_CMD=" << latex_command <<
"\r\n";
400 t <<
"%LATEX_CMD% refman.tex\r\n";
401 t <<
"echo ----\r\n";
402 t << mkidx_command <<
" refman.idx\r\n";
405 t <<
"bibtex refman\r\n";
406 t <<
"echo ----\r\n";
407 t <<
"\t%LATEX_CMD% refman.tex\r\n";
409 t <<
"setlocal enabledelayedexpansion\r\n";
410 t <<
"set count=8\r\n";
412 t <<
"set content=X\r\n";
413 t <<
"for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\r\n";
414 t <<
"if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\r\n";
415 t <<
"if !content! == X goto :skip\r\n";
416 t <<
"set /a count-=1\r\n";
417 t <<
"if !count! EQU 0 goto :skip\r\n\r\n";
418 t <<
"echo ----\r\n";
419 t <<
"%LATEX_CMD% refman.tex\r\n";
420 t <<
"goto :repeat\r\n";
423 t << mkidx_command <<
" refman.idx\r\n";
424 t <<
"%LATEX_CMD% refman.tex\r\n";
425 t <<
"dvips -o refman.ps refman.dvi\r\n";
427 t <<
" -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "
428 "-sOutputFile=refman.pdf -c save pop -f refman.ps\r\n";
432 t <<
"set LATEX_CMD=" << latex_command <<
"\r\n";
433 t <<
"%LATEX_CMD% refman\r\n";
434 t <<
"echo ----\r\n";
435 t << mkidx_command <<
" refman.idx\r\n";
438 t <<
"bibtex refman\r\n";
439 t <<
"%LATEX_CMD% refman\r\n";
441 t <<
"echo ----\r\n";
442 t <<
"%LATEX_CMD% refman\r\n\r\n";
443 t <<
"setlocal enabledelayedexpansion\r\n";
444 t <<
"set count=8\r\n";
446 t <<
"set content=X\r\n";
447 t <<
"for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\r\n";
448 t <<
"if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\r\n";
449 t <<
"if !content! == X goto :skip\r\n";
450 t <<
"set /a count-=1\r\n";
451 t <<
"if !count! EQU 0 goto :skip\r\n\r\n";
452 t <<
"echo ----\r\n";
453 t <<
"%LATEX_CMD% refman\r\n";
454 t <<
"goto :repeat\r\n";
457 t << mkidx_command <<
" refman.idx\r\n";
458 t <<
"%LATEX_CMD% refman\r\n";
459 t <<
"cd /D %Dir_Old%\r\n";
460 t <<
"set Dir_Old=\r\n";
引用了 Config_getBool, Config_getString, Portable::ghostScriptCommand(), CitationManager::instance(), CitationManager::isEmpty(), Translator::latexCommandName(), qPrint(), QCString::str(), term() , 以及 theTranslator.
被这些函数引用 LatexGenerator::init().
◆ g_footer
◆ g_header
QCString selectBlock(const QCString &s, const QCString &name, bool enable, OutputGenerator::OutputType o)
std::vector< std::string > StringVector
static ResourceMgr & instance()
Returns the one and only instance of this class
virtual QCString trGeneratedBy()=0
virtual QCString latexFontenc()
QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
QCString getAsString(const QCString &name) const
Gets the resource data as a C string
virtual QCString latexCommandName()
bool isEmpty() const
Returns TRUE iff the string is empty
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Text streaming class that buffers data.
static CitationManager & instance()
QCString convertToLaTeX(const QCString &s, bool insideTabbing, bool keepSpaces)
virtual QCString trGeneratedAt(const QCString &date, const QCString &projName)=0
virtual QCString latexFont()
QCString dateToString(bool includeTime)
QCString removeEmptyLines(const QCString &s)
const char * ghostScriptCommand()
static QCString makeIndex()
Translator * theTranslator
#define Config_getEnumAsString(name)
bool isEmpty() const
return TRUE if there are no citations.
#define LATEX_STYLE_EXTENSION
std::string str() const
Return the contents of the buffer as a std::string object
void writeLatexSpecialFormulaChars(TextStream &t)
void writeExtraLatexPackages(TextStream &t)
uint8_t getUTF8CharNumBytes(char c)
Returns the number of bytes making up a single UTF8 character given the first byte in the sequence.
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
virtual QCString latexLanguageSupportCommand()=0
virtual QCString trCiteReferences()=0
QCString substituteKeywords(const QCString &s, const QCString &title, const QCString &projName, const QCString &projNum, const QCString &projBrief)
#define Config_getBool(name)
void term(const char *fmt,...)
static QCString extraLatexStyleSheet()
Minimal replacement for QFileInfo.
const char * qPrint(const char *s)
#define Config_getString(name)
virtual QCString latexDocumentPre()
bool checkExtension(const QCString &fName, const QCString &ext)
void filterLatexString(TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces)
virtual QCString latexDocumentPost()
#define Config_getList(name)
This is an alternative implementation of QCString.