Macros | Functions
latexgen.cpp File Reference
#include <stdlib.h>
#include <qdir.h>
#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 "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"

Go to the source code of this file.

Macros

#define COPYCHAR()
 

Functions

static void writeLatexMakefile ()
 
static void writeMakeBat ()
 
static void writeDefaultHeaderPart1 (FTextStream &t)
 
static void writeDefaultHeaderPart2 (FTextStream &t)
 
static void writeDefaultHeaderPart3 (FTextStream &t)
 
static void writeDefaultStyleSheet (FTextStream &t)
 
static void writeDefaultFooter (FTextStream &t)
 

Macro Definition Documentation

#define COPYCHAR ( )
Value:
do { \
result[i++]=c; p++; \
if (c<0) /* multibyte utf-8 character */ \
{ \
/* 1xxx.xxxx: >=2 byte character */ \
result[i++]=*p++; \
if (((uchar)c&0xE0)==0xE0) \
{ \
/* 111x.xxxx: >=3 byte character */ \
result[i++]=*p++; \
} \
if (((uchar)c&0xF0)==0xF0) \
{ \
/* 1111.xxxx: 4 byte character */ \
result[i++]=*p++; \
} \
} \
m_col++; \
} while(0)
unsigned char uchar
Definition: nybbler.cc:11
p
Definition: test.py:223

Function Documentation

static void writeDefaultFooter ( FTextStream t)
static

Definition at line 741 of file latexgen.cpp.

742 {
743  t << "%--- End generated contents ---\n"
744  "\n";
745 
746  // Bibliography
748 
749  // Index
750  t << "% Index\n";
751  QCString unit;
752  if (Config_getBool("COMPACT_LATEX"))
753  {
754  unit = "section";
755  }
756  else
757  {
758  unit = "chapter";
759  t << "\\backmatter\n";
760  }
761  t << "\\newpage\n"
762  "\\phantomsection\n"
763  "\\clearemptydoublepage\n"
764  "\\addcontentsline{toc}{" << unit << "}{" << theTranslator->trRTFGeneralIndex() << "}\n"
765  "\\printindex\n"
766  "\n"
767  "\\end{document}\n";
768 }
static CiteDict * citeDict
Definition: doxygen.h:146
#define Config_getBool(val)
Definition: config.cpp:664
void writeLatexBibliography(FTextStream &t)
Definition: cite.cpp:41
Translator * theTranslator
Definition: language.cpp:157
virtual QCString trRTFGeneralIndex()=0
static void writeDefaultHeaderPart1 ( FTextStream t)
static

Definition at line 454 of file latexgen.cpp.

