Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
some changes to run under our vagrant box
  • Loading branch information
calcnerd256 committed Apr 18, 2016
1 parent 3d07d55 commit 7e08c96
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 40 deletions.
26 changes: 17 additions & 9 deletions Skripten/EOAconvert.py
Expand Up @@ -46,10 +46,12 @@
# Paths to executables
GM_PATH = "/usr/local/bin/gm"
TL_PATH = "/usr/local/texlive/2013/"
TRALICS_PATH_EXEC = "/Users/kthoden/src/tralics-2.15.2/src/tralics"
TRALICS_PATH_LIB = "/Users/kthoden/EOAKram/Probe/MPDL/tralics"
PDFTK_PATH = "/usr/local/bin/pdftk"
SUPPORT_TEMPLATE_PATH = "/Users/kthoden/EOAKram/Probe/MPDL/"
TRALICS_PATH_EXEC = "/usr/bin/tralics"
TRALICS_PATH_LIB = "/home/vagrant/EOASkripts/tralics_conf"
PDFTK_PATH = "/usr/bin/pdftk"
SUPPORT_TEMPLATE_PATH = "/home/vagrant/EOASkripts/"
TEXBIN_PATH = "/usr/texbin"
TEXBIN_PATH = "/usr/bin"
# curl als gegeben voraussetzen?

interimResult = ""
Expand Down Expand Up @@ -146,7 +148,7 @@ def TeX2PNG(LaTeXCode, Type, Chapter, Number):
tmp = open(tmpFile, "w")
tmp.write(e)
tmp.close()
Kommando = "/usr/texbin/xelatex --halt-on-error " + tmpFile
Kommando = "%s/xelatex --halt-on-error %s" % (TEXBIN_PATH, tmpFile)
Argumente = shlex.split(Kommando)
# Redirecting stderr to save XeLaTeX-Output
Datei = open('Test.txt', 'w')
Expand Down Expand Up @@ -308,6 +310,12 @@ def cleanup():

(options, args) = parser.parse_args()

# require filename
if options.filename is None:
print("please include the -f argument for a filename")
exit(1)


# Check for folder and necessary files
if os.path.exists(os.getcwd() + "/CONVERT") == False:
print ("Das notwendige Verzeichnis CONVERT wurde noch nicht erstellt.")
Expand Down Expand Up @@ -384,7 +392,7 @@ def cleanup():
##############################################################

# Figure out how to number (like essay or regular)
strSerie = xmlTree.find(".//EOAseries").text or "regular"
strSerie = getattr(xmlTree.find(".//EOAseries"), "text", None) or "regular"
if strSerie == "Essay":
strNumberingType = "essay"
else:
Expand Down Expand Up @@ -713,7 +721,7 @@ def cleanup():
tmp.write(e)
tmp.close()
print ("Typesetting all Inline Equations")
Kommando = "/usr/texbin/xelatex --halt-on-error " + tmpFile
Kommando = "%s/xelatex --halt-on-error %s" % (TEXBIN_PATH, tmpFile)
Argumente = shlex.split(Kommando)
Datei = open('Test.txt', 'w')
Ergebnis = subprocess.call(Argumente,cwd=tmpDir,stdout=Datei)
Expand Down Expand Up @@ -917,7 +925,7 @@ def cleanup():
xmlEntries = xmlBibTree.findall(".//entry")

# If Bibliography-Type is monograph search for EOAbibliography and make it all
if xmlTree.find(".//EOAbibliographytype").text == "monograph":
if getattr(xmlTree.find(".//EOAbibliographytype"), "text", None) == "monograph":
if xmlTree.find(".//EOAprintbibliography") is not None:
xmlBibliography = xmlTree.find(".//EOAprintbibliography")
xmlBibliography.clear()
Expand Down Expand Up @@ -948,7 +956,7 @@ def cleanup():
intNumberOfEntry += 1

# If Bibliography-Type is anthology search for EOAbibliography and make one per chapter
if xmlTree.find(".//EOAbibliographytype").text == "anthology":
if getattr(xmlTree.find(".//EOAbibliographytype"), "text", None) == "anthology":
intChapterNumber = 1
for xmlChapter in xmlChapters:
if xmlChapter.find(".//EOAprintbibliography") is not None:
Expand Down
36 changes: 18 additions & 18 deletions TeX/pre_eoa.tex
Expand Up @@ -25,7 +25,7 @@

% Activate fontspec for various fonts
\usepackage[no-math]{fontspec}
\setmainfont[Mapping=tex-text]{Times New Roman}
%\setmainfont[Mapping=tex-text]{Times New Roman}
%\setsansfont[Mapping=tex-text]{Skia}
%\setromanfont{Geneva}

