Doxygen
Loading...
Searching...
No Matches
latexgen.cpp File Reference
#include <cstdlib>
#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 "docnode.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"
#include "datetime.h"
#include "outputlist.h"
#include "moduledef.h"
Include dependency graph for latexgen.cpp:

Go to the source code of this file.

Macros

#define COPYCHAR()

Functions

static QCString substituteLatexKeywords (const QCString &file, const QCString &str, const QCString &title)
static void writeLatexMakefile ()
static void writeMakeBat ()
static void writeDefaultStyleSheet (TextStream &t)
static QCString extraLatexStyleSheet ()
static QCString makeIndex ()
static QCString latex_batchmode ()
static QCString objectLinkToString (const QCString &ref, const QCString &f, const QCString &anchor, const QCString &text, bool insideTabbing, bool disableLinks)
static void processEntity (TextStream &t, bool pdfHyperlinks, const char *strForm, const char *strRepl)
void writeExtraLatexPackages (TextStream &t)
void writeLatexSpecialFormulaChars (TextStream &t)
void filterLatexString (TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces, const bool retainNewline)
QCString convertToLaTeX (const QCString &s, bool insideTabbing, bool keepSpaces)
QCString latexEscapeLabelName (const QCString &s)
QCString latexEscapeIndexChars (const QCString &s)
QCString latexEscapePDFString (const QCString &s)
QCString latexFilterURL (const QCString &s)
void latexWriteIndexItem (TextStream &m_t, const QCString &s1, const QCString &s2)

Variables

static QCString g_header
static QCString g_header_file
static QCString g_footer
static QCString g_footer_file
static const SelectionMarkerInfo latexMarkerInfo = { '%', "%%BEGIN ",8 ,"%%END ",6, "",0 }

Macro Definition Documentation

◆ COPYCHAR

#define COPYCHAR ( )
Value:
do { \
int bytes = getUTF8CharNumBytes(c); \
if (lresult < (i + bytes + 1)) \
{ \
lresult += 512; \
result = static_cast<char *>(realloc(result, lresult)); \
} \
for (int j=0; j<bytes && *p; j++) \
{ \
result[i++]=*p++; \
} \
m_col++; \
} while(0)
uint8_t getUTF8CharNumBytes(char c)
Returns the number of bytes making up a single UTF8 character given the first byte in the sequence.
Definition utf8.cpp:23

Referenced by LatexCodeGenerator::codify().

Function Documentation

◆ convertToLaTeX()

QCString convertToLaTeX ( const QCString & s,
bool insideTabbing,
bool keepSpaces )

Definition at line 2523 of file latexgen.cpp.

2524{
2525 TextStream t;
2526 filterLatexString(t,s,insideTabbing,false,false,false,keepSpaces);
2527 return t.str();
2528}
Text streaming class that buffers data.
Definition textstream.h:36
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:216
void filterLatexString(TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces, const bool retainNewline)

References filterLatexString(), and TextStream::str().

Referenced by LatexGenerator::endIndexSection(), objectLinkToString(), LatexGenerator::startIndexSection(), substituteLatexKeywords(), and LatexGenerator::writeInheritedSectionTitle().

◆ extraLatexStyleSheet()

QCString extraLatexStyleSheet ( )
static

Definition at line 738 of file latexgen.cpp.

739{
740 QCString result;
741 const StringVector &extraLatexStyles = Config_getList(LATEX_EXTRA_STYLESHEET);
742 for (const auto &fileName : extraLatexStyles)
743 {
744 if (!fileName.empty())
745 {
746 FileInfo fi(fileName);
747 if (fi.exists())
748 {
749 result += "\\usepackage{";
750 QCString fn = fi.fileName();
752 {
753 // strip the extension, it will be added by the usepackage in the tex conversion process
755 }
756 else
757 {
758 result += fn;
759 }
760 result += "}\n";
761 }
762 }
763 }
764 return result;
765}
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
This is an alternative implementation of QCString.
Definition qcstring.h:101
#define Config_getList(name)
Definition config.h:38
std::vector< std::string > StringVector
Definition containers.h:33
#define LATEX_STYLE_EXTENSION
Definition latexgen.h:22
QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
Definition util.cpp:4944
bool checkExtension(const QCString &fName, const QCString &ext)
Definition util.cpp:4927

References checkExtension(), Config_getList, FileInfo::exists(), FileInfo::fileName(), LATEX_STYLE_EXTENSION, and stripExtensionGeneral().

Referenced by substituteLatexKeywords().

◆ filterLatexString()

void filterLatexString ( TextStream & t,
const QCString & str,
bool insideTabbing,
bool insidePre,
bool insideItem,
bool insideTable,
bool keepSpaces,
const bool retainNewline )

Definition at line 2353 of file latexgen.cpp.

