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 2516 of file latexgen.cpp.

2517{
2518 TextStream t;
2519 filterLatexString(t,s,insideTabbing,false,false,false,keepSpaces);
2520 return t.str();
2521}
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:4937
bool checkExtension(const QCString &fName, const QCString &ext)
Definition util.cpp:4920

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 2346 of file latexgen.cpp.

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

2569{
2570 //printf("latexEscapeIndexChars(%s)\n",qPrint(s));
2571 if (s.isEmpty()) return s;
2573 TextStream t;
2574 const char *p=s.data();
2575 char c = 0;
2576 while ((c=*p++))
2577 {
2578 switch (c)
2579 {
2580 case '!': t << "\"!"; break;
2581 case '"': t << "\"\""; break;
2582 case '@': t << "\"@"; break;
2583 case '|': t << "\\texttt{\"|}"; break;
2584 case '[': t << "["; break;
2585 case ']': t << "]"; break;
2586 case '{': t << "\\lcurly{}"; break;
2587 case '}': t << "\\rcurly{}"; break;
2588 // NOTE: adding a case here, means adding it to while below as well!
2589 default:
2590 {
2591 int i=0;
2592 // collect as long string as possible, before handing it to docify
2593 tmp[i++]=c;
2594 while ((c=*p) && c!='"' && c!='@' && c!='[' && c!=']' && c!='!' && c!='{' && c!='}' && c!='|')
2595 {
2596 tmp[i++]=c;
2597 p++;
2598 }
2599 tmp[i]=0;
2600 filterLatexString(t,tmp,
2601 true, // insideTabbing
2602 false, // insidePre
2603 false, // insideItem
2604 false, // insideTable
2605 false // keepSpaces
2606 );
2607 }
2608 break;
2609 }
2610 }
2611 return t.str();
2612}
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 2523 of file latexgen.cpp.

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

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 2614 of file latexgen.cpp.

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

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

Referenced by LatexGenerator::startMemberDoc().

◆ latexFilterURL()

QCString latexFilterURL ( const QCString & s)

Definition at line 2642 of file latexgen.cpp.

2643{
2644 constexpr auto hex = "0123456789ABCDEF";
2645 if (s.isEmpty()) return s;
2646 TextStream t;
2647 const char *p=s.data();
2648 char c = 0;
2649 while ((c=*p++))
2650 {
2651 switch (c)
2652 {
2653 case '#': t << "\\#"; break;
2654 case '%': t << "\\%"; break;
2655 case '\\': t << "\\\\"; break;
2656 case '\n': break; // ignore
2657 default:
2658 if (c<0)
2659 {
2660 unsigned char id = static_cast<unsigned char>(c);
2661 t << "\\%" << hex[id>>4] << hex[id&0xF];
2662 }
2663 else
2664 {
2665 t << c;
2666 }
2667 break;
2668 }
2669 }
2670 return t.str();
2671}
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 2673 of file latexgen.cpp.

2674{
2675 if (!s1.isEmpty())
2676 {
2677 m_t << "\\index{";
2678 m_t << latexEscapeLabelName(s1);
2679 m_t << "@{";
2680 m_t << latexEscapeIndexChars(s1);
2681 m_t << "}";
2682 if (!s2.isEmpty())
2683 {
2684 m_t << "!";
2685 m_t << latexEscapeLabelName(s2);
2686 m_t << "@{";
2687 m_t << latexEscapeIndexChars(s2);
2688 m_t << "}";
2689 }
2690 m_t << "}\n";
2691 }
2692}
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:4952

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:6609
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:6432
QCString substituteKeywords(const QCString &file, const QCString &s, const KeywordSubstitutionList &keywords)
Definition util.cpp:3058
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:5880

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 2285 of file latexgen.cpp.

2286{
2287 // User-specified packages
2288 const StringVector &extraPackages = Config_getList(EXTRA_PACKAGES);
2289 if (!extraPackages.empty())
2290 {
2291 t << "% Packages requested by user\n";
2292 for (const auto &pkgName : extraPackages)
2293 {
2294 if ((pkgName[0] == '[') || (pkgName[0] == '{'))
2295 t << "\\usepackage" << pkgName << "\n";
2296 else
2297 t << "\\usepackage{" << pkgName << "}\n";
2298 }
2299 t << "\n";
2300 }
2301}

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 2303 of file latexgen.cpp.

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

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().