[sword-svn] r3341 - trunk/utilities/diatheke
refdoc at crosswire.org
refdoc at crosswire.org
Sat Mar 14 07:50:15 MST 2015
Author: refdoc
Date: 2015-03-14 07:50:15 -0700 (Sat, 14 Mar 2015)
New Revision: 3341
Modified:
trunk/utilities/diatheke/corediatheke.cpp
Log:
cleaned up LaTeX output, make option "h" - headlines work
Modified: trunk/utilities/diatheke/corediatheke.cpp
===================================================================
--- trunk/utilities/diatheke/corediatheke.cpp 2015-03-13 20:48:51 UTC (rev 3340)
+++ trunk/utilities/diatheke/corediatheke.cpp 2015-03-14 14:50:15 UTC (rev 3341)
@@ -137,6 +137,8 @@
SWBuf modlocale;
SWBuf syslanguage;
SWBuf syslocale;
+ SWBuf header;
+
char inputformat = 0;
SWBuf encoding;
char querytype = 0;
@@ -339,7 +341,8 @@
target->setKey(ref);
SWBuf text = target->renderText();
-
+
+
if (outputformat == FMT_RTF) {
*output << "{\\rtf1\\ansi{\\fonttbl{\\f0\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f1\\fdecor\\fprq2 ";
if (font)
@@ -353,13 +356,9 @@
" lang=\"" << locale << "\" xml:lang=\"" << locale << "\"/>";
}
else if (outputformat == FMT_LATEX) {
- *output << "\\documentclass{scrbook}\n"
- "\\usepackage{geometry}\n"
- "\\usepackage{setspace}\n"
- "\\usepackage{polyglossia}\n"
- "\\usepackage{lettrine}\n"
- "\\usepackage[perpage,para]{footmisc}\n"
- "\\title{" << target->getDescription() << " \\\\\\small " << ref << "}\n";
+ *output << "\\documentclass{bibletext}\n"
+ "\\usepackage{sword}\n"
+ "\\title{" << target->getDescription() << " \\\\\\small " << ref << "}\n";
if (syslanguage.size()) {
syslanguage[0] = tolower(syslanguage[0]);
@@ -385,13 +384,7 @@
*output << "\\date{}\n"
- "\\onehalfspacing\n"
- "\\setlength{\\parskip}{\\smallskipamount}\n"
- "\\setlength{\\parindent}{0pt}\n"
-
- "\\renewcommand{\\thefootnote}{\\alph{footnote}}\n"
"\\begin{document}\n"
- "\\setlength{\\parskip}{3pt} % 1ex plus 0.5ex minus 0.2ex}\n"
"\\maketitle\n";
if (!(modlanguage == syslanguage)) {
@@ -400,21 +393,6 @@
}
-/* else if (outputformat == FMT_LATEX) {
- *output << "\\documentclass[12pt]{book}\n"
- "\\usepackage{fontspec}\n"
- "\\usepackage{geometry}\n"
- "\\usepackage{setspace}\n"
- "\\usepackage{polyglossia}\n";
- if (font) {
- *output << "\\setmainfont{" << font << "}";
- }
-
- *output << "\\begin{document}\n";
- *output << "\\setlength{\\parskip}{3pt} % 1ex plus 0.5ex minus 0.2ex}\n";
- }
-
-*/
if (text.length()) {
if (outputformat == FMT_LATEX) {
*output << "\\\\ ";
@@ -485,12 +463,8 @@
}
else if (outputformat == FMT_LATEX) {
- *output << "\\documentclass{scrbook}\n"
- "\\usepackage{geometry}\n"
- "\\usepackage{setspace}\n"
- "\\usepackage{polyglossia}\n"
- "\\usepackage{lettrine}\n"
- "\\usepackage[perpage,para]{footmisc}\n"
+ *output << "\\documentclass{bibletext}\n"
+ "\\usepackage{sword}\n"
"\\title{" << target->getDescription() << " \\\\\\small " << ref << "}\n";
if (syslanguage.size()) {
@@ -510,20 +484,12 @@
if (!(modlanguage == syslanguage)) {
- *output << "\\setotherlanguage{" << modlanguage << "}\n"
- "\\newfontfamily\\" << syslanguage << "font{Gentium}\n"
- "\\newfontfamily\\" << modlanguage << "font{" << font << "} % apply following options e.g for Persian [Script=Arabic,Scale=1.3,Ligatures=TeX,Numbers=OldStyle,Mapping=arabicdigits]\n";
+ *output << "\\setotherlanguage{" << modlanguage << "}\n";
}
*output << "\\date{}\n"
- "\\onehalfspacing\n"
- "\\setlength{\\parskip}{\\smallskipamount}\n"
- "\\setlength{\\parindent}{0pt}\n"
-
- "\\renewcommand{\\thefootnote}{\\alph{footnote}}\n"
"\\begin{document}\n"
- "\\setlength{\\parskip}{3pt} % 1ex plus 0.5ex minus 0.2ex}\n"
"\\maketitle\n";
if (!(modlanguage == syslanguage)) {
@@ -552,12 +518,11 @@
<< outkey->getChapter()
<< "}";
}
- else {
- *output << "\\swordverse{"
- << outkey->getVerse()
- << "} ";
+ *output << "\\swordverse{"
+ << outkey->getVerse()
+ << "} ";
+
}
- }
else {
*output << (char*)target->getKeyText();
}
@@ -576,7 +541,9 @@
else {
*output << ": ";
}
-
+
+ header = target->getEntryAttributes()["Heading"]["Preverse"]["0"];
+ *output << target->renderText(header);
*output << target->renderText();
@@ -612,9 +579,9 @@
if (outkey->getVerse() == 1) {
*output << "\n\\swordchapter{" << outkey->getChapter() << "}";
}
- else {
- *output << "\\swordverse{" << outkey->getVerse() << "} ";
- }
+
+ *output << "\\swordverse{" << outkey->getVerse() << "} ";
+
}
else {
*output << (char*)target->getKeyText();
@@ -635,7 +602,11 @@
else {
*output << ": ";
}
+
+ header = target->getEntryAttributes()["Heading"]["Preverse"]["0"];
+ *output << target->renderText(header);
*output << target->renderText();
+
if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
*output << "</span>";
}
More information about the sword-cvs
mailing list