455 {
456  // part 1
457 
458  // Handle batch mode
459  if (Config_getBool("LATEX_BATCHMODE"))
460  t << "\\batchmode\n";
461 
462  // Set document class depending on configuration
463  QCString documentClass;
464  if (Config_getBool("COMPACT_LATEX"))
465  documentClass = "article";
466  else
467  documentClass = "book";
468  t << "\\documentclass[twoside]{" << documentClass << "}\n"
469  "\n";
470 
471  // Load required packages
472  t << "% Packages required by doxygen\n"
473  "\\usepackage{fixltx2e}\n" // for \textsubscript
474  "\\usepackage{calc}\n"
475  "\\usepackage{doxygen}\n"
476  "\\usepackage[export]{adjustbox} % also loads graphicx\n";
477  QStrList extraLatexStyle = Config_getList("LATEX_EXTRA_STYLESHEET");
478  for (uint i=0; i<extraLatexStyle.count(); ++i)
479  {
480  QCString fileName(extraLatexStyle.at(i));
481  if (!fileName.isEmpty())
482  {
483  QFileInfo fi(fileName);
484  if (fi.exists())
485  {
486  if (checkExtension(fi.fileName().data(), latexStyleExtension))
487  {
488  // strip the extension, it will be added by the usepackage in the tex conversion process
489  t << "\\usepackage{" << stripExtensionGeneral(fi.fileName().data(), latexStyleExtension) << "}\n";
490  }
491  else
492  {
493  t << "\\usepackage{" << fi.fileName().utf8() << "}\n";
494  }
495  }
496  }
497  }
498  t << "\\usepackage{graphicx}\n"
499  "\\usepackage[utf8]{inputenc}\n"
500  "\\usepackage{makeidx}\n"
501  "\\usepackage{multicol}\n"
502  "\\usepackage{multirow}\n"
503  "\\PassOptionsToPackage{warn}{textcomp}\n"
504  "\\usepackage{textcomp}\n"
505  "\\usepackage[nointegrals]{wasysym}\n"
506  "\\usepackage[table]{xcolor}\n"
507  "\n";
508 
509  // Language support
511  if (!languageSupport.isEmpty())
512  {
513  t << "% NLS support packages\n"
514  << languageSupport
515  << "\n";
516  }
517 
518  // Define default fonts
519  t << "% Font selection\n"
520  "\\usepackage[T1]{fontenc}\n"
521  "\\usepackage[scaled=.90]{helvet}\n"
522  "\\usepackage{courier}\n"
523  "\\usepackage{amssymb}\n"
524  "\\usepackage{sectsty}\n"
525  "\\renewcommand{\\familydefault}{\\sfdefault}\n"
526  "\\allsectionsfont{%\n"
527  " \\fontseries{bc}\\selectfont%\n"
528  " \\color{darkgray}%\n"
529  "}\n"
530  "\\renewcommand{\\DoxyLabelFont}{%\n"
531  " \\fontseries{bc}\\selectfont%\n"
532  " \\color{darkgray}%\n"
533  "}\n"
534  "\\newcommand{\\+}{\\discretionary{\\mbox{\\scriptsize$\\hookleftarrow$}}{}{}}\n"
535  "\n";
536 
537  // Define page & text layout
538  QCString paperName=Config_getEnum("PAPER_TYPE");
539  // "a4wide" package is obsolete (see bug 563698)
540  t << "% Page & text layout\n"
541  "\\usepackage{geometry}\n"
542  "\\geometry{%\n"
543  " " << paperName << "paper,%\n"
544  " top=2.5cm,%\n"
545  " bottom=2.5cm,%\n"
546  " left=2.5cm,%\n"
547  " right=2.5cm%\n"
548  "}\n";
549  // \sloppy is obsolete (see bug 563698)
550  // Allow a bit of overflow to go unnoticed by other means
551  t << "\\tolerance=750\n"
552  "\\hfuzz=15pt\n"
553  "\\hbadness=750\n"
554  "\\setlength{\\emergencystretch}{15pt}\n"
555  "\\setlength{\\parindent}{0cm}\n"
556  "\\setlength{\\parskip}{3ex plus 2ex minus 2ex}\n";
557  // Redefine paragraph/subparagraph environments, using sectsty fonts
558  t << "\\makeatletter\n"
559  "\\renewcommand{\\paragraph}{%\n"
560  " \\@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%\n"
561  " \\normalfont\\normalsize\\bfseries\\SS@parafont%\n"
562  " }%\n"
563  "}\n"
564  "\\renewcommand{\\subparagraph}{%\n"
565  " \\@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{%\n"
566  " \\normalfont\\normalsize\\bfseries\\SS@subparafont%\n"
567  " }%\n"
568  "}\n"
569  "\\makeatother\n"
570  "\n";
571 
572  // Headers & footers
573  QGString genString;
574  QCString generatedBy;
575  static bool timeStamp = Config_getBool("LATEX_TIMESTAMP");
576  FTextStream tg(&genString);
577  if (timeStamp)
578  {
579  generatedBy = theTranslator->trGeneratedAt(dateToString(TRUE), Config_getString("PROJECT_NAME"));
580  }
581  else
582  {
583  generatedBy = theTranslator->trGeneratedBy();
584  }
585  filterLatexString(tg, generatedBy, FALSE,FALSE,FALSE);
586  t << "% Headers & footers\n"
587  "\\usepackage{fancyhdr}\n"
588  "\\pagestyle{fancyplain}\n"
589  "\\fancyhead[LE]{\\fancyplain{}{\\bfseries\\thepage}}\n"
590  "\\fancyhead[CE]{\\fancyplain{}{}}\n"
591  "\\fancyhead[RE]{\\fancyplain{}{\\bfseries\\leftmark}}\n"
592  "\\fancyhead[LO]{\\fancyplain{}{\\bfseries\\rightmark}}\n"
593  "\\fancyhead[CO]{\\fancyplain{}{}}\n"
594  "\\fancyhead[RO]{\\fancyplain{}{\\bfseries\\thepage}}\n"
595  "\\fancyfoot[LE]{\\fancyplain{}{}}\n"
596  "\\fancyfoot[CE]{\\fancyplain{}{}}\n"
597  "\\fancyfoot[RE]{\\fancyplain{}{\\bfseries\\scriptsize " << genString << " Doxygen }}\n"
598  "\\fancyfoot[LO]{\\fancyplain{}{\\bfseries\\scriptsize " << genString << " Doxygen }}\n"
599  "\\fancyfoot[CO]{\\fancyplain{}{}}\n"
600  "\\fancyfoot[RO]{\\fancyplain{}{}}\n"
601  "\\renewcommand{\\footrulewidth}{0.4pt}\n";
602  if (!Config_getBool("COMPACT_LATEX"))
603  {
604  t << "\\renewcommand{\\chaptermark}[1]{%\n"
605  " \\markboth{#1}{}%\n"
606  "}\n";
607  }
608  t << "\\renewcommand{\\sectionmark}[1]{%\n"
609  " \\markright{\\thesection\\ #1}%\n"
610  "}\n"
611  "\n";
612 
613  // ToC, LoF, LoT, bibliography, and index
614  t << "% Indices & bibliography\n"
615  "\\usepackage{natbib}\n"
616  "\\usepackage[titles]{tocloft}\n"
617  "\\setcounter{tocdepth}{3}\n"
618  "\\setcounter{secnumdepth}{5}\n"
619  "\\makeindex\n"
620  "\n";
621 
622  // User-specified packages
623  QStrList &extraPackages = Config_getList("EXTRA_PACKAGES");
624  if (!extraPackages.isEmpty()) {
625  t << "% Packages requested by user\n";
626  const char *pkgName=extraPackages.first();
627  while (pkgName)
628  {
629  if ((pkgName[0] == '[') || (pkgName[0] == '{'))
630  t << "\\usepackage" << pkgName << "\n";
631  else
632  t << "\\usepackage{" << pkgName << "}\n";
633  pkgName=extraPackages.next();
634  }
635  t << "\n";
636  }
637 
638  // Hyperlinks
639  bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
640  if (pdfHyperlinks)
641  {
642  t << "% Hyperlinks (required, but should be loaded last)\n"
643  "\\usepackage{ifpdf}\n"
644  "\\ifpdf\n"
645  " \\usepackage[pdftex,pagebackref=true]{hyperref}\n"
646  "\\else\n"
647  " \\usepackage[ps2pdf,pagebackref=true]{hyperref}\n"
648  "\\fi\n"
649  "\\hypersetup{%\n"
650  " colorlinks=true,%\n"
651  " linkcolor=blue,%\n"
652  " citecolor=blue,%\n"
653  " unicode%\n"
654  "}\n"
655  "\n";
656  }
657 
658  // Custom commands used by the header
659  t << "% Custom commands\n"
660  "\\newcommand{\\clearemptydoublepage}{%\n"
661  " \\newpage{\\pagestyle{empty}\\cleardoublepage}%\n"
662  "}\n"
663  "\n";
664 
665  // caption style definition
666  t << "\\usepackage{caption}\n"
667  << "\\captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top}\n\n";
668 
669  // End of preamble, now comes the document contents
670  t << "%===== C O N T E N T S =====\n"
671  "\n"
672  "\\begin{document}\n";
673  if (theTranslator->idLanguage()=="greek")
674  t << "\\selectlanguage{greek}\n";
675  t << "\n";
676 
677  // Front matter
678  t << "% Titlepage & ToC\n";
679  bool usePDFLatex = Config_getBool("USE_PDFLATEX");
680  if (pdfHyperlinks && usePDFLatex)
681  {
682  // To avoid duplicate page anchors due to reuse of same numbers for
683  // the index (be it as roman numbers)
684  t << "\\hypersetup{pageanchor=false,\n"
685  // << " bookmarks=true,\n" // commented out to prevent warning
686  << " bookmarksnumbered=true,\n"
687  << " pdfencoding=unicode\n"
688  << " }\n";
689  }
690  t << "\\pagenumbering{roman}\n"
691  "\\begin{titlepage}\n"
692  "\\vspace*{7cm}\n"
693  "\\begin{center}%\n"
694  "{\\Large ";
695 }
virtual QCString latexLanguageSupportCommand()=0
bool isEmpty() const
Definition: qcstring.h:189
type * first()
Definition: qinternallist.h:87
const bool FALSE
Definition: qglobal.h:370
#define Config_getList(val)
Definition: config.cpp:662
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
#define Config_getEnum(val)
Definition: config.cpp:663
virtual QCString trGeneratedBy()=0
fileName
Definition: dumpTree.py:9
QCString stripExtensionGeneral(const char *fName, const char *ext)
Definition: util.cpp:6789
QCString dateToString(bool includeTime)
Definition: util.cpp:2473
#define Config_getString(val)
Definition: config.cpp:660
#define Config_getBool(val)
Definition: config.cpp:664
type * next()
Definition: qinternallist.h:89
void filterLatexString(FTextStream &t, const char *str, bool insideTabbing, bool insidePre, bool insideItem, bool keepSpaces)
Definition: util.cpp:6533
virtual QCString trGeneratedAt(const char *date, const char *projName)=0
virtual QCString idLanguage()=0
static const char * latexStyleExtension
Definition: latexgen.h:25
bool isEmpty() const
Definition: qinternallist.h:57
Translator * theTranslator
Definition: language.cpp:157
bool checkExtension(const char *fName, const char *ext)
Definition: util.cpp:6784
type * at(uint i)
Definition: qinternallist.h:81
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:51
uint count() const
Definition: qinternallist.h:56
unsigned uint
Definition: qglobal.h:351
const bool TRUE
Definition: qglobal.h:371
static void writeDefaultHeaderPart2 ( FTextStream t)
static