2355{
2356 if (str.isEmpty()) return;
2357 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
2358 //printf("filterLatexString(%s) insideTabbing=%d\n",qPrint(str),insideTabbing);
2359 const char *p = str.data();
2360 const char *q = nullptr;
2361 unsigned char pc='\0';
2362
2363 while (*p)
2364 {
2365 unsigned char c=static_cast<unsigned char>(*p++);
2366
2367 if (insidePre)
2368 {
2369 switch(c)
2370 {
2371 case 0xef: // handle U+FFFD i.e. "Replacement character" caused by octal: 357 277 275 / hexadecimal 0xef 0xbf 0xbd
2372 // the LaTeX command \ucr has been defined in doxygen.sty
2373 if (static_cast<unsigned char>(*(p)) == 0xbf && static_cast<unsigned char>(*(p+1)) == 0xbd)
2374 {
2375 t << "{\\ucr}";
2376 p += 2;
2377 }
2378 else
2379 t << static_cast<char>(c);
2380 break;
2381 case '\\': t << "\\(\\backslash\\)"; break;
2382 case '{': t << "\\{"; break;
2383 case '}': t << "\\}"; break;
2384 case '_': t << "\\_"; break;
2385 case '&': t << "\\&"; break;
2386 case '%': t << "\\%"; break;
2387 case '#': t << "\\#"; break;
2388 case '$': t << "\\$"; break;
2389 case '"': t << "\"{}"; break;
2390 case '-': t << "-\\/"; break;
2391 case '^': insideTable ? t << "\\string^" : t << static_cast<char>(c); break;
2392 case '~': t << "\\string~"; break;
2393 case '\n': if (retainNewline) t << "\\newline"; else t << ' ';
2394 break;
2395 case ' ': if (keepSpaces) t << "~"; else t << ' ';
2396 break;
2397 default:
2398 if (c<32) t << ' '; // non printable control character
2399 else t << static_cast<char>(c);
2400 break;
2401 }
2402 }
2403 else
2404 {
2405 switch(c)
2406 {
2407 case 0xef: // handle U+FFFD i.e. "Replacement character" caused by octal: 357 277 275 / hexadecimal 0xef 0xbf 0xbd
2408 // the LaTeX command \ucr has been defined in doxygen.sty
2409 if (static_cast<unsigned char>(*(p)) == 0xbf && static_cast<unsigned char>(*(p+1)) == 0xbd)
2410 {
2411 t << "{\\ucr}";
2412 p += 2;
2413 }
2414 else
2415 t << static_cast<char>(c);
2416 break;
2417 case '#': t << "\\+\\#"; break;
2418 case '$': t << "\\$"; break;
2419 case '%': t << "\\%"; break;
2420 case '^': processEntity(t,pdfHyperlinks,"$^\\wedge$","\\string^"); break;
2421 case '&': {
2422 // possibility to have a special symbol
2423 q = p;
2424 int cnt = 2; // we have to count & and ; as well
2425 while ((*q >= 'a' && *q <= 'z') || (*q >= 'A' && *q <= 'Z') || (*q >= '0' && *q <= '9'))
2426 {
2427 cnt++;
2428 q++;
2429 }
2430 if (*q == ';')
2431 {
2432 --p; // we need & as well
2435 {
2436 p++;
2437 t << "\\&";
2438 }
2439 else
2440 {
2442 q++;
2443 p = q;
2444 }
2445 }
2446 else
2447 {
2448 t << "\\&";
2449 }
2450 }
2451 break;
2452 case '*': processEntity(t,pdfHyperlinks,"$\\ast$","*"); break;
2453 case '_': if (!insideTabbing) t << "\\+";
2454 t << "\\_";
2455 if (!insideTabbing) t << "\\+";
2456 break;
2457 case '{': t << "\\{"; break;
2458 case '}': t << "\\}"; break;
2459 case '<': t << "$<$"; break;
2460 case '>': t << "$>$"; break;
2461 case '|': processEntity(t,pdfHyperlinks,"$\\vert$","|"); break;
2462 case '~': processEntity(t,pdfHyperlinks,"$\\sim$","\\string~"); break;
2463 case '[': if (Config_getBool(PDF_HYPERLINKS) || insideItem)
2464 t << "\\+[";
2465 else
2466 t << "[";
2467 break;
2468 case ']': if (pc=='[') t << "$\\,$";
2469 if (Config_getBool(PDF_HYPERLINKS) || insideItem)
2470 t << "]\\+";
2471 else
2472 t << "]";
2473 break;
2474 case '-': t << "-\\/";
2475 break;
2476 case '\\': t << "\\textbackslash{}";
2477 break;
2478 case '"': t << "\"{}";
2479 break;
2480 case '`': t << "\\`{}";
2481 break;
2482 case '\'': t << "\\textquotesingle{}";
2483 break;
2484 case '\n': if (retainNewline)
2485 {
2486 t << "\\newline";
2487 if (insideTable) t << " ";
2488 }
2489 else
2490 {
2491 t << ' ';
2492 }
2493 break;
2494 case ' ': if (keepSpaces) { if (insideTabbing) t << "\\>"; else t << '~'; } else t << ' ';
2495 break;
2496
2497 default:
2498 //if (!insideTabbing && forceBreaks && c!=' ' && *p!=' ')
2499 if (!insideTabbing &&
2500 ((c>='A' && c<='Z' && pc!=' ' && !(pc>='A' && pc <= 'Z') && pc!='\0' && *p) || (pc=='.' && isId(c)))
2501 )
2502 {
2503 t << "\\+";
2504 }
2505 if (c<32)
2506 {
2507 t << ' '; // non-printable control character
2508 }
2509 else
2510 {
2511 t << static_cast<char>(c);
2512 }
2513 if (!insideTabbing && ((c==':' && *p!=':') || c=='/'))
2514 {
2515 t << "\\+";
2516 }
2517 }
2518 }
2519 pc = c;
2520 }
2521}
const char * latex(SymType symb) const
Access routine to the LaTeX code of the HTML entity.
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
SymType name2sym(const QCString &symName) const
Give code of the requested HTML entity name.
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:172
#define Config_getBool(name)
Definition config.h:33
bool insideTable(const DocNodeVariant *n)
static void processEntity(TextStream &t, bool pdfHyperlinks, const char *strForm, const char *strRepl)
bool isId(int c)
Definition util.h:256

References Config_getBool, QCString::data(), insideTable(), HtmlEntityMapper::instance(), QCString::isEmpty(), isId(), HtmlEntityMapper::latex(), HtmlEntityMapper::name2sym(), processEntity(), and HtmlEntityMapper::Sym_Unknown.

Referenced by LatexCodeGenerator::codify(), convertToLaTeX(), LatexGenerator::docify(), LatexDocVisitor::filter(), latexEscapeIndexChars(), latexEscapeLabelName(), and substituteLatexKeywords().

◆ latex_batchmode()

QCString latex_batchmode ( )
static

Definition at line 785 of file latexgen.cpp.

786{
787 switch (Config_getEnum(LATEX_BATCHMODE))
788 {
789 case LATEX_BATCHMODE_t::NO: return "";
790 case LATEX_BATCHMODE_t::YES: return "\\batchmode";
791 case LATEX_BATCHMODE_t::BATCH: return "\\batchmode";
792 case LATEX_BATCHMODE_t::NON_STOP: return "\\nonstopmode";
793 case LATEX_BATCHMODE_t::SCROLL: return "\\scrollmode";
794 case LATEX_BATCHMODE_t::ERROR_STOP: return "\\errorstopmode";
795 }
796 return "";
797}
#define Config_getEnum(name)
Definition config.h:35

References Config_getEnum.

Referenced by substituteLatexKeywords().

◆ latexEscapeIndexChars()

QCString latexEscapeIndexChars ( const QCString & s)

Definition at line 2575 of file latexgen.cpp.