Expand All @@ -44,13 +44,13 @@
\newfontfamily\zhfont{DFKai-SB}
\newfontfamily\zhpunctfont{DFKai-SB}
\else
\newfontfamily\zhfont{BiauKai}
\newfontfamily\zhpunctfont{BiauKai}
%\newfontfamily\zhfont{BiauKai}
%\newfontfamily\zhpunctfont{BiauKai}
\fi

% The package zhspacing makes typesetting chinese much better
\usepackage{zhspacing}
\zhspacing
%\usepackage{zhspacing}
%\zhspacing

% assigning explicit character classes for CJK ambiguous characters
\XeTeXcharclass`“=6
Expand All @@ -65,21 +65,21 @@
\newfontfamily\textchinese{DFKai-SB}
\newfontfamily\chinesefont{DFKai-SB}
\else
\newfontfamily\textchinese{BiauKai}
\newfontfamily\chinesefont{BiauKai}
%\newfontfamily\textchinese{BiauKai}
%\newfontfamily\chinesefont{BiauKai}
\fi
\newfontfamily\germanfont{Times New Roman}
\newfontfamily\englishfont{Times New Roman}
\newfontfamily\greekfont{Times New Roman}
\newfontfamily\russianfont{Times New Roman}
\newfontfamily\hebrewfont{Times New Roman}
%\newfontfamily\germanfont{Times New Roman}
%\newfontfamily\englishfont{Times New Roman}
%\newfontfamily\greekfont{Times New Roman}
%\newfontfamily\russianfont{Times New Roman}
%\newfontfamily\hebrewfont{Times New Roman}
% Those fonts are being used in Berlin only, no need for Windows
\ifwindows
\else
\newfontfamily\Arial{ArialMT}
%\newfontfamily\Arial{ArialMT}
\newfontfamily\Courier{Courier}
\newfontfamily\Helvetica{Helvetica}
\newfontfamily\Verdana{Verdana}
%\newfontfamily\Helvetica{Helvetica}
%\newfontfamily\Verdana{Verdana}
\fi

% Equation- and formula-fun
Expand All @@ -90,9 +90,9 @@
\usepackage{slashed}
% amsfonts and similar produce broken PDF X/4 - we need unicode-math
% and use the font XITS-Math (https://github.com/khaledhosny/xits-math)
\usepackage[bold-style=TeX,math-style=TeX]{unicode-math}
\setmathfont[active-frac=small]{XITS Math}
\setmathfont[version=bold,FakeBold=1.5]{XITS Math}
%\usepackage[bold-style=TeX,math-style=TeX]{unicode-math}
%\setmathfont[active-frac=small]{XITS Math}
%\setmathfont[version=bold,FakeBold=1.5]{XITS Math}
\DeclareMathSizes{8}{6.5}{6}{5}

% Chemical formulas
Expand Down
26 changes: 13 additions & 13 deletions Templates/Formel.tex
Expand Up @@ -3,7 +3,7 @@
%\usepackage{amssymb,latexsym}
% fontspec has to be loaded early to avoid packages clashing
\usepackage[no-math]{fontspec}
\setmainfont[Mapping=tex-text]{Times New Roman}
%\setmainfont[Mapping=tex-text]{Times New Roman}

\usepackage{xltxtra}
\usepackage{xunicode}
Expand All @@ -14,10 +14,10 @@

% Definition der Schriftarten für die einzelnen Schriftsysteme.
% Das Paket zhspacing fügt weitere Unterstützung für Chinesisch hinzu
\newfontfamily\zhfont{BiauKai}
\newfontfamily\zhpunctfont{BiauKai}
\usepackage{zhspacing}
\zhspacing
%\newfontfamily\zhfont{BiauKai}
%\newfontfamily\zhpunctfont{BiauKai}
%\usepackage{zhspacing}
%\zhspacing

% assigning explicit character classes for CJK ambiguous characters
\XeTeXcharclass`“=6
Expand All @@ -27,13 +27,13 @@
\XeTeXcharclass`’=6
\XeTeXcharclass`…=6

\newfontfamily\textchinese{BiauKai}
\newfontfamily\chinesefont{BiauKai}
\newfontfamily\germanfont{Times New Roman}
\newfontfamily\englishfont{Times New Roman}
\newfontfamily\greekfont{Times New Roman}
\newfontfamily\russianfont{Times New Roman}
\newfontfamily\hebrewfont{Times New Roman}
%\newfontfamily\textchinese{BiauKai}
%\newfontfamily\chinesefont{BiauKai}
%\newfontfamily\germanfont{Times New Roman}
%\newfontfamily\englishfont{Times New Roman}
%\newfontfamily\greekfont{Times New Roman}
%\newfontfamily\russianfont{Times New Roman}
%\newfontfamily\hebrewfont{Times New Roman}

% Für mathematische und physikalische Formeln
\usepackage{amsmath}
Expand All @@ -53,4 +53,4 @@

$DERINHALT
\end{document}
\end{document}

0 comments on commit 7e08c96

Please sign in to comment.