Definition at line 697 of file latexgen.cpp.

698 {
699  // part 2
700  // Finalize project name
701  t << "}\\\\\n"
702  "\\vspace*{1cm}\n"
703  "{\\large ";
704 }
static void writeDefaultHeaderPart3 ( FTextStream t)
static

Definition at line 706 of file latexgen.cpp.

707 {
708  // part 3
709  // Finalize project number
710  t << " Doxygen " << versionString << "}\\\\\n";
711  if (Config_getBool("LATEX_TIMESTAMP"))
712  t << "\\vspace*{0.5cm}\n"
713  "{\\small " << dateToString(TRUE) << "}\\\\\n";
714  t << "\\end{center}\n"
715  "\\end{titlepage}\n";
716  bool compactLatex = Config_getBool("COMPACT_LATEX");
717  if (!compactLatex)
718  t << "\\clearemptydoublepage\n";
719 
720  // ToC
721  t << "\\tableofcontents\n";
722  if (!compactLatex)
723  t << "\\clearemptydoublepage\n";
724  t << "\\pagenumbering{arabic}\n";
725  bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
726  bool usePDFLatex = Config_getBool("USE_PDFLATEX");
727  if (pdfHyperlinks && usePDFLatex)
728  {
729  // re-enable anchors again
730  t << "\\hypersetup{pageanchor=true}\n";
731  }
732  t << "\n"
733  "%--- Begin generated contents ---\n";
734 }
char versionString[]
Definition: version.cpp:1
QCString dateToString(bool includeTime)
Definition: util.cpp:2473
#define Config_getBool(val)
Definition: config.cpp:664
const bool TRUE
Definition: qglobal.h:371
static void writeDefaultStyleSheet ( FTextStream t)
static