2576{
2577 //printf("latexEscapeIndexChars(%s)\n",qPrint(s));
2578 if (s.isEmpty()) return s;
2580 TextStream t;
2581 const char *p=s.data();
2582 char c = 0;
2583 while ((c=*p++))
2584 {
2585 switch (c)
2586 {
2587 case '!': t << "\"!"; break;
2588 case '"': t << "\"\""; break;
2589 case '@': t << "\"@"; break;
2590 case '|': t << "\\texttt{\"|}"; break;
2591 case '[': t << "["; break;
2592 case ']': t << "]"; break;
2593 case '{': t << "\\lcurly{}"; break;
2594 case '}': t << "\\rcurly{}"; break;
2595 // NOTE: adding a case here, means adding it to while below as well!
2596 default:
2597 {
2598 int i=0;
2599 // collect as long string as possible, before handing it to docify
2600 tmp[i++]=c;
2601 while ((c=*p) && c!='"' && c!='@' && c!='[' && c!=']' && c!='!' && c!='{' && c!='}' && c!='|')
2602 {
2603 tmp[i++]=c;
2604 p++;
2605 }
2606 tmp[i]=0;
2607 filterLatexString(t,tmp,
2608 true, // insideTabbing
2609 false, // insidePre
2610 false, // insideItem
2611 false, // insideTable
2612 false // keepSpaces
2613 );
2614 }
2615 break;
2616 }
2617 }
2618 return t.str();
2619}
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
@ ExplicitSize
Definition qcstring.h:146

References QCString::data(), QCString::ExplicitSize, filterLatexString(), QCString::isEmpty(), QCString::length(), and TextStream::str().

Referenced by latexWriteIndexItem(), and LatexGenerator::startMemberDoc().

◆ latexEscapeLabelName()

QCString latexEscapeLabelName ( const QCString & s)

Definition at line 2530 of file latexgen.cpp.

2531{
2532 //printf("latexEscapeLabelName(%s)\n",qPrint(s));
2533 if (s.isEmpty()) return s;
2535 TextStream t;
2536 const char *p=s.data();
2537 char c = 0;
2538 while ((c=*p++))
2539 {
2540 switch (c)
2541 {
2542 case '|': t << "\\texttt{\"|}"; break;
2543 case '!': t << "\"!"; break;
2544 case '@': t << "\"@"; break;
2545 case '%': t << "\\%"; break;
2546 case '{': t << "\\lcurly{}"; break;
2547 case '}': t << "\\rcurly{}"; break;
2548 case '~': t << "````~"; break; // to get it a bit better in index together with other special characters
2549 // NOTE: adding a case here, means adding it to while below as well!
2550 default:
2551 {
2552 int i=0;
2553 // collect as long string as possible, before handing it to docify
2554 tmp[i++]=c;
2555 while ((c=*p) && c!='@' && c!='[' && c!=']' && c!='!' && c!='{' && c!='}' && c!='|')
2556 {
2557 tmp[i++]=c;
2558 p++;
2559 }
2560 tmp[i]=0;
2561 filterLatexString(t,tmp,
2562 true, // insideTabbing
2563 false, // insidePre
2564 false, // insideItem
2565 false, // insideTable
2566 false // keepSpaces
2567 );
2568 }
2569 break;
2570 }
2571 }
2572 return t.str();
2573}

References QCString::data(), QCString::ExplicitSize, filterLatexString(), QCString::isEmpty(), QCString::length(), and TextStream::str().

Referenced by latexWriteIndexItem().

◆ latexEscapePDFString()

QCString latexEscapePDFString ( const QCString & s)

Definition at line 2621 of file latexgen.cpp.

2622{
2623 if (s.isEmpty()) return s;
2624 TextStream t;
2625 const char *p=s.data();
2626 char c = 0;
2627 while ((c=*p++))
2628 {
2629 switch (c)
2630 {
2631 case '\\': t << "\\textbackslash{}"; break;
2632 case '{': t << "\\{"; break;
2633 case '}': t << "\\}"; break;
2634 case '_': t << "\\_"; break;
2635 case '%': t << "\\%"; break;
2636 case '&': t << "\\&"; break;
2637 case '#': t << "\\#"; break;
2638 case '$': t << "\\$"; break;
2639 case '^': t << "\\string^"; break;
2640 case '~': t << "\\string~"; break;
2641 default:
2642 t << c;
2643 break;
2644 }
2645 }
2646 return t.str();
2647}

References QCString::data(), QCString::isEmpty(), and TextStream::str().

Referenced by LatexGenerator::startMemberDoc().

◆ latexFilterURL()

QCString latexFilterURL ( const QCString & s)

Definition at line 2649 of file latexgen.cpp.

2650{
2651 constexpr auto hex = "0123456789ABCDEF";
2652 if (s.isEmpty()) return s;
2653 TextStream t;
2654 const char *p=s.data();
2655 char c = 0;
2656 while ((c=*p++))
2657 {
2658 switch (c)
2659 {
2660 case '#': t << "\\#"; break;
2661 case '%': t << "\\%"; break;
2662 case '\\': t << "\\\\"; break;
2663 case '\n': break; // ignore
2664 default:
2665 if (c<0)
2666 {
2667 unsigned char id = static_cast<unsigned char>(c);
2668 t << "\\%" << hex[id>>4] << hex[id&0xF];
2669 }
2670 else
2671 {
2672 t << c;
2673 }
2674 break;
2675 }
2676 }
2677 return t.str();
2678}
static constexpr auto hex

References QCString::data(), hex, QCString::isEmpty(), and TextStream::str().

Referenced by LatexDocVisitor::operator()(), and LatexDocVisitor::operator()().

◆ latexWriteIndexItem()

void latexWriteIndexItem ( TextStream & m_t,
const QCString & s1,
const QCString & s2 )

Definition at line 2680 of file latexgen.cpp.

2681{
2682 if (!s1.isEmpty())
2683 {
2684 m_t << "\\index{";
2685 m_t << latexEscapeLabelName(s1);
2686 m_t << "@{";
2687 m_t << latexEscapeIndexChars(s1);
2688 m_t << "}";
2689 if (!s2.isEmpty())
2690 {
2691 m_t << "!";
2692 m_t << latexEscapeLabelName(s2);
2693 m_t << "@{";
2694 m_t << latexEscapeIndexChars(s2);
2695 m_t << "}";
2696 }
2697 m_t << "}\n";
2698 }
2699}
QCString latexEscapeIndexChars(const QCString &s)
QCString latexEscapeLabelName(const QCString &s)

