[sword-svn] r3022 - trunk/utilities/diatheke

refdoc at crosswire.org refdoc at crosswire.org
Fri Jan 24 03:47:19 MST 2014


Author: refdoc
Date: 2014-01-24 03:47:19 -0700 (Fri, 24 Jan 2014)
New Revision: 3022

Modified:
   trunk/utilities/diatheke/corediatheke.cpp
Log:
improvement of LD output in LaTeX, reversal of commit which caused segfaults 


Modified: trunk/utilities/diatheke/corediatheke.cpp
===================================================================
--- trunk/utilities/diatheke/corediatheke.cpp	2014-01-23 12:57:26 UTC (rev 3021)
+++ trunk/utilities/diatheke/corediatheke.cpp	2014-01-24 10:47:19 UTC (rev 3022)
@@ -343,6 +343,54 @@
 				   " 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";
+
+			if (syslanguage.size()) {
+				syslanguage[0] = tolower(syslanguage[0]);
+				*output << "\\setmainlanguage{" << syslanguage << "}\n";
+				}
+			
+			if (modlanguage.size()) {
+				modlanguage[0] = tolower(modlanguage[0]);
+				}
+			else {	
+				modlanguage = "english";
+				}
+			if (!(font)) {	
+				font = "Gentium";
+				}
+							
+			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 << "\\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))      {
+				   *output << "\\begin{" << modlanguage << "}\n";
+				   }
+
+		}
+
+/*		else if (outputformat == FMT_LATEX) {
 			*output << "\\documentclass[12pt]{book}\n"
 				   "\\usepackage{fontspec}\n"
 				   "\\usepackage{geometry}\n"
@@ -356,7 +404,7 @@
 			*output << "\\setlength{\\parskip}{3pt} % 1ex plus 0.5ex minus 0.2ex}\n";
 		}
 
-
+*/
 		if (text.length()) {
 			if (outputformat == FMT_LATEX) {
 				*output << "\\\\ ";
@@ -383,14 +431,23 @@
 				*output << "}";
 			}
 
-			*output << "(" << target->getName() << ")\n";
+			*output << "(" << target->getName(); 
+			
+		
+			if (outputformat == FMT_LATEX) {
+				*output << ", ";
+				*output << target->getConfigEntry("DistributionLicense");
+				}
+
+			
+			*output << ")\n";
 		}
 
 		if (outputformat == FMT_RTF) {
 			*output << "}";
 		}
 		else if (outputformat == FMT_LATEX) {
-			*output << "\\end{document}";
+			*output << "\\end{document}\n";
 		}
 
 	}
@@ -438,7 +495,7 @@
 				modlanguage = "english";
 				}
 			if (!(font)) {	
-				strcpy(font,"Gentium");
+				font = "Gentium";
 				}
 							
 			if (!(modlanguage == syslanguage))	{		
@@ -601,6 +658,7 @@
 		if (outputformat == FMT_LATEX) {
 			*output << ", ";
 			*output << target->getConfigEntry("DistributionLicense");
+			
 		}
 		*output << ")\n";
 




More information about the sword-cvs mailing list