Definition at line 736 of file latexgen.cpp.

737 {
738  t << ResourceMgr::instance().getAsString("doxygen.sty");
739 }
QCString getAsString(const char *name) const
static ResourceMgr & instance()
Definition: resourcemgr.cpp:35
static void writeLatexMakefile ( )
static

Definition at line 262 of file latexgen.cpp.

263 {
264  bool generateBib = !Doxygen::citeDict->isEmpty();
265  QCString dir=Config_getString("LATEX_OUTPUT");
266  QCString fileName=dir+"/Makefile";
267  QFile file(fileName);
268  if (!file.open(IO_WriteOnly))
269  {
270  err("Could not open file %s for writing\n",fileName.data());
271  exit(1);
272  }
273  // inserted by KONNO Akihisa <konno@researchers.jp> 2002-03-05
274  QCString latex_command = Config_getString("LATEX_CMD_NAME");
275  QCString mkidx_command = Config_getString("MAKEINDEX_CMD_NAME");
276  // end insertion by KONNO Akihisa <konno@researchers.jp> 2002-03-05
277  FTextStream t(&file);
278  if (!Config_getBool("USE_PDFLATEX")) // use plain old latex
279  {
280  t << "all: refman.dvi" << endl
281  << endl
282  << "ps: refman.ps" << endl
283  << endl
284  << "pdf: refman.pdf" << endl
285  << endl
286  << "ps_2on1: refman_2on1.ps" << endl
287  << endl
288  << "pdf_2on1: refman_2on1.pdf" << endl
289  << endl
290  << "refman.ps: refman.dvi" << endl
291  << "\tdvips -o refman.ps refman.dvi" << endl
292  << endl;
293  t << "refman.pdf: refman.ps" << endl;
294  t << "\tps2pdf refman.ps refman.pdf" << endl << endl;
295  t << "refman.dvi: clean refman.tex doxygen.sty" << endl
296  << "\techo \"Running latex...\"" << endl
297  << "\t" << latex_command << " refman.tex" << endl
298  << "\techo \"Running makeindex...\"" << endl
299  << "\t" << mkidx_command << " refman.idx" << endl;
300  if (generateBib)
301  {
302  t << "\techo \"Running bibtex...\"" << endl;
303  t << "\tbibtex refman" << endl;
304  t << "\techo \"Rerunning latex....\"" << endl;
305  t << "\t" << latex_command << " refman.tex" << endl;
306  }
307  t << "\techo \"Rerunning latex....\"" << endl
308  << "\t" << latex_command << " refman.tex" << endl
309  << "\tlatex_count=8 ; \\" << endl
310  << "\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\" << endl
311  << "\t do \\" << endl
312  << "\t echo \"Rerunning latex....\" ;\\" << endl
313  << "\t " << latex_command << " refman.tex ;\\" << endl
314  << "\t latex_count=`expr $$latex_count - 1` ;\\" << endl
315  << "\t done" << endl
316  << "\t" << mkidx_command << " refman.idx" << endl
317  << "\t" << latex_command << " refman.tex" << endl << endl
318  << "refman_2on1.ps: refman.ps" << endl
319  << "\tpsnup -2 refman.ps >refman_2on1.ps" << endl
320  << endl
321  << "refman_2on1.pdf: refman_2on1.ps" << endl
322  << "\tps2pdf refman_2on1.ps refman_2on1.pdf" << endl;
323  }
324  else // use pdflatex for higher quality output
325  {
326  t << "all: refman.pdf" << endl << endl
327  << "pdf: refman.pdf" << endl << endl;
328  t << "refman.pdf: clean refman.tex" << endl;
329  t << "\tpdflatex refman" << endl;
330  t << "\t" << mkidx_command << " refman.idx" << endl;
331  if (generateBib)
332  {
333  t << "\tbibtex refman" << endl;
334  t << "\tpdflatex refman" << endl;
335  }
336  t << "\tpdflatex refman" << endl
337  << "\tlatex_count=8 ; \\" << endl
338  << "\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\" << endl
339  << "\t do \\" << endl
340  << "\t echo \"Rerunning latex....\" ;\\" << endl
341  << "\t pdflatex refman ;\\" << endl
342  << "\t latex_count=`expr $$latex_count - 1` ;\\" << endl
343  << "\t done" << endl
344  << "\t" << mkidx_command << " refman.idx" << endl
345  << "\tpdflatex refman" << endl << endl;
346  }
347 
348  t << endl
349  << "clean:" << endl
350  << "\trm -f "
351  << "*.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf" << endl;
352 }
static CiteDict * citeDict
Definition: doxygen.h:146
#define IO_WriteOnly
Definition: qiodevice.h:62
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
string dir
bool isEmpty() const
Definition: cite.cpp:108
fileName
Definition: dumpTree.py:9
const char * data() const
Definition: qcstring.h:207
#define Config_getString(val)
Definition: config.cpp:660
#define Config_getBool(val)
Definition: config.cpp:664
void err(const char *fmt,...)
Definition: message.cpp:226
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
QTextStream & endl(QTextStream &s)
static void writeMakeBat ( )
static