References QCString::isEmpty(), latexEscapeIndexChars(), and latexEscapeLabelName().

Referenced by LatexGenerator::addIndexItem(), LatexGenerator::endTitleHead(), LatexDocVisitor::operator()(), and LatexGenerator::startMemberDoc().

◆ makeIndex()

QCString makeIndex ( )
static

Definition at line 767 of file latexgen.cpp.

768{
769 QCString result;
770 QCString latex_mkidx_command = Config_getString(LATEX_MAKEINDEX_CMD);
771 if (!latex_mkidx_command.isEmpty())
772 {
773 if (latex_mkidx_command[0] == '\\')
774 result += latex_mkidx_command;
775 else
776 result += "\\"+latex_mkidx_command;
777 }
778 else
779 {
780 result += "\\makeindex";
781 }
782 return result;
783}
#define Config_getString(name)
Definition config.h:32

References Config_getString, and QCString::isEmpty().

Referenced by substituteLatexKeywords().

◆ objectLinkToString()

QCString objectLinkToString ( const QCString & ref,
const QCString & f,
const QCString & anchor,
const QCString & text,
bool insideTabbing,
bool disableLinks )
static

Definition at line 1404 of file latexgen.cpp.

1407{
1408 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1409 QCString result;
1410 if (!disableLinks && ref.isEmpty() && pdfHyperlinks)
1411 {
1412 result += "\\doxymbox{\\hyperlink{";
1413 if (!f.isEmpty()) result += stripPath(f);
1414 if (!f.isEmpty() && !anchor.isEmpty()) result += "_";
1415 if (!anchor.isEmpty()) result += anchor;
1416 result += "}{";
1417 result += convertToLaTeX(text,insideTabbing);
1418 result += "}}";
1419 }
1420 else
1421 {
1422 result += "\\textbf{ ";
1423 result += convertToLaTeX(text,insideTabbing);
1424 result += "}";
1425 }
1426 return result;
1427}
QCString convertToLaTeX(const QCString &s, bool insideTabbing, bool keepSpaces)
QCString stripPath(const QCString &s)
Definition util.cpp:4959

References Config_getBool, convertToLaTeX(), QCString::isEmpty(), and stripPath().

◆ processEntity()

void processEntity ( TextStream & t,
bool pdfHyperlinks,
const char * strForm,
const char * strRepl )
static

Definition at line 1429 of file latexgen.cpp.

1430{
1431 if (pdfHyperlinks)
1432 {
1433 t << "\\texorpdfstring{";
1434 }
1435 t << strForm;
1436 if (pdfHyperlinks)
1437 {
1438 t << "}{" << strRepl << "}";
1439 }
1440}

Referenced by filterLatexString().

◆ substituteLatexKeywords()

QCString substituteLatexKeywords ( const QCString & file,
const QCString & str,
const QCString & title )
static

Definition at line 799 of file latexgen.cpp.