Definition at line 354 of file latexgen.cpp.

355 {
356 #if defined(_MSC_VER)
357  QCString dir=Config_getString("LATEX_OUTPUT");
358  QCString fileName=dir+"/make.bat";
359  QCString latex_command = Config_getString("LATEX_CMD_NAME");
360  QCString mkidx_command = Config_getString("MAKEINDEX_CMD_NAME");
361  QFile file(fileName);
362  bool generateBib = !Doxygen::citeDict->isEmpty();
363  if (!file.open(IO_WriteOnly))
364  {
365  err("Could not open file %s for writing\n",fileName.data());
366  exit(1);
367  }
368  FTextStream t(&file);
369  t << "set Dir_Old=%cd%\n";
370  t << "cd /D %~dp0\n\n";
371  t << "del /s /f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf\n\n";
372  if (!Config_getBool("USE_PDFLATEX")) // use plain old latex
373  {
374  t << latex_command << " refman.tex\n";
375  t << "echo ----\n";
376  t << mkidx_command << " refman.idx\n";
377  if (generateBib)
378  {
379  t << "bibtex refman\n";
380  t << "echo ----\n";
381  t << latex_command << " refman.tex\n";
382  }
383  t << "setlocal enabledelayedexpansion\n";
384  t << "set count=8\n";
385  t << ":repeat\n";
386  t << "set content=X\n";
387  t << "for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\n";
388  t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\n";
389  t << "if !content! == X goto :skip\n";
390  t << "set /a count-=1\n";
391  t << "if !count! EQU 0 goto :skip\n\n";
392  t << "echo ----\n";
393  t << latex_command << " refman.tex\n";
394  t << "goto :repeat\n";
395  t << ":skip\n";
396  t << "endlocal\n";
397  t << mkidx_command << " refman.idx\n";
398  t << latex_command << " refman.tex\n";
399  t << "dvips -o refman.ps refman.dvi\n";
400  t << "gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "
401  "-sOutputFile=refman.pdf -c save pop -f refman.ps\n";
402  }
403  else // use pdflatex
404  {
405  t << "pdflatex refman\n";
406  t << "echo ----\n";
407  t << mkidx_command << " refman.idx\n";
408  if (generateBib)
409  {
410  t << "bibtex refman" << endl;
411  t << "pdflatex refman" << endl;
412  }
413  t << "echo ----\n";
414  t << "pdflatex refman\n\n";
415  t << "setlocal enabledelayedexpansion\n";
416  t << "set count=8\n";
417  t << ":repeat\n";
418  t << "set content=X\n";
419  t << "for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\n";
420  t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\n";
421  t << "if !content! == X goto :skip\n";
422  t << "set /a count-=1\n";
423  t << "if !count! EQU 0 goto :skip\n\n";
424  t << "echo ----\n";
425  t << "pdflatex refman\n";
426  t << "goto :repeat\n";
427  t << ":skip\n";
428  t << "endlocal\n";
429  t << mkidx_command << " refman.idx\n";
430  t << "pdflatex refman\n";
431  t << "cd /D %Dir_Old%\n";
432  t << "set Dir_Old=\n";
433  }
434 #endif
435 }
static CiteDict * citeDict
Definition: doxygen.h:146
#define IO_WriteOnly
Definition: qiodevice.h:62
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
string dir
bool isEmpty() const
Definition: cite.cpp:108
fileName
Definition: dumpTree.py:9
const char * data() const
Definition: qcstring.h:207
#define Config_getString(val)
Definition: config.cpp:660
#define Config_getBool(val)
Definition: config.cpp:664
void err(const char *fmt,...)
Definition: message.cpp:226
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
QTextStream & endl(QTextStream &s)