802{
803 bool compactLatex = Config_getBool(COMPACT_LATEX);
804 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
805 bool usePdfLatex = Config_getBool(USE_PDFLATEX);
806 QCString paperType = Config_getEnumAsString(PAPER_TYPE);
807
808 QCString style = Config_getString(LATEX_BIB_STYLE);
809 if (style.isEmpty())
810 {
811 style="plainnat";
812 }
813
814 TextStream tg;
815 QCString generatedBy;
816 auto timeStamp = Config_getEnum(TIMESTAMP);
817 switch (timeStamp)
818 {
819 case TIMESTAMP_t::YES:
820 case TIMESTAMP_t::DATETIME:
821 generatedBy = theTranslator->trGeneratedAt(dateToString(DateTimeType::DateTime),
822 Config_getString(PROJECT_NAME));
823 break;
824 case TIMESTAMP_t::DATE:
825 generatedBy = theTranslator->trGeneratedAt(dateToString(DateTimeType::Date),
826 Config_getString(PROJECT_NAME));
827 break;
828 case TIMESTAMP_t::NO:
829 generatedBy = theTranslator->trGeneratedBy();
830 break;
831 }
832 filterLatexString(tg, generatedBy,
833 false, // insideTabbing
834 false, // insidePre
835 false, // insideItem
836 false, // insideTable
837 false // keepSpaces
838 );
839 generatedBy = tg.str();
840
841 QCString latexFontenc = theTranslator->latexFontenc();
842
843 QCString latexEmojiDirectory = Config_getString(LATEX_EMOJI_DIRECTORY);
844 if (latexEmojiDirectory.isEmpty()) latexEmojiDirectory = ".";
845 latexEmojiDirectory = substitute(latexEmojiDirectory,"\\","/");
846
847 TextStream tg1;
849 QCString extraLatexPackages = tg1.str();
850
851 TextStream tg2;
853 QCString latexSpecialFormulaChars = tg2.str();
854
855 QCString formulaMacrofile = Config_getString(FORMULA_MACROFILE);
856 QCString stripMacroFile;
857 if (!formulaMacrofile.isEmpty())
858 {
859 FileInfo fi(formulaMacrofile.str());
860 formulaMacrofile=fi.absFilePath();
861 stripMacroFile = fi.fileName();
862 copyFile(formulaMacrofile,Config_getString(LATEX_OUTPUT) + "/" + stripMacroFile);
863 }
864
865 QCString projectNumber = Config_getString(PROJECT_NUMBER);
866
867 // first substitute generic keywords
868 QCString result = substituteKeywords(file,str,title,
869 convertToLaTeX(Config_getString(PROJECT_NAME),false),
870 convertToLaTeX(projectNumber,false),
871 convertToLaTeX(Config_getString(PROJECT_BRIEF),false));
872
873 // additional LaTeX only keywords
874 result = substituteKeywords(file,result,
875 {
876 // keyword value getter
877 { "$datetime", [&]() { return dateToString(DateTimeType::DateTime); } },
878 { "$date", [&]() { return dateToString(DateTimeType::Date); } },
879 { "$time", [&]() { return dateToString(DateTimeType::Time); } },
880 { "$year", [&]() { return yearToString(); } },
881 { "$latexdocumentpre", [&]() { return theTranslator->latexDocumentPre(); } },
882 { "$latexdocumentpost", [&]() { return theTranslator->latexDocumentPost(); } },
883 { "$generatedby", [&]() { return generatedBy; } },
884 { "$latexbibstyle", [&]() { return style; } },
885 { "$latexcitereference", [&]() { return theTranslator->trCiteReferences(); } },
886 { "$latexbibfiles", [&]() { return CitationManager::instance().latexBibFiles(); } },
887 { "$papertype", [&]() { return paperType+"paper"; } },
888 { "$extralatexstylesheet", [&]() { return extraLatexStyleSheet(); } },
889 { "$languagesupport", [&]() { return theTranslator->latexLanguageSupportCommand(); } },
890 { "$latexfontenc", [&]() { return latexFontenc; } },
891 { "$latexfont", [&]() { return theTranslator->latexFont(); } },
892 { "$latexemojidirectory", [&]() { return latexEmojiDirectory; } },
893 { "$makeindex", [&]() { return makeIndex(); } },
894 { "$extralatexpackages", [&]() { return extraLatexPackages; } },
895 { "$latexspecialformulachars", [&]() { return latexSpecialFormulaChars; } },
896 { "$formulamacrofile", [&]() { return stripMacroFile; } },
897 { "$latex_batchmode", [&]() { return latex_batchmode(); } }
898 });
899
900 // remove conditional blocks
901 result = selectBlocks(result,
902 {
903 // marker is enabled
904 { "CITATIONS_PRESENT", !CitationManager::instance().isEmpty() },
905 { "COMPACT_LATEX", compactLatex },
906 { "PDF_HYPERLINKS", pdfHyperlinks },
907 { "USE_PDFLATEX", usePdfLatex },
908 { "TIMESTAMP", timeStamp!=TIMESTAMP_t::NO },
909 { "LATEX_FONTENC", !latexFontenc.isEmpty() },
910 { "FORMULA_MACROFILE", !formulaMacrofile.isEmpty() },
911 { "PROJECT_NUMBER", !projectNumber.isEmpty() }
913
914 result = removeEmptyLines(result);
915
916 return result;
917}
QCString latexBibFiles()
lists the bibtex cite files in a comma separated list
Definition cite.cpp:575
static CitationManager & instance()
Definition cite.cpp:85
bool isEmpty() const
return TRUE if there are no citations.
Definition cite.cpp:115
const std::string & str() const
Definition qcstring.h:552
#define Config_getEnumAsString(name)
Definition config.h:36
QCString dateToString(DateTimeType includeTime)
Returns the current date, when includeTime is set also the time is provided.
Definition datetime.cpp:62
QCString yearToString()
Returns the current year as a string.
Definition datetime.cpp:75
Translator * theTranslator
Definition language.cpp:71
static QCString latex_batchmode()
Definition latexgen.cpp:785
static QCString makeIndex()
Definition latexgen.cpp:767
static const SelectionMarkerInfo latexMarkerInfo
Definition latexgen.cpp:54
static QCString extraLatexStyleSheet()
Definition latexgen.cpp:738
void writeExtraLatexPackages(TextStream &t)
void writeLatexSpecialFormulaChars(TextStream &t)
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:571
QCString removeEmptyLines(const QCString &s)
Definition util.cpp:6594
QCString selectBlocks(const QCString &s, const SelectionBlockList &blockList, const SelectionMarkerInfo &markerInfo)
remove disabled blocks and all block markers from s and return the result as a string
Definition util.cpp:6417
QCString substituteKeywords(const QCString &file, const QCString &s, const KeywordSubstitutionList &keywords)
Definition util.cpp:3065
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Definition util.cpp:5865

References FileInfo::absFilePath(), Config_getBool, Config_getEnum, Config_getEnumAsString, Config_getString, convertToLaTeX(), copyFile(), Date, DateTime, dateToString(), extraLatexStyleSheet(), FileInfo::fileName(), filterLatexString(), CitationManager::instance(), CitationManager::isEmpty(), QCString::isEmpty(), latex_batchmode(), CitationManager::latexBibFiles(), latexMarkerInfo, makeIndex(), removeEmptyLines(), selectBlocks(), QCString::str(), TextStream::str(), substitute(), substituteKeywords(), theTranslator, Time, writeExtraLatexPackages(), writeLatexSpecialFormulaChars(), and yearToString().

Referenced by LatexGenerator::endIndexSection(), LatexGenerator::init(), and LatexGenerator::startIndexSection().

◆ writeDefaultStyleSheet()

void writeDefaultStyleSheet ( TextStream & t)
static

Definition at line 685 of file latexgen.cpp.

686{
687 t << ResourceMgr::instance().getAsString("doxygen.sty");
688}
static ResourceMgr & instance()
Returns the one and only instance of this class.
QCString getAsString(const QCString &name) const
Gets the resource data as a C string.

References ResourceMgr::getAsString(), and ResourceMgr::instance().

◆ writeExtraLatexPackages()

void writeExtraLatexPackages ( TextStream & t)

Definition at line 2292 of file latexgen.cpp.

2293{
2294 // User-specified packages
2295 const StringVector &extraPackages = Config_getList(EXTRA_PACKAGES);
2296 if (!extraPackages.empty())
2297 {
2298 t << "% Packages requested by user\n";
2299 for (const auto &pkgName : extraPackages)
2300 {
2301 if ((pkgName[0] == '[') || (pkgName[0] == '{'))
2302 t << "\\usepackage" << pkgName << "\n";
2303 else
2304 t << "\\usepackage{" << pkgName << "}\n";
2305 }
2306 t << "\n";
2307 }
2308}

References Config_getList.

Referenced by FormulaManager::createLatexFile(), and substituteLatexKeywords().

◆ writeLatexMakefile()

void writeLatexMakefile ( )
static

Definition at line 366 of file latexgen.cpp.

367{
368 bool generateBib = !CitationManager::instance().isEmpty();
369 QCString fileName=Config_getString(LATEX_OUTPUT)+"/Makefile";
370 std::ofstream f = Portable::openOutputStream(fileName);
371 if (!f.is_open())
372 {
373 term("Could not open file {} for writing\n",fileName);
374 }
375 TextStream t(&f);
376 // inserted by KONNO Akihisa <konno@researchers.jp> 2002-03-05
377 QCString latex_command = theTranslator->latexCommandName().quoted();
378 QCString mkidx_command = Config_getString(MAKEINDEX_CMD_NAME).quoted();
379 QCString bibtex_command = "bibtex";
380 QCString manual_file = "refman";
381 const int latex_count = 8;
382 // end insertion by KONNO Akihisa <konno@researchers.jp> 2002-03-05
383 t << "LATEX_CMD?=" << latex_command << "\n"
384 << "MKIDX_CMD?=" << mkidx_command << "\n"
385 << "BIBTEX_CMD?=" << bibtex_command << "\n"
386 << "LATEX_COUNT?=" << latex_count << "\n"
387 << "MANUAL_FILE?=" << manual_file << "\n"
388 << "\n";
389 if (!Config_getBool(USE_PDFLATEX)) // use plain old latex
390 {
391 t << "all: $(MANUAL_FILE).dvi\n"
392 << "\n"
393 << "ps: $(MANUAL_FILE).ps\n"
394 << "\n"
395 << "pdf: $(MANUAL_FILE).pdf\n"
396 << "\n"
397 << "ps_2on1: $(MANUAL_FILE).ps\n"
398 << "\n"
399 << "pdf_2on1: $(MANUAL_FILE).pdf\n"
400 << "\n"
401 << "$(MANUAL_FILE).ps: $(MANUAL_FILE).dvi\n"
402 << "\tdvips -o $(MANUAL_FILE).ps $(MANUAL_FILE).dvi\n"
403 << "\n";
404 t << "$(MANUAL_FILE).pdf: $(MANUAL_FILE).ps\n";
405 t << "\tps2pdf $(MANUAL_FILE).ps $(MANUAL_FILE).pdf\n\n";
406 t << "$(MANUAL_FILE).dvi: clean $(MANUAL_FILE).tex doxygen.sty\n"
407 << "\techo \"Running latex...\"\n"
408 << "\t$(LATEX_CMD) $(MANUAL_FILE).tex || \\\n"
409 << "\tif [ $$? != 0 ] ; then \\\n"
410 << "\t \\echo \"Please consult $(MANUAL_FILE).log to see the error messages\" ; \\\n"
411 << "\t false; \\\n"
412 << "\tfi\n"
413 << "\techo \"Running makeindex...\"\n"
414 << "\t$(MKIDX_CMD) $(MANUAL_FILE).idx\n";
415 if (generateBib)
416 {
417 t << "\techo \"Running bibtex...\"\n";
418 t << "\t$(BIBTEX_CMD) $(MANUAL_FILE)\n";
419 t << "\techo \"Rerunning latex....\"\n";
420 t << "\t$(LATEX_CMD) $(MANUAL_FILE).tex || \\\n"
421 << "\tif [ $$? != 0 ] ; then \\\n"
422 << "\t \\echo \"Please consult $(MANUAL_FILE).log to see the error messages\" ; \\\n"
423 << "\t false; \\\n"
424 << "\tfi\n";
425 }
426 t << "\techo \"Rerunning latex....\"\n"
427 << "\t$(LATEX_CMD) $(MANUAL_FILE).tex\n"
428 << "\tlatex_count=$(LATEX_COUNT) ; \\\n"
429 << "\twhile grep -E -s 'Rerun (LaTeX|to get cross-references right|to get bibliographical references right)' $(MANUAL_FILE).log && [ $$latex_count -gt 0 ] ;\\\n"
430 << "\t do \\\n"
431 << "\t echo \"Rerunning latex....\" ;\\\n"
432 << "\t $(LATEX_CMD) $(MANUAL_FILE).tex ; \\\n"
433 << "\t $(LATEX_CMD) $(MANUAL_FILE).tex || \\\n"
434 << "\t if [ $$? != 0 ] ; then \\\n"
435 << "\t \\echo \"Please consult $(MANUAL_FILE).log to see the error messages\" ; \\\n"
436 << "\t false; \\\n"
437 << "\t fi; \\\n"
438 << "\t latex_count=`expr $$latex_count - 1` ;\\\n"
439 << "\t done\n"
440 << "\t$(MKIDX_CMD) $(MANUAL_FILE).idx\n"
441 << "\t$(LATEX_CMD) $(MANUAL_FILE).tex || \\\n"
442 << "\tif [ $$? != 0 ] ; then \\\n"
443 << "\t \\echo \"Please consult $(MANUAL_FILE).log to see the error messages\" ; \\\n"
444 << "\t false; \\\n"
445 << "\tfi\n"
446 << "$(MANUAL_FILE).ps: $(MANUAL_FILE).ps\n"
447 << "\tpsnup -2 $(MANUAL_FILE).ps >$(MANUAL_FILE).ps\n"
448 << "\n"
449 << "$(MANUAL_FILE).pdf: $(MANUAL_FILE).ps\n"
450 << "\tps2pdf $(MANUAL_FILE).ps $(MANUAL_FILE).pdf\n";
451 }
452 else // use pdflatex for higher quality output
453 {
454 t << "all: $(MANUAL_FILE).pdf\n\n"
455 << "pdf: $(MANUAL_FILE).pdf\n\n";
456 t << "$(MANUAL_FILE).pdf: clean $(MANUAL_FILE).tex\n";
457 t << "\t$(LATEX_CMD) $(MANUAL_FILE) || \\\n"
458 << "\tif [ $$? != 0 ] ; then \\\n"
459 << "\t \\echo \"Please consult $(MANUAL_FILE).log to see the error messages\" ; \\\n"
460 << "\t false; \\\n"
461 << "\tfi\n";
462 t << "\t$(MKIDX_CMD) $(MANUAL_FILE).idx\n";
463 if (generateBib)
464 {
465 t << "\t$(BIBTEX_CMD) $(MANUAL_FILE)\n";
466 t << "\t$(LATEX_CMD) $(MANUAL_FILE) || \\\n"
467 << "\tif [ $$? != 0 ] ; then \\\n"
468 << "\t \\echo \"Please consult $(MANUAL_FILE).log to see the error messages\" ; \\\n"
469 << "\t false; \\\n"
470 << "\tfi\n";
471 }
472 t << "\t$(LATEX_CMD) $(MANUAL_FILE) || \\\n"
473 << "\tif [ $$? != 0 ] ; then \\\n"
474 << "\t \\echo \"Please consult $(MANUAL_FILE).log to see the error messages\" ; \\\n"
475 << "\t false; \\\n"
476 << "\tfi\n"
477 << "\tlatex_count=$(LATEX_COUNT) ; \\\n"
478 << "\twhile grep -E -s 'Rerun (LaTeX|to get cross-references right|to get bibliographical references right)' $(MANUAL_FILE).log && [ $$latex_count -gt 0 ] ;\\\n"
479 << "\t do \\\n"
480 << "\t echo \"Rerunning latex....\" ;\\\n"
481 << "\t $(LATEX_CMD) $(MANUAL_FILE) || \\\n"
482 << "\t if [ $$? != 0 ] ; then \\\n"
483 << "\t \\echo \"Please consult $(MANUAL_FILE).log to see the error messages\" ; \\\n"
484 << "\t false; \\\n"
485 << "\t fi; \\\n"
486 << "\t latex_count=`expr $$latex_count - 1` ;\\\n"
487 << "\t done\n"
488 << "\t$(MKIDX_CMD) $(MANUAL_FILE).idx\n"
489 << "\t$(LATEX_CMD) $(MANUAL_FILE) || \\\n"
490 << "\tif [ $$? != 0 ] ; then \\\n"
491 << "\t \\echo \"Please consult $(MANUAL_FILE).log to see the error messages\" ; \\\n"
492 << "\t false; \\\n"
493 << "\tfi\n";
494 }
495
496 t << "\n"
497 << "clean:\n"
498 << "\trm -f "
499 << "*.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl $(MANUAL_FILE).pdf\n";
500}
QCString quoted() const
Definition qcstring.h:275
#define term(fmt,...)
Definition message.h:137
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:648

References Config_getBool, Config_getString, CitationManager::instance(), CitationManager::isEmpty(), Portable::openOutputStream(), QCString::quoted(), term, and theTranslator.

Referenced by LatexGenerator::init().

◆ writeLatexSpecialFormulaChars()

void writeLatexSpecialFormulaChars ( TextStream & t)

Definition at line 2310 of file latexgen.cpp.

2311{
2312 unsigned char minus[4]; // Superscript minus
2313 unsigned char sup2[3]; // Superscript two
2314 unsigned char sup3[3];
2315 minus[0]= 0xE2;
2316 minus[1]= 0x81;
2317 minus[2]= 0xBB;
2318 minus[3]= 0;
2319 sup2[0]= 0xC2;
2320 sup2[1]= 0xB2;
2321 sup2[2]= 0;
2322 sup3[0]= 0xC2;
2323 sup3[1]= 0xB3;
2324 sup3[2]= 0;
2325
2326 t << "\\ifPDFTeX\n";
2327 t << "\\usepackage{newunicodechar}\n";
2328 // taken from the newunicodechar package and removed the warning message
2329 // actually forcing to redefine the unicode character
2330 t << " \\makeatletter\n"
2331 " \\def\\doxynewunicodechar#1#2{%\n"
2332 " \\@tempswafalse\n"
2333 " \\edef\\nuc@tempa{\\detokenize{#1}}%\n"
2334 " \\if\\relax\\nuc@tempa\\relax\n"
2335 " \\nuc@emptyargerr\n"
2336 " \\else\n"
2337 " \\edef\\@tempb{\\expandafter\\@car\\nuc@tempa\\@nil}%\n"
2338 " \\nuc@check\n"
2339 " \\if@tempswa\n"
2340 " \\@namedef{u8:\\nuc@tempa}{#2}%\n"
2341 " \\fi\n"
2342 " \\fi\n"
2343 " }\n"
2344 " \\makeatother\n";
2345
2346 t << " \\doxynewunicodechar{" << minus << "}{${}^{-}$}% Superscript minus\n"
2347 " \\doxynewunicodechar{" << sup2 << "}{${}^{2}$}% Superscript two\n"
2348 " \\doxynewunicodechar{" << sup3 << "}{${}^{3}$}% Superscript three\n"
2349 "\n";
2350 t << "\\fi\n";
2351}

Referenced by FormulaManager::createLatexFile(), and substituteLatexKeywords().

◆ writeMakeBat()

void writeMakeBat ( )
static

Definition at line 502 of file latexgen.cpp.

503{
504#if defined(_MSC_VER)
505 QCString dir=Config_getString(LATEX_OUTPUT);
506 QCString fileName=dir+"/make.bat";
507 QCString latex_command = theTranslator->latexCommandName().quoted();
508 QCString mkidx_command = Config_getString(MAKEINDEX_CMD_NAME).quoted();
509 QCString bibtex_command = "bibtex";
510 QCString manual_file = "refman";
511 const int latex_count = 8;
512 bool generateBib = !CitationManager::instance().isEmpty();
513 std::ofstream t = Portable::openOutputStream(fileName);
514 if (!t.is_open())
515 {
516 term("Could not open file {} for writing\n",fileName);
517 }
518 t << "pushd %~dp0\r\n";
519 t << "if not %errorlevel% == 0 goto :end1\r\n";
520 t << "\r\n";
521 t << "set ORG_LATEX_CMD=%LATEX_CMD%\r\n";
522 t << "set ORG_MKIDX_CMD=%MKIDX_CMD%\r\n";
523 t << "set ORG_BIBTEX_CMD=%BIBTEX_CMD%\r\n";
524 t << "set ORG_LATEX_COUNT=%LATEX_COUNT%\r\n";
525 t << "set ORG_MANUAL_FILE=%MANUAL_FILE%\r\n";
526 t << "if \"X\"%LATEX_CMD% == \"X\" set LATEX_CMD=" << latex_command << "\r\n";
527 t << "if \"X\"%MKIDX_CMD% == \"X\" set MKIDX_CMD=" << mkidx_command << "\r\n";
528 t << "if \"X\"%BIBTEX_CMD% == \"X\" set BIBTEX_CMD=" << bibtex_command << "\r\n";
529 t << "if \"X\"%LATEX_COUNT% == \"X\" set LATEX_COUNT=" << latex_count << "\r\n";
530 t << "if \"X\"%MANUAL_FILE% == \"X\" set MANUAL_FILE=" << manual_file << "\r\n";
531 t << "\r\n";
532 t << "del /s /f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl %MANUAL_FILE%.pdf\r\n\r\n";
533 t << "\r\n";
534 if (!Config_getBool(USE_PDFLATEX)) // use plain old latex
535 {
536 t << "%LATEX_CMD% %MANUAL_FILE%.tex\r\n";
537 t << "@if ERRORLEVEL 1 goto :error\r\n";
538 t << "echo ----\r\n";
539 t << "%MKIDX_CMD% %MANUAL_FILE%.idx\r\n";
540 if (generateBib)
541 {
542 t << "%BIBTEX_CMD% %MANUAL_FILE%\r\n";
543 t << "echo ----\r\n";
544 t << "\t%LATEX_CMD% %MANUAL_FILE%.tex\r\n";
545 t << "@if ERRORLEVEL 1 goto :error\r\n";
546 }
547 t << "setlocal enabledelayedexpansion\r\n";
548 t << "set count=%LAT#EX_COUNT%\r\n";
549 t << ":repeat\r\n";
550 t << "set content=X\r\n";
551 t << "for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" %MANUAL_FILE%.log' ) do set content=\"%%~T\"\r\n";
552 t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" %MANUAL_FILE%.log' ) do set content=\"%%~T\"\r\n";
553 t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get bibliographical references right\" %MANUAL_FILE%.log' ) do set content=\"%%~T\"\r\n";
554 t << "if !content! == X goto :skip\r\n";
555 t << "set /a count-=1\r\n";
556 t << "if !count! EQU 0 goto :skip\r\n\r\n";
557 t << "echo ----\r\n";
558 t << "%LATEX_CMD% %MANUAL_FILE%.tex\r\n";
559 t << "@if ERRORLEVEL 1 goto :error\r\n";
560 t << "goto :repeat\r\n";
561 t << ":skip\r\n";
562 t << "endlocal\r\n";
563 t << "%MKIDX_CMD% %MANUAL_FILE%.idx\r\n";
564 t << "%LATEX_CMD% %MANUAL_FILE%.tex\r\n";
565 t << "@if ERRORLEVEL 1 goto :error\r\n";
566 t << "dvips -o %MANUAL_FILE%.ps %MANUAL_FILE%.dvi\r\n";
568 t << " -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "
569 "-sOutputFile=%MANUAL_FILE%.pdf -c save pop -f %MANUAL_FILE%.ps\r\n";
570 }
571 else // use pdflatex
572 {
573 t << "%LATEX_CMD% %MANUAL_FILE%\r\n";
574 t << "@if ERRORLEVEL 1 goto :error\r\n";
575 t << "echo ----\r\n";
576 t << "%MKIDX_CMD% %MANUAL_FILE%.idx\r\n";
577 if (generateBib)
578 {
579 t << "%BIBTEX_CMD% %MANUAL_FILE%\r\n";
580 t << "%LATEX_CMD% %MANUAL_FILE%\r\n";
581 t << "@if ERRORLEVEL 1 goto :error\r\n";
582 }
583 t << "echo ----\r\n";
584 t << "%LATEX_CMD% %MANUAL_FILE%\r\n";
585 t << "@if ERRORLEVEL 1 goto :error\r\n";
586 t << "\r\n";
587 t << "setlocal enabledelayedexpansion\r\n";
588 t << "set count=%LATEX_COUNT%\r\n";
589 t << ":repeat\r\n";
590 t << "set content=X\r\n";
591 t << "for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" %MANUAL_FILE%.log' ) do set content=\"%%~T\"\r\n";
592 t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" %MANUAL_FILE%.log' ) do set content=\"%%~T\"\r\n";
593 t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get bibliographical references right\" %MANUAL_FILE%.log' ) do set content=\"%%~T\"\r\n";
594 t << "if !content! == X goto :skip\r\n";
595 t << "set /a count-=1\r\n";
596 t << "if !count! EQU 0 goto :skip\r\n\r\n";
597 t << "echo ----\r\n";
598 t << "%LATEX_CMD% %MANUAL_FILE%\r\n";
599 t << "@if ERRORLEVEL 1 goto :error\r\n";
600 t << "goto :repeat\r\n";
601 t << ":skip\r\n";
602 t << "endlocal\r\n";
603 t << "%MKIDX_CMD% %MANUAL_FILE%.idx\r\n";
604 t << "%LATEX_CMD% %MANUAL_FILE%\r\n";
605 t << "@if ERRORLEVEL 1 goto :error\r\n";
606 }
607 t<< "\r\n";
608 t << "goto :end\r\n";
609 t << ":error\r\n";
610 t << "@echo ===============\r\n";
611 t << "@echo Please consult %MANUAL_FILE%.log to see the error messages\r\n";
612 t << "@echo ===============\r\n";
613 t<< "\r\n";
614 t<< ":end\r\n";
615 t<< "@REM reset environment\r\n";
616 t<< "popd\r\n";
617 t<< "set LATEX_CMD=%ORG_LATEX_CMD%\r\n";
618 t<< "set ORG_LATEX_CMD=\r\n";
619 t<< "set MKIDX_CMD=%ORG_MKIDX_CMD%\r\n";
620 t<< "set ORG_MKIDX_CMD=\r\n";
621 t<< "set BIBTEX_CMD=%ORG_BIBTEX_CMD%\r\n";
622 t<< "set ORG_BIBTEX_CMD=\r\n";
623 t<< "set MANUAL_FILE=%ORG_MANUAL_FILE%\r\n";
624 t<< "set ORG_MANUAL_FILE=\r\n";
625 t<< "set LATEX_COUNT=%ORG_LATEX_COUNT%\r\n";
626 t<< "set ORG_LATEX_COUNT=\r\n";
627 t<< "\r\n";
628 t<< ":end1\r\n";
629#endif
630}
const char * ghostScriptCommand()
Definition portable.cpp:437

References Config_getBool, Config_getString, Portable::ghostScriptCommand(), CitationManager::instance(), CitationManager::isEmpty(), Portable::openOutputStream(), QCString::quoted(), term, and theTranslator.

Referenced by LatexGenerator::init().

Variable Documentation

◆ g_footer

QCString g_footer
static

Definition at line 52 of file latexgen.cpp.

◆ g_footer_file

QCString g_footer_file
static

Definition at line 53 of file latexgen.cpp.

◆ g_header

QCString g_header
static

Definition at line 50 of file latexgen.cpp.

◆ g_header_file

QCString g_header_file
static

Definition at line 51 of file latexgen.cpp.

◆ latexMarkerInfo

const SelectionMarkerInfo latexMarkerInfo = { '%', "%%BEGIN ",8 ,"%%END ",6, "",0 }
static

Definition at line 54 of file latexgen.cpp.

54{ '%', "%%BEGIN ",8 ,"%%END ",6, "",0 };

Referenced by LatexGenerator::init(), and substituteLatexKeywords().