diff --git a/Skripten/EOAbibitem.py b/Skripten/EOAbibitem.py new file mode 100644 index 0000000..3282680 --- /dev/null +++ b/Skripten/EOAbibitem.py @@ -0,0 +1,315 @@ +import re +class Bibitem: + + # TODO: Interne Funktion, um° durch Leerzeichen zu ersetzen + # TODO: Eine Lösung finden, für Autoren die nur aus einem Namen bestehen, ie keinen Vornamen haben + + def __init__(self,xmlEntry): + self.xmlEntry = xmlEntry + + def sanitize(self,strString): + strString = re.sub("°", " ", strString) + return strString + + def gettext(self,xmlElement): + xmlText = xmlElement.text or "" + for xmlChild in xmlElement: + xmlText += self.gettext(xmlChild) + if xmlChild.tail: + xmlText += xmlChild.tail + return xmlText + + def citekey(self): + xmlEntry = self.xmlEntry + xmlLabel = xmlEntry.find(".//label") + if xmlLabel is not None: + return xmlLabel.text + else: + return None + + def entrytype(self): + strType = self.xmlEntry.find(".//type").text + return strType + + def title(self): + xmlTitle = self.xmlEntry.find(".//title") + if xmlTitle is not None: + strTitle = xmlTitle.text + return strTitle + else: + return "" + + def addendum(self): + xmlAddendum = self.xmlEntry.find(".//addendum") + if xmlAddendum is not None: + return xmlAddendum.text + else: + return "" + + def volume(self): + xmlVolume = self.xmlEntry.find(".//volume") + if xmlVolume is not None: + strResult = " Vol. " + xmlVolume.text + ". " + return strResult + else: + return "" + + def volumenumeric(self): + xmlVolume = self.xmlEntry.find(".//volume") + if xmlVolume is not None: + strResult = " " + xmlVolume.text + ". " + return strResult + else: + return "" + + + def series(self): + xmlSeries = self.xmlEntry.find(".//series") + if xmlSeries is not None: + if xmlSeries.text is not None: + strResult = " " + xmlSeries.text + ". " + return strResult + else: + return "" + else: + return "" + + def journaltitle(self): + xmlJournaltitle = self.xmlEntry.find(".//journaltitle") + if xmlJournaltitle is not None: + strResult = " " + str(xmlJournaltitle.text) + " " + return strResult + else: + return "" + + def booktitle(self): + xmlBooktitle = self.xmlEntry.find(".//booktitle") + if xmlBooktitle is not None: + strResult = " In: " + xmlBooktitle.text + " " + return strResult + else: + return "" + + def volumenumberpages(self): + xmlVolume = self.xmlEntry.find(".//volume") + xmlPages = self.xmlEntry.find(".//pages") + xmlNumber = self.xmlEntry.find("number") + strResult = "" + if xmlVolume is not None and xmlNumber is not None and xmlPages is not None and xmlPages.text is not None: + strResult = xmlVolume.text + "(" + xmlNumber.text + "): " + xmlPages.text + if xmlVolume is not None and xmlNumber is None and xmlPages is not None: + strResult = xmlVolume.text + ": " + xmlPages.text + return strResult + + def location(self): + xmlLocation = self.xmlEntry.find(".//location") + if xmlLocation is not None: + xmlPublisher = self.xmlEntry.find(".//publisher") + if xmlPublisher is not None: + strResult = " " + xmlLocation.text + ": " + self.gettext(xmlPublisher) + else: + strResult = " " + xmlLocation.text + return strResult + else: + return "" + + def howpublished(self): + xmlHowpublished = self.xmlEntry.find(".//howpublished") + if xmlHowpublished is not None: + strResult = xmlHowpublished.text + return strResult + else: + return "" + + + def pages(self): + xmlPages = self.xmlEntry.find(".//pages") + if xmlPages is not None: + strResult = " " + xmlPages.text + return strResult + else: + return "" + + def thesistype(self): + xmlTypes = self.xmlEntry.findall(".//type") + strThesisType = " " + xmlTypes[1].text + ". " + return strThesisType + + def institution(self): + xmlInstitution = self.xmlEntry.find(".//institution") + if xmlInstitution is not None: + strInstitution = xmlInstitution.text + return strInstitution + else: + return "" + + def labelyear(self): + xmlEntry = self.xmlEntry + xmlEdition = xmlEntry.find(".//labelyear") + if xmlEdition is not None: + return xmlEdition.text + else: + # If no year is given, return empty string + return "" + + def year(self): + xmlEntry = self.xmlEntry + xmlYear = xmlEntry.find(".//year") + if xmlYear is not None: + return xmlYear.text + else: + return "" + + def labelyearsuffix(self): + xmlEntry = self.xmlEntry + xmlExtrayear = xmlEntry.find(".//extrayear") + if xmlExtrayear is not None: + intExtrayear = int(xmlExtrayear.text) + listCharacters = ["","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] + strLabelYearSuffix = listCharacters[intExtrayear] + return strLabelYearSuffix + else: + return "" + + def fullauthorlastfirst(self): + xmlEntry = self.xmlEntry + # If no Name is given, return either the Shorthand or the Title (Shorthand prefererred) + if xmlEntry.find(".//labelname/number") == None: + if xmlEntry.find(".//shorthand") is not None: + strComplete = xmlEntry.find(".//shorthand").text + return strComplete + else: + strComplete = self.title() + return strComplete + intNumberOfAuthors = int(xmlEntry.find(".//labelname/number").text) + if intNumberOfAuthors == 1: + xmlAuthorRows = xmlEntry.findall(".//labelname/mrow/mrow") + strLastName = xmlAuthorRows[0].text + if len(xmlAuthorRows) > 3: + strFirstName = xmlAuthorRows[2].text + strCompleteName = strLastName + ", " + strFirstName + return self.sanitize(strCompleteName) + else: + return self.sanitize(strLastName) + if intNumberOfAuthors > 1: + xmlAuthorRows = xmlEntry.findall(".//labelname/mrow/mrow/mrow") + # First Author here would be Lastname, Firstname + strLastName = xmlAuthorRows[0].text + strFirstName = xmlAuthorRows[2].text + strCompleteName = strLastName + ", " + strFirstName + # Remaining Authors are to be Firstname Lastname + for i in range(0, (intNumberOfAuthors - 1)): + a = i + 4 + strLastName = "" + strFirstName = "" + if len(xmlAuthorRows) > a: + strLastName = xmlAuthorRows[a].text + a = i + 6 + if len(xmlAuthorRows) > a: + strFirstName = xmlAuthorRows[a].text + strCompleteName = strCompleteName + ", " + strFirstName + " " + strLastName + return self.sanitize(strCompleteName) + + def fullauthorfirstlast(self): + xmlEntry = self.xmlEntry + # If no Name is given, return either the Shorthand or the Title (Shorthand prefererred) + if xmlEntry.find(".//labelname/number") == None: + if xmlEntry.find(".//shorthand") is not None: + strComplete = xmlEntry.find(".//shorthand").text + return strComplete + else: + strComplete = self.title() + return strComplete + intNumberOfAuthors = int(xmlEntry.find(".//labelname/number").text) + if intNumberOfAuthors == 1: + xmlAuthorRows = xmlEntry.findall(".//labelname/mrow/mrow") + strLastName = xmlAuthorRows[0].text + if len(xmlAuthorRows) > 3: + strFirstName = xmlAuthorRows[2].text + strCompleteName = strFirstName + " " + strLastName + return self.sanitize(strCompleteName) + else: + return self.sanitize(strLastName) + if intNumberOfAuthors > 1: + xmlAuthorRows = xmlEntry.findall(".//labelname/mrow/mrow/mrow") + # First Author here would be Lastname, Firstname + strLastName = xmlAuthorRows[0].text + strFirstName = xmlAuthorRows[2].text + strCompleteName = strFirstName + " " + strLastName + # Remaining Authors are to be Firstname Lastname + for i in range(0, (intNumberOfAuthors - 1)): + a = i + 4 + strLastName = "" + strFirstName = "" + if len(xmlAuthorRows) > a: + strLastName = xmlAuthorRows[a].text + a = i + 6 + if len(xmlAuthorRows) > a: + strFirstName = xmlAuthorRows[a].text + strCompleteName = strCompleteName + ", " + strFirstName + " " + strLastName + return self.sanitize(strCompleteName) + + def shortauthor(self): + xmlEntry = self.xmlEntry + # If no Name is given, return either the Shorthand or the Title (Shorthand prefererred) + if xmlEntry.find(".//labelname/number") == None: + if xmlEntry.find(".//shorthand") is not None: + strComplete = xmlEntry.find(".//shorthand").text + return strComplete + else: + #strComplete = xmlEntry.find(".//title").text + strComplete = self.title() + return strComplete + intNumberOfAuthors = int(xmlEntry.find(".//labelname/number").text) + if intNumberOfAuthors == 1: + xmlAuthorRows = xmlEntry.findall(".//labelname/mrow/mrow") + strLastName = xmlAuthorRows[0].text + return self.sanitize(strLastName) + if intNumberOfAuthors == 2: + xmlAuthorRows = xmlEntry.findall(".//labelname/mrow/mrow/mrow") + strLastName1 = xmlAuthorRows[0].text + if len(xmlAuthorRows) > 5: + strLastName2 = xmlAuthorRows[4].text + else: + strLastName2 = "" + strCompleteName = strLastName1 + " and " + strLastName2 + return self.sanitize(strCompleteName) + if intNumberOfAuthors > 2: + xmlAuthorRows = xmlEntry.findall(".//labelname/mrow/mrow/mrow") + strLastName1 = xmlAuthorRows[0].text + strCompleteName = strLastName1 + " et.al." + return self.sanitize(strCompleteName) + + def editor(self): + xmlEntry = self.xmlEntry + # If no Name is given, return either the Shorthand or the Title (Shorthand prefererred) + if xmlEntry.find(".//editor/number") is None: + return "" + intNumberOfEditors = int(xmlEntry.find(".//editor/number").text) + if intNumberOfEditors == 1: + xmlEditorRows = xmlEntry.findall(".//editor/mrow/mrow") + strLastName = xmlEditorRows[0].text + if len(xmlEditorRows) > 3: + strFirstName = xmlEditorRows[2].text + strCompleteName = "Ed. by " + strFirstName + " " + strLastName + "." + return self.sanitize(strCompleteName) + else: + return self.sanitize(strLastName) + if intNumberOfEditors > 1: + xmlEditorRows = xmlEntry.findall(".//editor/mrow/mrow/mrow") + strLastName = xmlEditorRows[0].text + strFirstName = xmlEditorRows[2].text + strCompleteName = "Ed. by " + strFirstName + " " + strLastName + for i in range(0, (intNumberOfEditors - 1)): + a = i + 4 + strLastName = "" + strFirstName = "" + if len(xmlEditorRows) > a: + strLastName = xmlEditorRows[a].text + a = i + 6 + if len(xmlEditorRows) > a: + strFirstName = xmlEditorRows[a].text + strCompleteName = strCompleteName + ", " + strFirstName + " " + strLastName + strCompleteName = strCompleteName + "." + return self.sanitize(strCompleteName) + \ No newline at end of file diff --git a/Skripten/EOAconvert.py b/Skripten/EOAconvert.py new file mode 100755 index 0000000..422d2cc --- /dev/null +++ b/Skripten/EOAconvert.py @@ -0,0 +1,3358 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8; mode: python -*- +# Time-stamp: <2016-02-03 17:23:51 (kthoden)> + +# CHANGES +# installed graphicsmagick: "brew install graphicsmagick" +# tralics needs to be set up +# +# +# some errors: +# [kthoden:~/EOAKram/Supersample/CONVERT] % ~/EOAKram/Probe/MPDL/Skripten/epub_test.sh EOASample.epub +# Epubcheck Version 1.0.5 + +# ERROR: EOASample.epub/OEBPS/chapter4.xhtml(65): unknown element "EOAindexlocation" from namespace "http://www.w3.org/1999/xhtml" +# ERROR: EOASample.epub/OEBPS/chapter5.xhtml(14): unknown element "EOAindexlocation" from namespace "http://www.w3.org/1999/xhtml" +# ERROR: EOASample.epub/OEBPS/chapter7.xhtml(17): unknown element "formula" from namespace "http://www.w3.org/1999/xhtml" +# ERROR: EOASample.epub/OEBPS/chapter7.xhtml(17): elements from namespace "http://www.w3.org/1998/Math/MathML" are not allowed +# ERROR: EOASample.epub/OEBPS/chapter8.xhtml(13): unknown element "EOAtocentry" from namespace "http://www.w3.org/1999/xhtml" +# ERROR: EOASample.epub/OEBPS/chapter11.xhtml(9): unknown element "EOAtocentry" from namespace "http://www.w3.org/1999/xhtml" +# ERROR: EOASample.epub/OEBPS/chapter11.xhtml(10): unknown element "EOAtocentry" from namespace "http://www.w3.org/1999/xhtml" +# ERROR: EOASample.epub/OEBPS/chapter11.xhtml(10): unknown element "EOAprintlocationindex" from namespace "http://www.w3.org/1999/xhtml" + +# license? +# +# Also add EOAparagraph + +from optparse import OptionParser +from lxml import etree +from lxml import objectify +from copy import deepcopy +from copy import copy +from EOAbibitem import Bibitem +import glob +import os +import re +import string +import shlex +import subprocess +import sys +import shutil +import time +import configparser + +# TODO 2: Einfache URL bei einer Webseite noch fixen, siehe Manzer-Kapitel [1] in Proceedings 2, genauer: webpage noch als Typ einfügen + +# 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/" +# curl als gegeben voraussetzen? + +interimResult = "" + +############################################################### +# Certain functions for specific tasks +############################################################### + +# Maintain text and strip subchildren +def gettext(xmlElement): + xmlText = xmlElement.text or "" + for xmlChild in xmlElement: + xmlText += gettext(xmlChild) + if xmlChild.tail: + xmlText += xmlChild.tail + return xmlText + +# include all subelements +def getchildren(xmlElement): + 1 + 1 + return xmlElement + +# Adjust and convert image for epub standard +def sanitizeImageEpub(strImagepath): + print (strImagepath) + strCommand = GM_PATH + " identify -format \"%w\" " + strImagepath + listArguments = shlex.split(strCommand) + exeShell = subprocess.check_output(listArguments, shell=False, universal_newlines=True) + intImageWidth = int(exeShell) + if intImageWidth > 1500: + strCommand = GM_PATH + " convert " + strImagepath + " -resize 1500x\\> " + strImagepath + listArguments = shlex.split(strCommand) + subprocess.check_output(listArguments, shell=False) + strCommand = GM_PATH + " identify -format \"%h\" " + strImagepath + listArguments = shlex.split(strCommand) + exeShell = subprocess.check_output(listArguments, shell=False, universal_newlines=True) + intImageHeight = int(exeShell) + if intImageHeight > 2000: + strCommand = GM_PATH + " convert " + strImagepath + " -resize x2000\\> " + strImagepath + listArguments = shlex.split(strCommand) + subprocess.check_output(listArguments, shell=False) + strCommand = GM_PATH + " identify -format \"%m\" " + strImagepath + listArguments = shlex.split(strCommand) + exeShell = subprocess.check_output(listArguments, shell=False, universal_newlines=True) + strFileFormat = str(exeShell) + strFileFormat = strFileFormat.strip() + if strFileFormat == "PNG": + strNewImagepath = os.path.splitext(strImagepath)[0] + strCommand = GM_PATH + " convert " + strImagepath + " " + strNewImagepath + ".jpg" + listArguments = shlex.split(strCommand) + subprocess.call(listArguments) + os.remove(strImagepath) + strImagepath = strNewImagepath + ".jpg" + print ("Hier ein Pfad zu einem Bild:") + print (strImagepath) + return strImagepath + +# Function to render LaTeX-Code into PNG-Files, returns PNG-Filename (epub & django) +def TeX2PNG(LaTeXCode, Type, Chapter, Number): + # Dictionary contains Type:begin/end + Types = { + "EOAineq" : ["$", "$"], + "EOAequation" : ["\\begin{equation*}", "\\end{equation*}"], + "EOAequationnonumber" : ["\\begin{equation*}", "\\end{equation*}"], + "EOAequationarray" : ["\\begin{align*}", "\\end{align*}"], + "EOAequationarraynonumber" : ["\\begin{align*}", "\\end{align*}"] + } + LaTeXCode = Types[Type][0] + LaTeXCode + Types[Type][1] + dictRebindedCommands = { + "\|ket\|" : r"\\ket", + "\|braket\|" : r"\\braket", + "\|bra\|" : r"\\bra", + "\|Bra\|" : r"\\Bra", + "\|Ket\|" : r"\\Ket", + "\slashed\|" : r"\\slashed" + } + for strCommand in dictRebindedCommands.keys(): + #LaTeXCode = re.sub(strCommand, dictRebindedCommands[strCommand], LaTeXCode) + LaTeXCode = re.sub(strCommand, dictRebindedCommands[strCommand], LaTeXCode) + #print (LaTeXCode) + #return LaTeXCode + # Open plain LaTeX-Template + tmp = open(SUPPORT_TEMPLATE_PATH + "Templates/Formel.tex", "r") + Template = tmp.read() + tmp.close() + # Get tmp-directory for this user account + tmpDir = os.getenv("TMPDIR") + # Make directory items if it doesn't already exist + if os.path.exists(os.getcwd() + "/items") == False: + os.mkdir(os.getcwd() + "/items") + s = string.Template(Template) + e = s.substitute(DERINHALT=LaTeXCode) + tmpFile = tmpDir + Type + "_" + str(Chapter) + "_" + str(Number) + ".tex" + tmp = open(tmpFile, "w") + tmp.write(e) + tmp.close() + Kommando = "/usr/texbin/xelatex --halt-on-error " + tmpFile + Argumente = shlex.split(Kommando) + # Redirecting stderr to save XeLaTeX-Output + Datei = open('Test.txt', 'w') + Ergebnis = subprocess.call(Argumente,cwd=tmpDir,stdout=Datei) + if Ergebnis == 0: + print ("Konvertierung folgender Formel ist erfolgreich: " + Type + str(Chapter) + "_" + str(Number)) + if Ergebnis == 1: + print ("Konvertierung folgender Formel ist fehlgeschlagen: " + Type + str(Chapter) + "_" + str(Number)) + Kommando = TL_PATH + "texmf-dist/scripts/pdfcrop/pdfcrop.pl " + tmpDir + Type + "_" + str(Chapter) + "_" + str(Number) + ".pdf " + tmpDir + Type + "_" + str(Chapter) + "_" + str(Number) + "a.pdf" + Argumente = shlex.split(Kommando) + subprocess.call(Argumente,cwd=tmpDir,stdout=Datei) + Kommando = GM_PATH + " convert -density 144 " + tmpDir + Type + "_" + str(Chapter) + "_" + str(Number) + "a.pdf " + os.getenv("PWD") + "/items/" + Type + "_" + str(Chapter) + "_" + str(Number) + ".png" + Argumente = shlex.split(Kommando) + subprocess.call(Argumente,cwd=tmpDir,stdout=Datei) + return LaTeXCode + +# Function to create a complete Entry of a publication (epub & django) for author-year citation +def createBibEntryAuthorYear(bibEntry, boolSameAuthor): + strBibEntry = "" + if boolSameAuthor == False: + strAuthor = bibEntry.fullauthorlastfirst() + if boolSameAuthor == True: + strAuthor = "-" + if bibEntry.entrytype() == "book": + strBibEntry = strAuthor + " (" + str(bibEntry.labelyear()) + str(bibEntry.labelyearsuffix()) + "). " + str(bibEntry.title()) + "." + str(bibEntry.location()) + "." + if bibEntry.entrytype() == "booklet": + strBibEntry = strAuthor + " (" + str(bibEntry.labelyear()) + str(bibEntry.labelyearsuffix()) + "). " + str(bibEntry.title()) + "." + str(bibEntry.location()) + "." + if bibEntry.entrytype() == "report": + strBibEntry = strAuthor + " (" + bibEntry.labelyear() + bibEntry.labelyearsuffix() + ") " + bibEntry.title() + "." + if bibEntry.entrytype() == "thesis": + strBibEntry = strAuthor + " (" + bibEntry.labelyear() + bibEntry.labelyearsuffix() + ") " + bibEntry.title() + "." + bibEntry.thesistype() + bibEntry.institution() + if bibEntry.entrytype() == "misc": + strBibEntry = strAuthor + " (" + str(bibEntry.labelyear()) + str(bibEntry.labelyearsuffix()) + ") " + str(bibEntry.title()) + "." + if bibEntry.entrytype() == "incollection": + strBibEntry = strAuthor + " (" + bibEntry.labelyear() + bibEntry.labelyearsuffix() + "). " + bibEntry.title() + "." + bibEntry.booktitle() + bibEntry.editor() + bibEntry.series() + bibEntry.location() + bibEntry.pages() + if bibEntry.entrytype() == "inproceedings": + strBibEntry = strAuthor + " (" + bibEntry.labelyear() + bibEntry.labelyearsuffix() + "). " + bibEntry.title() + "." + bibEntry.booktitle() + bibEntry.editor() + bibEntry.series() + bibEntry.location() + bibEntry.pages() + if bibEntry.entrytype() == "article": + strBibEntry = strAuthor + " (" + str(bibEntry.labelyear()) + str(bibEntry.labelyearsuffix()) + "). " + str(bibEntry.title()) + "." + str(bibEntry.journaltitle()) + bibEntry.volumenumberpages() + if bibEntry.entrytype() == "newspaper": + strBibEntry = strAuthor + " (" + bibEntry.labelyear() + bibEntry.labelyearsuffix() + ") " + bibEntry.title() + "." + return strBibEntry + +# Function to create a complete Entry of a publication (epub & django) for numeric citation +def createBibEntryNumeric(bibEntry): + strBibEntry = "" + strAuthor = bibEntry.fullauthorfirstlast() + if bibEntry.entrytype() == "book": + strBibEntry = strAuthor + ". " + bibEntry.title() + "." + bibEntry.location() + ", " + bibEntry.year() + if bibEntry.entrytype() == "booklet": + strBibEntry = strAuthor + ". " + bibEntry.title() + ". " + bibEntry.howpublished() + ". " + bibEntry.location() + ", " + bibEntry.year() + if bibEntry.entrytype() == "report": + strBibEntry = strAuthor + " (" + bibEntry.labelyear() + bibEntry.labelyearsuffix() + ") " + bibEntry.title() + "." + if bibEntry.entrytype() == "thesis": + strBibEntry = strAuthor + ". " + bibEntry.title() + ". " + bibEntry.thesistype() + bibEntry.institution() + ", " + bibEntry.year() + if bibEntry.entrytype() == "misc": + strBibEntry = strAuthor + ". " + bibEntry.title() + ". " + bibEntry.booktitle() + ". " + if bibEntry.entrytype() == "incollection": + strBibEntry = strAuthor + ". " + bibEntry.title() + ". " + bibEntry.booktitle() + bibEntry.editor() + bibEntry.location() + ", " + bibEntry.year() + ". " + bibEntry.pages() + "." + if bibEntry.entrytype() == "inproceedings": + strBibEntry = strAuthor + ". " + bibEntry.title() + ". " + bibEntry.booktitle() + ". " + bibEntry.volumenumeric() + bibEntry.year() + ". " + bibEntry.pages() + "." + if bibEntry.entrytype() == "article": + strBibEntry = strAuthor + ". " + bibEntry.title() + "" + bibEntry.journaltitle() + " " + bibEntry.volumenumberpages() + " (" + bibEntry.year() + "):" + bibEntry.pages() + "." + if bibEntry.entrytype() == "newspaper": + strBibEntry = strAuthor + " (" + bibEntry.labelyear() + bibEntry.labelyearsuffix() + ") " + bibEntry.title() + "." + return strBibEntry + + +# Function to add Elements to Content-OPF (epub) +def addToContentopf(contentopf, Filename, FileID, Mediatype): + global listContentopf + # Sanitizing FileID, id-attribute may not contain _ : or / + # FileID may also not start with a number + FileID = re.sub("\_", "", FileID) + FileID = re.sub("\.", "", FileID) + FileID = re.sub("\/", "", FileID) + FileID = re.sub("^[0-9]", "", FileID) + FileID = re.sub("^[0-9]", "", FileID) + FileID = re.sub("^[0-9]", "", FileID) + if FileID in listContentopf: + return contentopf + else: + # Sanitizing FileID, id-attribute may not contain _ : or / + # FileID may also not start with a number + FileID = re.sub("\_", "", FileID) + FileID = re.sub("\.", "", FileID) + FileID = re.sub("\/", "", FileID) + FileID = re.sub("^[0-9]", "", FileID) + FileID = re.sub("^[0-9]", "", FileID) + FileID = re.sub("^[0-9]", "", FileID) + dictMediatypes = { + "xml" : "application/xhtml+xml", + "jpg" : "image/jpeg", + "png" : "image/png" + } + contentopfns = "{http://www.idpf.org/2007/opf}" + xmlManifest = contentopf.find(".//" + contentopfns + "manifest") + xmlItem = etree.Element("item") + xmlItem.set("id", FileID) + xmlItem.set("media-type", dictMediatypes[Mediatype]) + xmlItem.set("href", Filename) + xmlManifest.append(xmlItem) + # if it's a XML-File also extent + if Mediatype == "xml": + xmlSpine = contentopf.find(".//" + contentopfns + "spine") + xmlItemref = etree.Element("itemref") + xmlItemref.set("idref", FileID) + xmlSpine.append(xmlItemref) + listContentopf.append(FileID) + return contentopf + +# Function to add Chapters to Table of Contents (epub) +def addToTocncx(tocncx, Label, intTechnicalChapterNumber): + tocncxns = "{http://www.daisy.org/z3986/2005/ncx/}" + xmlNavMap = tocncx.find(".//" + tocncxns + "navMap") + xmlNavPoint = etree.Element("navPoint") + xmlNavPoint.set("playOrder", str(intTechnicalChapterNumber + 1)) + xmlNavPoint.set("id", "chapter" + str(intTechnicalChapterNumber)) + xmlNavLabel = etree.Element("navLabel") + xmlNavLabelText = etree.Element("text") + xmlNavLabelText.text = Label + xmlNavLabel.append(xmlNavLabelText) + xmlNavPoint.append(xmlNavLabel) + xmlContent = etree.Element("content") + xmlContent.set("src", "chapter" + str(intTechnicalChapterNumber) + ".xhtml") + xmlNavPoint.append(xmlContent) + xmlNavMap.append(xmlNavPoint) + return tocncx + +# Remove Support Files +def cleanup(): + try: + os.remove((os.getcwd() + "/classes.dtd")) + os.remove((os.getcwd() + "/mathml2-qname-1.mod")) + os.remove((os.getcwd() + "/mathml2.dtd")) + shutil.rmtree((os.getcwd() + "/html")) + shutil.rmtree((os.getcwd() + "/iso8879")) + shutil.rmtree((os.getcwd() + "/iso9573-13")) + shutil.rmtree((os.getcwd() + "/mathml")) + shutil.rmtree((os.getcwd() + "/mathml2")) + except: + print ("Keine Temporaeren Dateien") + +############################################################### +# Preperation of certain files and some checks in advance +############################################################### + +# Setup of various dictionaries for localization of various elements +dictLangFootnotes = {"english" : "Footnotes", "italian" : "Note a piè pagina", "french" : "notes en bas de page", "german" : "Fußnoten"} + +# Options for the command line: filename / configfile +parser = OptionParser() +parser.add_option("-f", "--file", dest="filename", + help="Name of XML-File", metavar="FILE") +parser.add_option("-c", "--config", dest="configfile", + help="Name of Configuration-File", metavar="CONFIGURATION") +parser.add_option("-t", "--trash", dest="helpfiles", + help="Trash temporary files") + +(options, args) = parser.parse_args() + +# Check for folder and necessary files +if os.path.exists(os.getcwd() + "/CONVERT") == False: + print ("Das notwendige Verzeichnis CONVERT wurde noch nicht erstellt.") + sys.exit() +if os.path.exists(os.getcwd() + "/CONVERT/cover.jpg") == False: + print ("Die Datei cover.jpg im Verzeichnis CONVERT fehlt.") + sys.exit() +if os.path.exists(os.getcwd() + "/CONVERT/publication.cfg") == False: + print ("Die Datei publication.cfg im Verzeichnis CONVERT fehlt.") + sys.exit() + +# Remove temporary files, neccessary for troubleshooting +if options.helpfiles == "temp": + cleanup() + sys.exit() + +# Copy Support-Files from /Library/MPIWG to current directory +shutil.copy(SUPPORT_TEMPLATE_PATH + "Support/classes.dtd", os.getcwd()) +shutil.copy(SUPPORT_TEMPLATE_PATH + "Support/mathml2-qname-1.mod", os.getcwd()) +shutil.copy(SUPPORT_TEMPLATE_PATH + "Support/mathml2.dtd", os.getcwd()) +shutil.copytree(SUPPORT_TEMPLATE_PATH + "Support/html", (os.getcwd() + "/html")) +shutil.copytree(SUPPORT_TEMPLATE_PATH + "Support/iso8879", (os.getcwd() + "/iso8879")) +shutil.copytree(SUPPORT_TEMPLATE_PATH + "Support/iso9573-13", (os.getcwd() + "/iso9573-13")) +shutil.copytree(SUPPORT_TEMPLATE_PATH + "Support/mathml", (os.getcwd() + "/mathml")) +shutil.copytree(SUPPORT_TEMPLATE_PATH + "Support/mathml2", (os.getcwd() + "/mathml2")) + +############################################################## +# Preparing the main document # +############################################################## + +""" +Der Aufruf von tralics lautet: +/Library/MPIWG/Skripten/tralics -confdir /Library/MPIWG/tralics/tralics_conf -config /Library/MPIWG/tralics/tralics.tcf -utf8 -utf8output Vorlage2012.tex +""" + +# Convert TeX to XML via Tralics +#Kommando = "/Library/MPIWG/Skripten/tralics -confdir /Library/MPIWG/tralics/tralics_conf -config /Library/MPIWG/tralics/tralics.tcf -utf8 -utf8output " + options.filename + ".tex" +Kommando = "%s -confdir %s/tralics_conf -config %s/tralics.tcf -utf8 -utf8output %s.tex" % (TRALICS_PATH_EXEC, TRALICS_PATH_LIB, TRALICS_PATH_LIB, options.filename) +Argumente = shlex.split(Kommando) +Prozess = subprocess.call(Argumente) + +# Fix underscore und fix EOAtranscripted +tmpFile = open ((options.filename) + ".xml", "r") +tmpText = tmpFile.read() +tmpFile.close() + +tmpText = re.sub(r"", "_", tmpText) +tmpText = re.sub(r"", "", tmpText) +tmpFile = open ((options.filename) + ".xml", "w") +tmpFile.write(tmpText) +tmpFile.close() + +# Complete XML-Document in xmlTree +xmlParser = etree.XMLParser(no_network=False,load_dtd=True) #resolve_entities=False +xmlTree = etree.parse((options.filename + ".xml"), xmlParser) +xmlChapters = xmlTree.findall("//div1") + +# Cleanup of not needed tags in advance. To be cleaned: +etree.strip_elements(xmlTree, with_tail=False, *['error']) + +print ("-----------------------------------------------------") +print ("Move EOAlanguage from into attribute of EOAchapter") +for xmlChapter in xmlChapters: + xmlLanguage = xmlChapter.find(".//EOAlanguage") + if xmlLanguage is not None: + strLanguage = xmlLanguage.text or "english" + xmlChapter.set("language", strLanguage) + xmlLanguage.text = None + print (strLanguage) + xmlChapter = etree.strip_tags(xmlChapter, "EOAlanguage") + +############################################################## +# Numbering and Typesetting various Elements # +############################################################## + +# Figure out how to number (like essay or regular) +strSerie = xmlTree.find(".//EOAseries").text or "regular" +if strSerie == "Essay": + strNumberingType = "essay" +else: + strNumberingType = "regular" + +# Dictionaries containing UIDs and Numbers +dictChapters = {} +dictFigures = {} +dictEquations = {} +dictSections = {} +dictFootnotes = {} +dictPagelabels = {} +dictTables = {} +dictLists = {} +dictTheorems = {} + +print ("-----------------------------------------------------") +print ("Numbering Chapters") +Chapternumber = 1 +for xmlChapter in xmlChapters: + if xmlChapter.get('rend') != "nonumber": + Chapteruid = xmlChapter.get('id') + dictChapters[Chapteruid] = str(Chapternumber) + Chapternumber += 1 + +# EOAequation, EOAsubequation and EOAequationarray Numbering per Chapter +intChapterNumber = 1 +for xmlChapter in xmlChapters: + intEquationnumber = 1 + xmlDinge = xmlChapter.xpath(".//EOAequation | .//EOAequationarray | .//EOAsubequations") + print ("-----------------------------------------------------") + print ("Processing .//EOAequation | .//EOAequationarray | .//EOAsubequations") + print ("Working on Chapter " + str(intChapterNumber)) + print ("Es wurden " + str(len(xmlDinge)) + " Formeln gefunden") + for xmlDing in xmlDinge: + if xmlDing.tag == "EOAequationarray": + # tmpNumberinArray is only being used for filename + tmpNumberinArray = intEquationnumber + # tmpDictNumberLabel used to insert the attribute value into + tmpDictNumberLabel = {} + # Numbering is being done by -Tags + xmlMathmlrows = xmlDing.findall(".//{http://www.w3.org/1998/Math/MathML}mtr") + for xmlMathmlrow in xmlMathmlrows: + if "Label" in xmlMathmlrow.attrib: + # Label dem Dictionary für die Euqations hinzufügen + if xmlChapter.get("rend") != "nonumber": + dictEquations[xmlMathmlrow.get("Label")] = str(dictChapters[xmlChapter.get('id')]) + "." + str(intEquationnumber) + tmpDictNumberLabel[str(dictChapters[xmlChapter.get('id')]) + "." + str(intEquationnumber)] = xmlMathmlrow.get("Label") + if xmlChapter.get("rend") == "nonumber": + dictEquations[xmlMathmlrow.get("Label")] = str(intEquationnumber) + tmpDictNumberLabel[str(intEquationnumber)] = xmlMathmlrow.get("Label") + intEquationnumber += 1 + xmlRohTeX = xmlDing.find(".//texmath") + xmlNew = etree.Element('EOAequationarray') + # Blank lines need to be removed otherwise TeX won't work + textSourcecode = os.linesep.join([s for s in xmlRohTeX.text.splitlines() if s]) + # \rowattributeunknown has to be deleted, its an artefact + textSourcecode = re.sub("\\\\rowattributeunknown", "", textSourcecode) + # Push Down loop to parse the raw code + textFormel = "" + boolBackslash = False + for Buchstabe in textSourcecode: + if Buchstabe == "\n": + continue + if Buchstabe == "\\": + if boolBackslash == False: + textFormel += Buchstabe + boolBackslash = True + continue + if boolBackslash == True: + textFormel += Buchstabe + strLaTeXCode = TeX2PNG(textFormel, "EOAequationarray", str(intChapterNumber), str(tmpNumberinArray)) + if xmlChapter.get("rend") != "nonumber": + tmpXML = etree.Element("EOAequation", filename=("EOAequationarray" + "_" + str(intChapterNumber) + "_" + str(tmpNumberinArray) + ".png"), number=(str(dictChapters[xmlChapter.get('id')]) + "." + str(tmpNumberinArray))) + if xmlChapter.get("rend") == "nonumber": + tmpXML = etree.Element("EOAequation", filename=("EOAequationarray" + "_" + str(intChapterNumber) + "_" + str(tmpNumberinArray) + ".png"), number=(str(tmpNumberinArray))) + tmpXML.set("TeX", strLaTeXCode) + # Put Label into EOAequation + if xmlChapter.get("rend") != "nonumber": + strTempKey = str(dictChapters[xmlChapter.get('id')]) + "." + str(tmpNumberinArray) + if xmlChapter.get("rend") == "nonumber": + strTempKey = str(tmpNumberinArray) + if strTempKey in tmpDictNumberLabel: + #tmpXML.set("label", tmpDictNumberLabel[(str(dictChapters[xmlChapter.get('id')]) + "." + str(tmpNumberinArray))]) + tmpXML.set("label", tmpDictNumberLabel[strTempKey]) + xmlNew.append(tmpXML) + textFormel = "" + boolBackslash = False + tmpNumberinArray += 1 + continue + if Buchstabe != "\\": + textFormel += Buchstabe + boolBackslash = False + # Typeset last equation + strLaTeXCode = TeX2PNG(textFormel, "EOAequationarray", str(intChapterNumber), str(tmpNumberinArray)) + if xmlChapter.get("rend") != "nonumber": + tmpXML = etree.Element("EOAequation", filename=("EOAequationarray" + "_" + str(intChapterNumber) + "_" + str(tmpNumberinArray) + ".png"), number=(dictChapters[xmlChapter.get('id')] + "." + str(tmpNumberinArray))) + if xmlChapter.get("rend") == "nonumber": + tmpXML = etree.Element("EOAequation", filename=("EOAequationarray" + "_" + str(intChapterNumber) + "_" + str(tmpNumberinArray) + ".png"), number=(str(tmpNumberinArray))) + tmpXML.set("TeX", strLaTeXCode) + # Put Label into EOAequation + if xmlChapter.get("rend") != "nonumber": + strTempKey = str(dictChapters[xmlChapter.get('id')]) + "." + str(tmpNumberinArray) + if xmlChapter.get("rend") == "nonumber": + strTempKey = str(tmpNumberinArray) + if strTempKey in tmpDictNumberLabel: + print (strTempKey) + print (tmpDictNumberLabel) + print (dictChapters) + tmpXML.set("label", tmpDictNumberLabel[strTempKey]) + xmlNew.append(tmpXML) + xmlDing.getparent().replace(xmlDing, xmlNew) + # enclosing

-Tag of the Subequations is not wanted, transformed to to be deleted later on + #xmlNew.getparent().tag = "temp" + continue + if xmlDing.tag == "EOAsubequations": + # Enclosing

-Tag of the EOAsubequations needs to be removed + xmlDing.getparent().tag = "temp" + xmlSubequations = xmlDing.findall('.//EOAequation') + listCharacters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] + tmpI = 0 + # Insert Number of this Subequation into dictEquations + xmlAnchor = xmlDing.find(".//anchor") + print (xmlAnchor) + if xmlChapter.get("rend") != "nonumber": + dictEquations[xmlAnchor.get('id')] = dictChapters[xmlChapter.get('id')] + "." + str(intEquationnumber) + if xmlChapter.get("rend") == "nonumber": + dictEquations[xmlAnchor.get('id')] = str(intEquationnumber) + # Delete anchor + xmlAnchor.getparent().remove(xmlAnchor) + for xmlSubequation in xmlSubequations: + # Enclosing

-Tag of the EOAsubequation needs to be removed + #xmlSubequation.getparent().tag = "temp" + # Numbering Subequations with characters + strSubequationNumber = str(intEquationnumber) + listCharacters[tmpI] + tmpI += 1 + textSourcecode = xmlSubequation.find('.//texmath').text + # Blank lines need to be removed otherwise TeX won't work + textSourcecode = os.linesep.join([s for s in textSourcecode.splitlines() if s]) + strLaTeXCode = TeX2PNG(textSourcecode, "EOAequation", str(intChapterNumber), strSubequationNumber) + xmlAnchor = xmlSubequation.find(".//anchor") + # Clear Equation + xmlSubequation.clear() + if xmlChapter.get("rend") != "nonumber": + xmlSubequation.set("filename", "EOAequation" + "_" + str(intChapterNumber) + "_" + strSubequationNumber + ".png") + xmlSubequation.set("number", dictChapters[xmlChapter.get('id')] + "." + strSubequationNumber) + xmlSubequation.set("uid", xmlAnchor.get('id')) + if xmlChapter.get("rend") == "nonumber": + xmlSubequation.set("filename", "EOAequation" + "_" + str(intChapterNumber) + "_" + strSubequationNumber + ".png") + xmlSubequation.set("number", strSubequationNumber) + xmlSubequation.set("uid", xmlAnchor.get('id')) + xmlSubequation.set("id", xmlAnchor.get('id')) + xmlSubequation.set("TeX", strLaTeXCode) + # Insert Number of this Equation into dictEquations + if strNumberingType == "regular": + dictEquations[xmlAnchor.get('id')] = str(dictChapters[xmlChapter.get('id')]) + "." + strSubequationNumber + if strNumberingType == "essay": + dictEquations[xmlAnchor.get('id')] = strSubequationNumber + # TODO: Anchor direkt unter Subequation aufheben, und der ersten Equation zuordnen, so dass auf 8.16 bei 8.16a und 8.16b verlinkt werden kann + xmlDing.tag = "temp" + # enclosing

-Tag of the Subequations is not wanted, transformed to to be deleted later on + #xmlDing.getparent().tag = "temp" + intEquationnumber += 1 + continue + if xmlDing.tag == "EOAequation": + # Check, if Equation has already been found in a Subeqation + xmlAnchor = xmlDing.find("anchor") + if xmlAnchor == None: + continue + if xmlAnchor.get('id') in dictEquations: + continue + if xmlDing.find('.//texmath') is not None: + textSourcecode = xmlDing.find('.//texmath').text + else: + textSourcecode = xmlDing.text + # Blank lines need to be removed otherwise TeX won't work + textSourcecode = os.linesep.join([s for s in textSourcecode.splitlines() if s]) + strLaTeXCode = TeX2PNG(textSourcecode, "EOAequation", intChapterNumber, intEquationnumber) + #print ("Got:") + #print (strLaTeXCode) + if xmlChapter.get("rend") != "nonumber": + xmlDing.set("filename", "EOAequation" + "_" + str(intChapterNumber) + "_" + str(intEquationnumber) + ".png") + xmlDing.set("number", dictChapters[xmlChapter.get('id')] + "." + str(intEquationnumber)) + xmlDing.set("uid", xmlAnchor.get('id')) + if xmlChapter.get("rend") == "nonumber": + xmlDing.set("filename", "EOAequation" + "_" + str(intChapterNumber) + "_" + str(intEquationnumber) + ".png") + xmlDing.set("number", str(intEquationnumber)) + xmlDing.set("uid", xmlAnchor.get('id')) + xmlDing.set("id", xmlAnchor.get('id')) + xmlDing.set("TeX", strLaTeXCode) + #xmlDing.getparent().replace(xmlDing, xmlNew) + # Insert Number of this Equation into dictEquations + if strNumberingType == "regular": + dictEquations[xmlAnchor.get('id')] = \ + str(dictChapters[xmlChapter.get('id')]) + "." + str(intEquationnumber) + if strNumberingType == "essay": + dictEquations[xmlAnchor.get('id')] = str(intEquationnumber) + intEquationnumber += 1 + continue + intChapterNumber += 1 + +intChapterNumber = 1 +for xmlChapter in xmlChapters: + tempImagenumber = 1 + xmlDinge = xmlChapter.xpath(".//EOAequationnonumber | .//EOAequationarraynonumber") + print ("-----------------------------------------------------") + print ("Processing .//EOAequationnonumber | .//EOAequationarraynonumber") + print ("Working on Chapter " + str(intChapterNumber)) + print ("Es wurden " + str(len(xmlDinge)) + " Formeln gefunden") + for xmlDing in xmlDinge: + if xmlDing.tag == "EOAequationarraynonumber": + if xmlDing.find(".//texmath") is not None: + textSourcecode = xmlDing.find(".//texmath").text + else: + textSourcecode = xmlDing.text + xmlNew = etree.Element('EOAequationarraynonumber') + # Blank lines need to be removed otherwise TeX won't work + textSourcecode = os.linesep.join([s for s in textSourcecode.splitlines() if s]) + # \rowattributeunknown has to be deleted, its an artefact + textSourcecode = re.sub("\\\\rowattributeunknown", "", textSourcecode) + # TODO: HIer überprüfen, ob und inwiefern es ausreichend ist, EOAequationarraynonumber in eine Grafik zu packen + strLateXCode = TeX2PNG(textSourcecode, "EOAequationarraynonumber", str(intChapterNumber), str(tempImagenumber)) + xmlNew = etree.Element("EOAequationnonumber", filename=("EOAequationarraynonumber" + "_" + str(intChapterNumber) + "_" + str(tempImagenumber) + ".png")) + xmlNew.set("TeX", strLaTeXCode) + xmlDing.getparent().replace(xmlDing, xmlNew) + tempImagenumber += 1 + continue + # Push Down loop to parse the raw code (Wird vorerst nicht ausgeführt) + textFormel = "" + boolBackslash = False + for Buchstabe in textSourcecode: + if Buchstabe == "\n": + continue + if Buchstabe == "\\": + if boolBackslash == False: + textFormel += Buchstabe + boolBackslash = True + continue + if boolBackslash == True: + textFormel += Buchstabe + strLaTeXCode = TeX2PNG(textFormel, "EOAequationarraynonumber", str(intChapterNumber), str(tempImagenumber)) + tmpXML = etree.Element("EOAequationnonumber", filename=("EOAequationarraynonumber" + "_" + str(intChapterNumber) + "_" + str(tempImagenumber) + ".png")) + tmpXML.set("TeX", strLaTeXCode) + xmlNew.append(tmpXML) + textFormel = "" + boolBackslash = False + tempImagenumber += 1 + continue + if Buchstabe != "\\": + textFormel += Buchstabe + boolBackslash = False + # Typeset last equation + strLaTeXCode = TeX2PNG(textFormel, "EOAequationarraynonumber", str(intChapterNumber), str(tempImagenumber)) + tmpXML = etree.Element("EOAequationnonumber", filename=("EOAequationarraynonumber" + "_" + str(intChapterNumber) + "_" + str(tempImagenumber) + ".png")) + tmpXML.set("TeX", strLaTeXCode) + xmlNew.append(tmpXML) + xmlDing.getparent().replace(xmlDing, xmlNew) + continue + if xmlDing.tag == "EOAequationnonumber": + textSourcecode = xmlDing.find('.//texmath').text + # Blank lines need to be removed otherwise TeX won't work + textSourcecode = os.linesep.join([s for s in textSourcecode.splitlines() if s]) + strLaTeXCode = TeX2PNG(textSourcecode, "EOAequationnonumber", str(intChapterNumber), tempImagenumber) + # TODO: HTML-Code für das fertige Bild einfügen (Ist dieser ToDo noch aktuell?) + xmlNew = etree.Element("EOAequationnonumber", filename=("EOAequationnonumber" + "_" + str(intChapterNumber) + "_" + str(tempImagenumber) + ".png")) + xmlNew.set("TeX", strLaTeXCode) + xmlDing.getparent().replace(xmlDing, xmlNew) + tempImagenumber += 1 + continue + intChapterNumber += 1 + +print ("-----------------------------------------------------") +print ("New Function to convert EOAineq") +intChapterNumber = 1 +intEOAineqRunningOrder = 1 +dictEOAineqs = {} +strTeXEquations = "" +for xmlChapter in xmlChapters: + print ("Chapter " + str(intChapterNumber)) + xmlEOAineqs = xmlChapter.findall(".//EOAineq") + intEOAineqnumber = 1 + for xmlEOAineq in xmlEOAineqs: + if xmlEOAineq.find('.//texmath') is not None: + strSourceCode = xmlEOAineq.find('.//texmath').text + else: + strSourceCode = xmlEOAineq.text + strSourceCode = os.linesep.join([s for s in strSourceCode.splitlines() if s]) + strTeXEquations = strTeXEquations + "$" + strSourceCode + "$\n\\newpage\n" + # Add intEOAineqRunningOrder : Filename to dictionary + strFilename = "EOAineq_" + str(intChapterNumber) + "_" + str(intEOAineqnumber) + dictEOAineqs[intEOAineqRunningOrder] = strFilename + # Prepare XML + tmpTail = xmlEOAineq.tail + xmlEOAineq.clear() + xmlEOAineq.tail = tmpTail + xmlEOAineq.set("src", strFilename + ".png") + xmlEOAineq.set("TeX", strSourceCode) + # increment integers + intEOAineqRunningOrder += 1 + intEOAineqnumber +=1 + intChapterNumber += 1 + +dictRebindedCommands = { +"\|ket\|" : r"\\ket", +"\|braket\|" : r"\\braket", +"\|bra\|" : r"\\bra", +"\|Bra\|" : r"\\Bra", +"\|Ket\|" : r"\\Ket", +"\slashed\|" : r"\\slashed" +} +for strCommand in dictRebindedCommands.keys(): + strTeXEquations = re.sub(strCommand, dictRebindedCommands[strCommand], strTeXEquations) + +tmp = open(SUPPORT_TEMPLATE_PATH + "Templates/Formel.tex", "r") +Template = tmp.read() +tmp.close() +# Get tmp-directory for this user account +tmpDir = os.getenv("TMPDIR") +# Make directory items if it doesn't already exist +if os.path.exists(os.getcwd() + "/items") == False: + os.mkdir(os.getcwd() + "/items") +s = string.Template(Template) +e = s.substitute(DERINHALT=strTeXEquations) +tmpFile = tmpDir + "EOAinline.tex" +tmp = open(tmpFile, "w") +tmp.write(e) +tmp.close() +print ("Typesetting all Inline Equations") +Kommando = "/usr/texbin/xelatex --halt-on-error " + tmpFile +Argumente = shlex.split(Kommando) +Datei = open('Test.txt', 'w') +Ergebnis = subprocess.call(Argumente,cwd=tmpDir,stdout=Datei) +print ("Splitting all Inline Equations") +Kommando = PDFTK_PATH + " EOAinline.pdf burst output EOAineq_%d.pdf" +Argumente = shlex.split(Kommando) +Ergebnis = subprocess.call(Argumente,cwd=tmpDir) +print ("Converting %s splitted pages into PNG-Images" % len(dictEOAineqs.keys())) +counter_dictEOAineqs = 1 +for intRunningOrder in dictEOAineqs.keys(): + # provide more status information here in output! + print("Image %s of %s" % (counter_dictEOAineqs, len(dictEOAineqs.keys()))) + Kommando = TL_PATH + "texmf-dist/scripts/pdfcrop/pdfcrop.pl " + tmpDir + "EOAineq_" + str(intRunningOrder) + ".pdf " + tmpDir + dictEOAineqs[intRunningOrder] + ".pdf" + Argumente = shlex.split(Kommando) + subprocess.call(Argumente,cwd=tmpDir,stdout=Datei) + Kommando = GM_PATH + " convert -density 144 " + tmpDir + dictEOAineqs[intRunningOrder] + ".pdf " + os.getenv("PWD") + "/items/" + dictEOAineqs[intRunningOrder] + ".png" + Argumente = shlex.split(Kommando) + subprocess.call(Argumente,cwd=tmpDir,stdout=Datei) + counter_dictEOAineqs += 1 + +print ("-----------------------------------------------------") +print ("EOAFigure Numbering per Chapter") +for xmlChapter in xmlChapters: + Figurenumber = 1 + xmlFigures = xmlChapter.xpath(".//EOAfigure | .//EOAlsfigure") + for xmlFigure in xmlFigures: + xmlAnchor = xmlFigure.find("anchor") + # Check if Figure is in a numbered Chapter + # Otherwise just put the Number of the figure + if xmlChapter.get('id'): + dictFigures[xmlAnchor.get('id')] = \ + str(dictChapters[xmlChapter.get('id')]) + "." + str(Figurenumber) + else: + dictFigures[xmlAnchor.get('id')] = str(Figurenumber) + xmlFigure.set("id", xmlAnchor.get("id")) + Figurenumber += 1 + +print ("-----------------------------------------------------") +print ("Numbering Theorems") +for xmlChapter in xmlChapters: + xmlTheorems = xmlChapter.findall(".//theorem") + for xmlTheorem in xmlTheorems: + strUID = xmlTheorem.get("id") + strNumber = xmlTheorem.get("id-text") + dictTheorems[strUID] = strNumber + +print ("-----------------------------------------------------") +print ("Section, Subsection,... Numbering per Chapter") +intChapterNumber = 1 +for xmlChapter in xmlChapters: + strUID = xmlChapter.get("id") + #dictChapters[strUID] = str(intChapterNumber) + xmlSections = xmlChapter.findall("div2") + intSectionNumber = 1 + for xmlSection in xmlSections: + if xmlSection.get("rend") == "nonumber": + continue + strUID = xmlSection.get("id") + if xmlChapter.get("rend") != "nonumber": + dictSections[strUID] = str(intChapterNumber) + "." + str(intSectionNumber) + if xmlChapter.get("rend") == "nonumber": + dictSections[strUID] = str(intSectionNumber) + xmlSubsections = xmlSection.findall("div3") + intSubsectionNumber = 1 + for xmlSubsection in xmlSubsections: + if xmlSubsection.get("rend") == "nonumber": + continue + strUID = xmlSubsection.get("id") + if xmlChapter.get("rend") != "nonumber": + dictSections[strUID] = str(intChapterNumber) + "." + str(intSectionNumber) + "." + str(intSubsectionNumber) + if xmlChapter.get("rend") == "nonumber": + dictSections[strUID] = str(intSectionNumber) + "." + str(intSubsectionNumber) + intSubsectionNumber += 1 + intSectionNumber += 1 + if xmlChapter.get("rend") != "nonumber": + intChapterNumber += 1 + +print ("-----------------------------------------------------") +print ("Numbering of Footnotes per Chapter") +intChapterNumber = 1 +for xmlChapter in xmlChapters: + intNoteNumber = 1 + xmlFootnotes = xmlChapter.findall(".//note") + for xmlFootnote in xmlFootnotes: + strUID = xmlFootnote.get("id") + dictFootnotes[strUID] = str(intNoteNumber) + intNoteNumber += 1 + +print ("-----------------------------------------------------") +print ("Numbering of Lists per Chapter") +for xmlChapter in xmlChapters: + xmlListitems = xmlChapter.findall(".//item") + for xmlListitem in xmlListitems: + strUID = xmlListitem.get("id") + strItemNumber = xmlListitem.get("id-text") + dictLists[strUID] = strItemNumber + +print ("-----------------------------------------------------") +print ("Working on Page Numbers for References") +listAuxFiles = glob.glob(os.getcwd() + "/*.aux") +for strFile in listAuxFiles: + tmpFile = open(strFile, "r") + lines = tmpFile.readlines() + tmpFile.close() + for line in lines: + matchObjectLabel = re.match(r'\\newlabel\{(.*?)\}', line) + if matchObjectLabel: + matchObjectPage = re.match(r'(.*?)\}\{(\d{1,})\}\}$', line) + if matchObjectPage: + dictPagelabels[matchObjectLabel.group(1)] = matchObjectPage.group(2) + +print ("-----------------------------------------------------") +print ("Numbering of Tables per Chapter") +intChapterNumber = 1 +for xmlChapter in xmlChapters: + intTableNumber = 1 + xmlTables = xmlChapter.findall(".//EOAtable") + for xmlTable in xmlTables: + xmlTableLabel = xmlTable.find(".//EOAtablelabel") + strTableCaption = xmlTable.find(".//EOAtablecaption").text + if strTableCaption == "nonumber": + continue + if not xmlTableLabel.text or xmlTableLabel.text == "": + xmlTableLabel.text = "table" + str(intChapterNumber) + str(intTableNumber) + strUID = xmlTableLabel.text + print (strUID) + if xmlChapter.get("rend") != "nonumber": + dictTables[strUID] = dictChapters[xmlChapter.get('id')] + "." + str(intTableNumber) + if xmlChapter.get("rend") == "nonumber": + dictTables[strUID] = str(intTableNumber) + intTableNumber += 1 + print (dictTables) + intChapterNumber += 1 + +############################################################## +# Preparing the Bibliography # +############################################################## + +# Copy interim .bbl-File to interim bib.tex file +shutil.copy((options.filename) + ".bbl", ((options.filename) + "bib.tex")) +# Read all lines of Bibliographic TeX +tmpFile = open (((options.filename) + "bib.tex"), "r") +tmpLines = tmpFile.readlines() +tmpFile.close() +# First line should link to Bibliographic Praeambel +tmpLines[0] = "\\include{/Library/MPIWG/TeX/pre_bib}\n" +# Remove unwanted lines +for i in range (18,0,-1): + del tmpLines[i] +# Save changes +tmpFile = open (((options.filename) + "bib.tex"), "w") +tmpFile.writelines(tmpLines) +tmpFile.close() +# TeX has been sanitized, now tralics to make it intermediate XML +Kommando = "%s -confdir %s/tralics_conf -config %s/tralics.tcf -utf8 -utf8output -entnames=false %sbib.tex" % (TRALICS_PATH_EXEC, TRALICS_PATH_LIB, TRALICS_PATH_LIB, options.filename) +Argumente = shlex.split(Kommando) +Prozess = subprocess.call(Argumente) +# Sanitaze XML to make it useable +tmpFile = open((options.filename) + "bib.xml", "r") +tmpContent = tmpFile.read() +tmpFile.close() +listReplace = [ r"", +r"", +r"", +r"", +r"", +r"", +r"", +r"", +r"", +r"", +r"", +r"", +r"", +r"", +r"", +r"", +r"", +r"", +r"uniquename=(.*?),hash=(.*?)", +r"hash=(.*?)", +] +for strReplace in listReplace: + tmpContent = re.sub(strReplace, "", tmpContent) + +# Put Back Underscore _ +tmpContent = re.sub(r"", "_", tmpContent) + +# Remove empty Lines +tmpContent = re.sub(r"\n\n", "\n", tmpContent) + +# Put back Ampersand +tmpContent = re.sub(r"&", "&", tmpContent) +tmpFile = open((options.filename) + "bib.xml", "w") +tmpFile.write(tmpContent) +tmpFile.close() + +# TeXML has been sanitized, now load xml-Tree +xmlParser2 = etree.XMLParser(no_network=False,load_dtd=False) +xmlBibTree = etree.parse((options.filename + "bib.xml"), xmlParser2) +xmlEntries = xmlBibTree.findall(".//entry") + +# If Bibliography-Type is monograph search for EOAbibliography and make it all +if xmlTree.find(".//EOAbibliographytype").text == "monograph": + if xmlTree.find(".//EOAprintbibliography") is not None: + xmlBibliography = xmlTree.find(".//EOAprintbibliography") + xmlBibliography.clear() + xmlBibliography.tag = "div" + xmlBibliography.getparent().tag = "div" + #xmlBibliography.addnext(xmlBibliographyDiv) + xmlEntries = xmlBibTree.findall(".//entry") + intNumberOfEntry = 0 + for xmlEntry in xmlEntries: + if intNumberOfEntry == 0: + # Don't check for previous author if first entry of the Bibliography + bibEntry = Bibitem(xmlEntry) + strNewentry = "

" + createBibEntryAuthorYear(bibEntry, boolSameAuthor=False) + "

" + xmlNew = etree.fromstring(strNewentry) + xmlBibliography.append(xmlNew) + else: + bibEntry = Bibitem(xmlEntry) + # Check if author of previous Entry is the same + bibEntryPrevious = Bibitem(xmlEntries[intNumberOfEntry - 1]) + if bibEntry.fullauthorlastfirst() == bibEntryPrevious.fullauthorlastfirst(): + strNewentry = "

" + createBibEntryAuthorYear(bibEntry, boolSameAuthor=True) + "

" + xmlNew = etree.fromstring(strNewentry) + xmlBibliography.append(xmlNew) + else: + strNewentry = "

" + createBibEntryAuthorYear(bibEntry, boolSameAuthor=False) + "

" + xmlNew = etree.fromstring(strNewentry) + xmlBibliography.append(xmlNew) + intNumberOfEntry += 1 + +# If Bibliography-Type is anthology search for EOAbibliography and make one per chapter +if xmlTree.find(".//EOAbibliographytype").text == "anthology": + intChapterNumber = 1 + for xmlChapter in xmlChapters: + if xmlChapter.find(".//EOAprintbibliography") is not None: + xmlBibliography = xmlChapter.find(".//EOAprintbibliography") + xmlBibliography.getparent().tag = "div" + xmlBibliographyDiv = etree.Element("div") + xmlBibliography.addnext(xmlBibliographyDiv) + xmlRefsections = xmlBibTree.findall(".//refsection") + for xmlRefsection in xmlRefsections: + if xmlRefsection.find(".//number").text == str(intChapterNumber): + break + xmlEntries = xmlRefsection.findall(".//entry") + intNumberOfEntry = 0 + for xmlEntry in xmlEntries: + if intNumberOfEntry == 0: + # Don't check for previous author if first entry of the Bibliography + bibEntry = Bibitem(xmlEntry) + strNewentry = "

" + createBibEntryAuthorYear(bibEntry, boolSameAuthor=False) + "

" + xmlNew = etree.fromstring(strNewentry) + xmlBibliographyDiv.append(xmlNew) + else: + bibEntry = Bibitem(xmlEntry) + # Check if author of previous Entry is the same + bibEntryPrevious = Bibitem(xmlEntries[intNumberOfEntry - 1]) + if bibEntry.fullauthorlastfirst() == bibEntryPrevious.fullauthorlastfirst(): + strNewentry = "

" + createBibEntryAuthorYear(bibEntry, boolSameAuthor=True) + "

" + xmlNew = etree.fromstring(strNewentry) + xmlBibliographyDiv.append(xmlNew) + else: + strNewentry = "

" + createBibEntryAuthorYear(bibEntry, boolSameAuthor=False) + "

" + print (strNewentry) + xmlNew = etree.fromstring(strNewentry) + xmlBibliographyDiv.append(xmlNew) + intNumberOfEntry += 1 + intChapterNumber += 1 + +# for the time being +strCitation = "" + +# Bibliographies are done, now for the citations +if xmlTree.find(".//EOAbibliographytype").text == "anthology" or xmlTree.find(".//EOAbibliographytype").text == "monograph": + intChapterNumber = 1 + for xmlChapter in xmlChapters: + print ("-----------------------------------------------------") + print ("Processing References for Chapter " + str(intChapterNumber)) + xmlCitations = xmlChapter.xpath(".//EOAciteauthoryear | .//EOAciteyear | .//EOAcitemanual") + for xmlCitation in xmlCitations: + print (xmlCitation.find("./citekey").text) + # If Bibliography-Type is anthology find Refsection for this Chapter + if xmlTree.find(".//EOAbibliographytype").text == "anthology": + xmlRefsections = xmlBibTree.findall(".//refsection") + for xmlRefsection in xmlRefsections: + if xmlRefsection.find(".//number").text == str(intChapterNumber): + break + xmlEntries = xmlRefsection.findall(".//entry") + # If Bibliography-Type is monograph find all entries, forget about refsection + if xmlTree.find(".//EOAbibliographytype").text == "monograph": + xmlEntries = xmlBibTree.findall(".//entry") + for xmlEntry in xmlEntries: + bibEntry = Bibitem(xmlEntry) + if bibEntry.citekey() == xmlCitation.find("./citekey").text: + if xmlCitation.tag == "EOAciteauthoryear": + strCitation = bibEntry.shortauthor() + " " + bibEntry.labelyear() + if bibEntry.labelyearsuffix() is not None: + strCitation = strCitation + bibEntry.labelyearsuffix() + strTitle = bibEntry.title() + if xmlCitation.tag == "EOAciteyear": + strCitation = bibEntry.labelyear() + if bibEntry.labelyearsuffix() is not None: + strCitation = strCitation + bibEntry.labelyearsuffix() + strTitle = bibEntry.title() + if xmlCitation.tag == "EOAcitemanual": + strCitation = xmlCitation.find("citetext").text + strTitle = bibEntry.title() + if xmlCitation.find("./page") is not None and xmlCitation.find("./page").text is not None: + strCitation = strCitation + ", " + xmlCitation.find("./page").text + # Hier den XML-Tag durch die Quellenangabe ersetzen + tmpTail = xmlCitation.tail + xmlCitation.clear() + xmlCitation.tag = "span" + xmlCitation.set("rel","popover") + xmlCitation.set("class","citation") + xmlCitation.text = strCitation + xmlCitation.tail = tmpTail + # Create Link to be used for website in a popover + xmlCitation.set("data-toggle", "popover") + xmlCitation.set("html", "true") + xmlCitation.set("data-placement", "bottom") + xmlCitation.set("data-title", strCitation) + try: + xmlCitation.set("data-content", strTitle) + except: + xmlCitation.set("data-content", "missing") + intChapterNumber += 1 + +# If Bibliography-Type is monograph-numeric search for EOAbibliography and make it all +if xmlTree.find(".//EOAbibliographytype").text == "monograph-numeric": + if xmlTree.find(".//EOAprintbibliography") is not None: + dictCitekeysNumbers = {} + dictCitekeysTitles = {} + xmlBibliography = xmlTree.find(".//EOAprintbibliography") + xmlBibliography.clear() + xmlBibliography.tag = "div" + xmlBibliography.getparent().tag = "div" + xmlEntries = xmlBibTree.findall(".//entry") + intNumberOfEntry = 1 + for xmlEntry in xmlEntries: + # Go through all entries and assign a number to the citekey + bibEntry = Bibitem(xmlEntry) + strCitekey = bibEntry.citekey() + dictCitekeysNumbers[strCitekey] = str(intNumberOfEntry) + dictCitekeysTitles[strCitekey] = str(bibEntry.title()) + strNewentry = "

[" + str(intNumberOfEntry) + "] " + createBibEntryNumeric(bibEntry) + "

" + xmlNew = etree.fromstring(strNewentry) + xmlBibliography.append(xmlNew) + intNumberOfEntry += 1 + # Now for the references via EOAcitenumeric + xmlCitenumerics = xmlTree.findall(".//EOAcitenumeric") + for xmlCitenumeric in xmlCitenumerics: + print (etree.tostring(xmlCitenumeric)) + strPopover = "" + tmpCitekeys = xmlCitenumeric.find(".//citekey").text + tmpCitekeys = re.sub(" ", "", tmpCitekeys) + tmpCitekeys = re.sub("\n", "", tmpCitekeys) + listCitekeys = re.split("\,", tmpCitekeys) + listCitenumbers = [] + for strCitekey in listCitekeys: + listCitenumbers.append(dictCitekeysNumbers[strCitekey]) + # Create Text to be used on the website in a popover + strPopover = strPopover + "[" + dictCitekeysNumbers[strCitekey] + "] " + dictCitekeysTitles[strCitekey] + " " + listCitenumbers = sorted(listCitenumbers, key=int) + strResult = "[" + listCitenumbers[0] + intNumberOfSequentialCite = 0 + for i in range(1,len(listCitenumbers)): + intPreviousCitenumber = int(listCitenumbers[i-1]) + intCurrentCitenumber = int(listCitenumbers[i]) + if i == (len(listCitenumbers)-1): + if (intPreviousCitenumber + 1) == intCurrentCitenumber: + if intNumberOfSequentialCite == 0: + strResult = strResult + "," + str(listCitenumbers[i]) + else: + strResult = strResult + "-" + str(listCitenumbers[i]) + intNumberOfSequentialCite == 0 + else: + strResult = strResult + "," + str(listCitenumbers[i]) + break + intNextCitenumber = int(listCitenumbers[i+1]) + if (intCurrentCitenumber + 1) != intNextCitenumber: + if intNumberOfSequentialCite != 0: + strResult = strResult + "-" + str(intCurrentCitenumber) + intNumberOfSequentialCite = 0 + else: + strResult = strResult + "," + str(intCurrentCitenumber) + continue + if (intPreviousCitenumber + 1) == intCurrentCitenumber: + intNumberOfSequentialCite += 1 + continue + else: + strResult = strResult + "," + str(intCurrentCitenumber) + intNumberOfSequentialCite = 0 + strResult = strResult + "]" + xmlCitenumeric.text = strResult + # Create Link to be used for website + xmlCitenumeric.set("data-toggle", "popover") + xmlCitenumeric.set("html", "true") + xmlCitenumeric.set("data-content", strPopover) + xmlCitenumeric.set("class","citation") + xmlCitenumeric.set("data-placement", "bottom") + xmlCitenumeric.set("data-title", strResult) + +# Numeric citations for the individual chapters +if xmlTree.find(".//EOAbibliographytype").text == "anthology-numeric": + intChapterNumber = 1 + for xmlChapter in xmlChapters: + print ("Processing Bibliography") + if xmlChapter.find(".//EOAprintbibliography") is not None: + dictCitekeysNumbers = {} + dictCitekeysTitles = {} + xmlBibliography = xmlChapter.find(".//EOAprintbibliography") + #xmlBibliography.clear() + xmlBibliography.tag = "div" + xmlBibliography.getparent().tag = "div" + xmlRefsections = xmlBibTree.findall(".//refsection") + for xmlRefsection in xmlRefsections: + if xmlRefsection.find(".//number").text == str(intChapterNumber): + break + xmlEntries = xmlRefsection.findall(".//entry") + intNumberOfEntry = 1 + for xmlEntry in xmlEntries: + # Go through all entries and assign a number to the citekey + bibEntry = Bibitem(xmlEntry) + strCitekey = bibEntry.citekey() + dictCitekeysNumbers[strCitekey] = str(intNumberOfEntry) + dictCitekeysTitles[strCitekey] = str(bibEntry.title()) + strNewentry = "

[" + str(intNumberOfEntry) + "] " + createBibEntryNumeric(bibEntry) + "

" + xmlNew = etree.fromstring(strNewentry) + xmlBibliography.append(xmlNew) + intNumberOfEntry += 1 + # Now for the references via EOAcitenumeric + xmlCitenumerics = xmlChapter.xpath(".//EOAcitenumeric | .//EOAciteauthoryear | .//EOAciteyear") + print ("Numerische Citation gefunden in Kapitel " + str(intChapterNumber)) + for xmlCitenumeric in xmlCitenumerics: + strPopover = "" + tmpCitekeys = xmlCitenumeric.find(".//citekey").text + tmpCitekeys = re.sub(" ", "", tmpCitekeys) + tmpCitekeys = re.sub("\n", "", tmpCitekeys) + print (tmpCitekeys) + listCitekeys = re.split("\,", tmpCitekeys) + listCitenumbers = [] + for strCitekey in listCitekeys: + print (strCitekey) + listCitenumbers.append(dictCitekeysNumbers[strCitekey]) + # Create Text to be used on the website in a popover + strPopover = strPopover + "[" + dictCitekeysNumbers[strCitekey] + "] " + dictCitekeysTitles[strCitekey] + " " + listCitenumbers = sorted(listCitenumbers, key=int) + strResult = "[" + listCitenumbers[0] + intNumberOfSequentialCite = 0 + for i in range(1,len(listCitenumbers)): + intPreviousCitenumber = int(listCitenumbers[i-1]) + intCurrentCitenumber = int(listCitenumbers[i]) + if i == (len(listCitenumbers)-1): + if (intPreviousCitenumber + 1) == intCurrentCitenumber: + if intNumberOfSequentialCite == 0: + strResult = strResult + "," + str(listCitenumbers[i]) + else: + strResult = strResult + "-" + str(listCitenumbers[i]) + intNumberOfSequentialCite == 0 + else: + strResult = strResult + "," + str(listCitenumbers[i]) + break + intNextCitenumber = int(listCitenumbers[i+1]) + if (intCurrentCitenumber + 1) != intNextCitenumber: + if intNumberOfSequentialCite != 0: + strResult = strResult + "-" + str(intCurrentCitenumber) + intNumberOfSequentialCite = 0 + else: + strResult = strResult + "," + str(intCurrentCitenumber) + continue + if (intPreviousCitenumber + 1) == intCurrentCitenumber: + intNumberOfSequentialCite += 1 + continue + else: + strResult = strResult + "," + str(intCurrentCitenumber) + intNumberOfSequentialCite = 0 + strResult = strResult + "]" + xmlCitenumeric.text = strResult + # Create Link to be used for website in a popover + xmlCitenumeric.set("data-toggle", "popover") + xmlCitenumeric.set("data-placement", "bottom") + xmlCitenumeric.set("data-title", " " + strResult) + xmlCitenumeric.set("data-content", strPopover) + xmlCitenumeric.set("class","citation") + intChapterNumber += 1 + +############################################################## +# Create .epub basic structure # +############################################################## + +# Create folder structure for ebook +if os.path.exists(os.getcwd() + "/CONVERT/epub") == False: + os.mkdir(os.getcwd() + "/CONVERT/epub") + os.mkdir(os.getcwd() + "/CONVERT/epub/META-INF") + os.mkdir(os.getcwd() + "/CONVERT/epub/OEBPS") + os.mkdir(os.getcwd() + "/CONVERT/epub/OEBPS/images") + +# Copy containter.xml and mimetype +shutil.copy(SUPPORT_TEMPLATE_PATH + "Templates/epubcontainer.xml", os.getcwd() + "/CONVERT/epub/META-INF/container.xml") +shutil.copy(SUPPORT_TEMPLATE_PATH + "Templates/epubmimetype", os.getcwd() + "/CONVERT/epub/mimetype") + +# Shortcut for namespace +htmlns = "{http://www.w3.org/1999/xhtml}" + +# Load Template for Chapter HTML +xmlChapterParser = etree.XMLParser(no_network=False,load_dtd=False) #resolve_entities=False + +# Preparing toc.ncx +xmlTocncxParser = etree.XMLParser(no_network=False,load_dtd=False) +tocncx = etree.parse(SUPPORT_TEMPLATE_PATH + "Templates/epubtocncx.xml", xmlTocncxParser) + +# Preparing content.opf +xmlContentopfParser = etree.XMLParser(no_network=False,load_dtd=False) +contentopf = etree.parse(SUPPORT_TEMPLATE_PATH + "Templates/epubcontentopf.xml", xmlContentopfParser) +print ("-----------------------------------------------------") +print ("Preparing content.opf") +xmlMetadata = contentopf.find(".//{http://www.idpf.org/2007/opf}metadata") +# Prepare Metadata based on Publication.cfg +cfgPublication = configparser.RawConfigParser() +cfgPublication.read(os.getcwd() + "/CONVERT/publication.cfg") +# Prepare Author String +strAuthorString = cfgPublication.get("Authors", "Author1") +if cfgPublication.get("Authors", "Author2") != "": + strAuthorString = cfgPublication.get("Authors", "Author1") + " and " + cfgPublication.get("Authors", "Author2") +if cfgPublication.get("Authors", "Author3") != "": + strAuthorString = cfgPublication.get("Authors", "Author1") + ", " + cfgPublication.get("Authors", "Author2") + " and " + cfgPublication.get("Authors", "Author3") +if cfgPublication.get("Authors", "Author4") != "": + strAuthorString = cfgPublication.get("Authors", "Author1") + ", " + cfgPublication.get("Authors", "Author2") + ", " + cfgPublication.get("Authors", "Author3") + " and " + cfgPublication.get("Authors", "Author4") +xmlAuthor = etree.Element("{http://purl.org/dc/elements/1.1/}creator") +xmlAuthor.text = strAuthorString +xmlMetadata.append(xmlAuthor) +# Prepare Title-String +strTitleString = cfgPublication.get("Technical", "Title") +xmlTitle = etree.Element("{http://purl.org/dc/elements/1.1/}title") +xmlTitle.text = strTitleString +xmlMetadata.append(xmlTitle) +# Prepare Description via Subtitle +strSubtitleString = cfgPublication.get("Technical", "Subtitle") +if strSubtitleString != "": + xmlSubtitle = etree.Element("{http://purl.org/dc/elements/1.1/}description") + xmlSubtitle.text = strSubtitleString + xmlMetadata.append(xmlSubtitle) +# Prepare Identifier +strIdentifier = "MPIWG:" + cfgPublication.get("Technical", "Serie") + cfgPublication.get("Technical", "Number") +xmlIdentifier = etree.Element("{http://purl.org/dc/elements/1.1/}identifier") +xmlIdentifier.text = strIdentifier +xmlIdentifier.set("id", "BookId") +xmlMetadata.append(xmlIdentifier) +# Prepare Type +xmlType = etree.Element("{http://purl.org/dc/elements/1.1/}type") +xmlType.text = "Text" +xmlMetadata.append(xmlType) +#Prepare Date +strPublicationDate = cfgPublication.get("Technical", "PublicationDate") +xmlDate = etree.Element("{http://purl.org/dc/elements/1.1/}date") +xmlDate.text = strPublicationDate +xmlDate.set("{http://www.idpf.org/2007/opf}event", "creation") +xmlMetadata.append(xmlDate) +# Prepare Publisher +xmlPublisher = etree.Element("{http://purl.org/dc/elements/1.1/}publisher") +xmlPublisher.text = "Edition Open Access" +xmlMetadata.append(xmlPublisher) +# Prepare Rights +xmlPublisher = etree.Element("{http://purl.org/dc/elements/1.1/}rights") +xmlPublisher.text = "Published under Creative Commons by-nc-sa 3.0 Germany Licence" +xmlMetadata.append(xmlPublisher) +# Prepare Source +xmlSource = etree.Element("{http://purl.org/dc/elements/1.1/}source") +xmlSource.text = "Max Planck Research Library for the History and Development of Knowledge" +xmlMetadata.append(xmlSource) +# Prepare Subject +strSubject = cfgPublication.get("General", "Keyword1") +xmlSubject = etree.Element("{http://purl.org/dc/elements/1.1/}subject") +xmlSubject.text = strSubject +xmlMetadata.append(xmlSubject) +# Prepare Language +strLanguage = cfgPublication.get("Technical", "Language") +xmlLanguage = etree.Element("{http://purl.org/dc/elements/1.1/}language") +xmlLanguage.text = strLanguage +xmlMetadata.append(xmlLanguage) +#Prepare Cover +xmlCover = etree.Element("meta") +xmlCover.set("content", "cover_pic") +xmlCover.set("name", "cover") +xmlMetadata.append(xmlCover) +xmlManifest = contentopf.find(".//{http://www.idpf.org/2007/opf}manifest") +xmlItem = etree.Element("item") +xmlItem.set("id", "cover_pic") +xmlItem.set("href", "images/cover.jpg") +xmlItem.set("media-type", "image/jpeg") +xmlManifest.append(xmlItem) +shutil.copy(os.getcwd() + "/CONVERT/cover.jpg", os.getcwd() + "/CONVERT/epub/OEBPS/images/") +xmlItem = etree.Element("item") +xmlItem.set("id", "cover") +xmlItem.set("href", "cover.xhtml") +xmlItem.set("media-type", "application/xhtml+xml") +xmlManifest.append(xmlItem) +shutil.copy(SUPPORT_TEMPLATE_PATH + "Templates/epubcover.xhtml", os.getcwd() + "/CONVERT/epub/OEBPS/cover.xhtml") +print ("-------------------") +print ("Preparing intro.xhtml") +print ("-------------------") +tmpFilePath = SUPPORT_TEMPLATE_PATH + "Templates/epubintro.xhtml" +tmpFile = open(tmpFilePath, "r") +strIntroHTML = tmpFile.read() +tmpFile.close() +strIntroHTML = re.sub("author", strAuthorString, strIntroHTML) +strIntroHTML = re.sub("TITLE", strTitleString, strIntroHTML) +strIntroHTML = re.sub("year", cfgPublication.get("Technical", "PublicationYear"), strIntroHTML) +strIntroHTML = re.sub("series", cfgPublication.get("Technical", "Serie"), strIntroHTML) +strIntroHTML = re.sub("number", cfgPublication.get("Technical", "Number"), strIntroHTML) +if cfgPublication.get("General", "AdditionalInformation") != "": + strIntroHTML = re.sub("AdditionalInformation", "

" + cfgPublication.get("General", "AdditionalInformation") + "

", strIntroHTML) +else: + strIntroHTML = re.sub("AdditionalInformation", "", strIntroHTML) +tmpFilePath = os.getcwd() + "/CONVERT/epub/OEBPS/intro.xhtml" +tmpFile = open(tmpFilePath, "w") +tmpFile.write(strIntroHTML) +print ("-------------------") +print ("Preparing toc.ncx") +print ("-------------------") +xmlHead = tocncx.find("//{http://www.daisy.org/z3986/2005/ncx/}head") +xmlMeta = etree.Element("meta") +xmlMeta.set("name", "dtb:uid") +xmlMeta.set("content", "MPIWG:" + cfgPublication.get("Technical", "Serie") + cfgPublication.get("Technical", "Number")) +xmlHead.append(xmlMeta) +xmlTitle = tocncx.find("//{http://www.daisy.org/z3986/2005/ncx/}docTitle") +xmlText = etree.Element("text") +xmlText.text = strTitleString +xmlTitle.append(xmlText) +xmlAuthor = tocncx.find("//{http://www.daisy.org/z3986/2005/ncx/}docAuthor") +xmlText = etree.Element("text") +xmlText.text = strAuthorString +xmlAuthor.append(xmlText) + +# This list includes all files which have already been included to avoid duplicates +listContentopf = [] + +############################################################## +# Convert Tralics-XML to Epub # +############################################################## + +# Copy xmlTree to xmlEbookTree +xmlEbookTree = deepcopy(xmlTree) +# xmlChapters is a list containing all chapters +xmlChapters = xmlEbookTree.findall("//div1") + +# Convert Chapters, Sections, Subsections and Subsubsections to h1, h2, h3, h4 +# Insert Number from Dictionary where needed + +print ("-----------------------------------------------------") +print ("Convert EOAChapter to H1") +for xmlChapter in xmlChapters: + xmlChapter.find("head").tag = "h1" + if xmlChapter.get("rend") != "nonumber": + idChapter = xmlChapter.get("id") + print (idChapter + " konvertierung into h1") + print (dictChapters[idChapter]) + strHeadline = xmlChapter.find("h1").text or "" + xmlChapter.find("h1").text = str(dictChapters[idChapter]) + ". " + strHeadline + if xmlChapter.find(".//EOAauthor") is not None: + tmpXML = etree.Element("p") + tmpXML.append(etree.Element("i")) + tmpXML[0].text = xmlChapter.find(".//EOAauthor").text + xmlChapter.insert(1, tmpXML) + # Remove unwanted EOAauthor here + xmlChapter.find(".//EOAauthor").text = "" + xmlChapter = etree.strip_tags(xmlChapter, "EOAauthor") + +print (dictSections) + +print ("-----------------------------------------------------") +print ("Convert EOAsection to H2") +xmlSections = xmlEbookTree.findall(".//div2") +for xmlSection in xmlSections: + xmlSection.find("head").tag = "h2" + if xmlSection.get("rend") != "nonumber": + idSection = xmlSection.get("id") + strHeadline = xmlSection.find("h2").text or "" + print (strHeadline) + xmlSection.find("h2").text = str(dictSections[idSection]) + " " + strHeadline + +print ("-----------------------------------------------------") +print ("Convert EOAsubsection to H3") +xmlSubsections = xmlEbookTree.findall(".//div3") +for xmlSubsection in xmlSubsections: + xmlSubsection.find("head").tag = "h3" + if xmlSubsection.get("rend") != "nonumber": + idSection = xmlSubsection.get("id") + strHeadline = xmlSubsection.find("h3").text or "" + print (strHeadline) + xmlSubsection.find("h3").text = str(dictSections[idSection]) + " " + strHeadline + +print ("-----------------------------------------------------") +print ("Convert EOAsubsubsection to H4") +xmlSubsubsections = xmlEbookTree.findall(".//div4") +for xmlSubsubsection in xmlSubsubsections: + xmlSubsubsection.find("head").tag = "h4" + #if xmlSubsubsection.get("rend") != "nonumber": + #idSection = xmlSubsection.get("id") + #strHeadline = xmlSubsection.find("h4").text + #xmlSubsection.find("h3").text = str(dictSections[idSection]) + " " + strHeadline + +print ("-----------------------------------------------------") +print ("Preparing Figures") +xmlFigures = xmlEbookTree.xpath(".//EOAfigure | .//EOAlsfigure") +for xmlFigure in xmlFigures: + # Copy File of the Image + # If it's in a subfolder, name of folder and name of image will be merged + strImageFileString = xmlFigure.find(".//file").text + strImageFileString = strImageFileString.rstrip("\n") + strImageFileDir = os.path.dirname(strImageFileString) + # Remove / from path + strImageFileDir = re.sub("/", "", strImageFileDir) + strImageFileName = os.path.basename(strImageFileString) + strImageFileNamewoSuffix = os.path.splitext(strImageFileName)[0] + shutil.copy(os.getcwd() + "/" + strImageFileString, os.getcwd() + "/CONVERT/epub/OEBPS/images/" + strImageFileDir + strImageFileName) + strImageFilepath = sanitizeImageEpub(os.getcwd() + "/CONVERT/epub/OEBPS/images/" + strImageFileDir + strImageFileName) + # Add copied file to contentopf + contentopf = addToContentopf(contentopf, "images/" + strImageFileDir + strImageFileNamewoSuffix + ".jpg", strImageFileDir + strImageFileNamewoSuffix + "jpg", "jpg") + xmlFigureCaption = xmlFigure.find(".//caption") + idFigure = xmlFigure.find(".//anchor").get("id") + intFigureNumber = dictFigures[idFigure] + if xmlFigure.tag == "EOAfigure": + strImageWidth = xmlFigure.find(".//width").text + strImageWidth = strImageWidth.rstrip("\n") + if xmlFigure.tag == "EOAlsfigure": + strImageWidth = "100" + xmlFigure.clear() + xmlFigure.tag = "p" + xmlFigureImage = etree.Element("img") + xmlFigureImage.set("src", "images/" + strImageFileDir + strImageFileNamewoSuffix + ".jpg") + xmlFigureImage.set("alt", "") + xmlFigureImage.set("style", "width: " + strImageWidth + "%") + xmlFigure.append(xmlFigureImage) + xmlFigureCaption.tag = "p" + strFigureCaption = xmlFigureCaption.text or "" + xmlFigureCaption.text = "Figure " + str(intFigureNumber) + ": " + strFigureCaption + xmlFigure.addnext(xmlFigureCaption) + # Change the tag of the parent

-Tag to

so that it may be removed + #xmlFigure.getparent().tag = "div" + +print ("-----------------------------------------------------") +print ("Preparing not numbered Figures") +xmlFigures = xmlEbookTree.findall(".//EOAfigurenonumber") +for xmlFigure in xmlFigures: + # Copy File of the Image + # If it's in a subfolder, name of folder and name of image will be merged + strImageFileString = xmlFigure.find(".//file").text + strImageFileString = strImageFileString.rstrip("\n") + strImageFileDir = os.path.dirname(strImageFileString) + strImageFileDir = re.sub("/", "", strImageFileDir) + strImageFileName = os.path.basename(strImageFileString) + strImageFileNamewoSuffix = os.path.splitext(strImageFileName)[0] + shutil.copy(os.getcwd() + "/" + strImageFileString, os.getcwd() + "/CONVERT/epub/OEBPS/images/" + strImageFileDir + strImageFileName) + strImageFilepath = sanitizeImageEpub(os.getcwd() + "/CONVERT/epub/OEBPS/images/" + strImageFileDir + strImageFileName) + # Add copied file to contentopf + contentopf = addToContentopf(contentopf, "images/" + strImageFileDir + strImageFileNamewoSuffix + ".jpg", strImageFileDir + strImageFileNamewoSuffix + "jpg", "jpg") + strImageWidth = xmlFigure.find(".//width").text + strImageWidth = strImageWidth.rstrip("\n") + xmlFigure.clear() + xmlFigure.tag = "p" + xmlFigureImage = etree.Element("img") + xmlFigureImage.set("src", "images/" + strImageFileDir + strImageFileNamewoSuffix + ".jpg") + xmlFigureImage.set("alt", "") + xmlFigureImage.set("style", "width: " + strImageWidth + "%") + xmlFigure.append(xmlFigureImage) + +print ("-----------------------------------------------------") +print ("Preparing Footnotes") +for xmlChapter in xmlChapters: + xmlFootnotes = xmlChapter.findall(".//note") + if len(xmlFootnotes) == 0: + continue + xmlNewFootnotes = etree.Element("div") + xmlNewFootnotesHeader = etree.Element("h3") + xmlNewFootnotesHeader.text = dictLangFootnotes[xmlChapter.get("language")] + xmlNewFootnotes.append(xmlNewFootnotesHeader) + intFootnoteNumber = 1 + for xmlFootnote in xmlFootnotes: + # Not numbered Equations may appear in a footnote, need to be treated differently + xmlEquationsnonumber = xmlFootnote.findall(".//EOAequationnonumber") + for xmlEquationnonumber in xmlEquationsnonumber: + strFilename = xmlEquationnonumber.get("filename") + xmlEquationnonumber.clear() + xmlEquationnonumber.tag = "p" + xmlIMG = etree.Element("img", src="images/"+ strFilename, alt="") + xmlEquationnonumber.append(xmlIMG) + shutil.copy(os.getcwd() + "/items/" + strFilename, os.getcwd() + "/CONVERT/epub/OEBPS/images/" + strFilename) + contentopf = addToContentopf(contentopf, "images/" + strFilename, strFilename, "png") + xmlFirstChild = xmlFootnote.getchildren()[0] + if xmlFirstChild.text == None: + xmlFirstChild.text = "[" + str(intFootnoteNumber) + "] " + else: + xmlFirstChild.text = "[" + str(intFootnoteNumber) + "] " + xmlFirstChild.text + #Preserve tail and children of current -Tag + xmlFootnoteContentsTail = xmlFootnote.tail + xmlFootnoteChildren = xmlFootnote.getchildren() + # Substitute current with Number + xmlFootnote.clear() + xmlFootnote.text = "[" + str(intFootnoteNumber) + "]" + xmlFootnote.tail = xmlFootnoteContentsTail + xmlFootnote.tag = "sup" + # NOTE: Anchor not being used for the time being + #xmlNewFootnoteAnchor = etree.Element("a") + #xmlNewFootnoteAnchor.set("name", "fn" + str(intFootnoteNumber)) + #xmlNewFootnote.append(xmlNewFootnoteAnchor) + if len(xmlFootnoteChildren) != 0: + for xmlFootnoteChild in xmlFootnoteChildren: + xmlNewFootnotes.append(xmlFootnoteChild) + intFootnoteNumber += 1 + xmlChapter.append(xmlNewFootnotes) + +print ("-----------------------------------------------------") +print ("Preparing Lists") +for xmlChapter in xmlChapters: + xmlLists = xmlChapter.findall(".//list") + for xmlList in xmlLists: + if xmlList.get("type") == "description": + continue + if xmlList.get("type") == "ordered": + xmlList.tag = "ol" + if xmlList.get("type") == "simple": + xmlList.tag = "ul" + xmlListItems = xmlList.findall(".//item") + for xmlListItem in xmlListItems: + xmlListItem.tag = "li" + +print ("-----------------------------------------------------") +print ("Preparing Descriptions") +for xmlChapter in xmlChapters: + xmlDescriptions = xmlChapter.findall(".//list") + for xmlDescription in xmlDescriptions: + xmlDescription.tag = "dl" + del xmlDescription.attrib["type"] + for xmlChild in xmlDescription.iterchildren(): + if xmlChild.tag == "label": + xmlChild.tag = "dt" + if xmlChild.tag == "item": + xmlChild.tag = "dd" + del xmlChild.attrib["id"] + del xmlChild.attrib["id-text"] + +print ("-----------------------------------------------------") +print ("Preparing Blockquotes") +xmlParagraphs = xmlEbookTree.findall(".//p") +for xmlParagraph in xmlParagraphs: + if xmlParagraph.get("rend") == "quoted": + strParagraphText = xmlParagraph.text + strParagraphTail = xmlParagraph.tail + xmlParagraphChildren = xmlParagraph.getchildren() + xmlParagraph.clear() + xmlParagraph.tag = "blockquote" + xmlNew = etree.Element("p") + if strParagraphText is not None: + xmlNew.text = strParagraphText + if len(xmlParagraphChildren) != 0: + for xmlParagraphChild in xmlParagraphChildren: + xmlNew.append(xmlParagraphChild) + if strParagraphTail is not None: + xmlNew.tail = strParagraphTail + xmlParagraph.append(xmlNew) + +print ("-----------------------------------------------------") +print ("Preparing Theorems") +for xmlChapter in xmlChapters: + xmlTheorems = xmlChapter.findall(".//theorem") + for xmlTheorem in xmlTheorems: + xmlTheoremHead = xmlTheorem.find(".//head") + strTheoremTitel = xmlTheorem.find(".//head").text + strTheoremText = xmlTheorem.find(".//p").text + xmlTheoremTextTail = xmlTheorem.find(".//p").tail + strTheoremNumber = xmlTheorem.get("id-text") + xmlTheorem.tag = "p" + xmlTheoremHead.tag = "b" + xmlTheoremHead.text = xmlTheoremHead.text + " " + strTheoremNumber + del xmlTheorem.attrib["style"] + del xmlTheorem.attrib["type"] + del xmlTheorem.attrib["id-text"] + del xmlTheorem.attrib["id"] + etree.strip_tags(xmlTheorem, "p") + +print ("-----------------------------------------------------") +print ("Preparing Hyperlinks") +for xmlChapter in xmlChapters: + xmlHyperlinks = xmlChapter.findall(".//xref") + for xmlHyperlink in xmlHyperlinks: + strURL = xmlHyperlink.get('url') + print (strURL) + if strURL.startswith("http://") == False: + strURL = "http://" + strURL + xmlHyperlink.tag = "a" + del xmlHyperlink.attrib["url"] + xmlHyperlink.set("href", strURL) + etree.strip_elements(xmlHyperlink, with_tail=True, *['allowbreak']) + xmlHyperlink.text = strURL + +print ("-----------------------------------------------------") +print ("Convert emphasized text") +for xmlChapter in xmlChapters: + xmlItalics = xmlChapter.findall(".//hi") + for xmlItalic in xmlItalics: + if xmlItalic.get("rend") == "it": + xmlItalic.tag = "em" + del xmlItalic.attrib["rend"] + +print ("-----------------------------------------------------") +print ("Convert bold text") +for xmlChapter in xmlChapters: + xmlBolds = xmlChapter.findall(".//hi") + for xmlBold in xmlBolds: + if xmlBold.get("rend") == "bold": + xmlBold.tag = "b" + del xmlBold.attrib["rend"] + +print ("-----------------------------------------------------") +print ("Convert EOAup to ") +for xmlChapter in xmlChapters: + xmlUps = xmlChapter.findall(".//EOAup") + for xmlUp in xmlUps: + xmlUp.tag = "sup" + +print ("-----------------------------------------------------") +print ("Convert EOAdown to ") +for xmlChapter in xmlChapters: + xmlDowns = xmlChapter.findall(".//EOAdown") + for xmlDown in xmlDowns: + xmlDown.tag = "sub" + +print ("-----------------------------------------------------") +print ("Convert EOAst to ") +for xmlChapter in xmlChapters: + xmlStrikeouts = xmlChapter.findall(".//EOAst") + for xmlStrikeout in xmlStrikeouts: + xmlStrikeout.tag = "span" + xmlStrikeout.set("style", "text-decoration: line-through;") + +print ("-----------------------------------------------------") +print ("Convert EOAls to something nice") +for xmlChapter in xmlChapters: + xmlLetterspaceds = xmlChapter.findall(".//EOAls") + for xmlLetterspaced in xmlLetterspaceds: + xmlLetterspaced.tag = "span" + xmlLetterspaced.set("style", "letter-spacing: 0.5em;") + +print ("-----------------------------------------------------") +print ("Convert EOAcaps to something nice") +for xmlChapter in xmlChapters: + xmlLetterspaceds = xmlChapter.findall(".//EOAcaps") + for xmlLetterspaced in xmlLetterspaceds: + xmlLetterspaced.tag = "span" + xmlLetterspaced.set("style", "font-variant:small-caps;") + + +print ("-----------------------------------------------------") +print ("Convert EOAineq into appropriate IMG-Tags") +for xmlChapter in xmlChapters: + xmlInlineEquations = xmlChapter.findall(".//EOAineq") + for xmlInlineEquation in xmlInlineEquations: + xmlInlineEquation.tag = "img" + xmlInlineEquation.set("alt", "") + del xmlInlineEquation.attrib["TeX"] + shutil.copy(os.getcwd() + "/items/" + xmlInlineEquation.get("src"), os.getcwd() + "/CONVERT/epub/OEBPS/images/" + xmlInlineEquation.get("src")) + xmlInlineEquation.set("src", "images/" + xmlInlineEquation.get("src")) + contentopf = addToContentopf(contentopf, xmlInlineEquation.get("src"), xmlInlineEquation.get("src"), "png") + +print ("-----------------------------------------------------") +print ("Convert EOAinline into appropriate IMG-Tags") +for xmlChapter in xmlChapters: + xmlInlineElements = xmlChapter.findall(".//EOAinline") + for xmlInlineElement in xmlInlineElements: + xmlInlineElement.tag = "img" + xmlInlineElement.set("alt", "Too late") + strInlineElementFilePath = xmlInlineElement.text + # remove text from element. This is visible in epub (at least in calibre's e-book-viewer) + # however, the text is taken as id in content.opf + # set it to nil after the addToContentopf + + strInlineElementFileName = os.path.basename(strInlineElementFilePath) + strInlineElementDirName = os.path.dirname(strInlineElementFilePath) + strNewImagePath = os.getcwd() + "/CONVERT/epub/OEBPS/images/" + strInlineElementDirName + strInlineElementFileName + + # trouble when there are subdirectories in Image path! + # some thing goes wrong here: Images/png_300dpi/A.png + + shutil.copy(os.getcwd() + "/" + strInlineElementDirName + "/" + strInlineElementFileName, strNewImagePath) + # strNewImagePath = os.getcwd() + "/CONVERT/epub/OEBPS/images/" + strInlineElementDirName + strInlineElementFileName + strCommand = GM_PATH + " convert " + strNewImagePath + " -resize 20x20 " + strNewImagePath + listArguments = shlex.split(strCommand) + subprocess.check_output(listArguments, shell=False) + xmlInlineElement.set("src", "images/" + strInlineElementDirName + strInlineElementFileName) + # contentopf, Filename, FileID, Mediatype + # + # Mediatype should not be hard coded!!! + # base this on file extension + extension = strInlineElementFileName.split(".")[-1] + contentopf = addToContentopf(contentopf, "images/" + strInlineElementDirName + strInlineElementFileName, xmlInlineElement.text, extension) + xmlInlineElement.text = "" + +print ("-----------------------------------------------------") +print ("Preparing Equations") +for xmlChapter in xmlChapters: + xmlEquations = xmlChapter.findall(".//EOAequation") + for xmlEquation in xmlEquations: + strNumber = xmlEquation.get("number") + strFilename = xmlEquation.get("filename") + # Copy image of Equation + shutil.copy(os.getcwd() + "/items/" + strFilename, os.getcwd() + "/CONVERT/epub/OEBPS/images/" + strFilename) + contentopf = addToContentopf(contentopf, "images/" + strFilename, strFilename, "png") + # Find out Number of Equation to be appended in the last step + strEquationNumber = xmlEquation.get("number") + # Rework XML + xmlEquation.clear() + xmlEquation.tag = "p" + xmlEquationImage = etree.Element("img") + xmlEquationImage.set("src", "images/" + strFilename) + xmlEquationImage.set("alt", "") + xmlEquation.append(xmlEquationImage) + xmlNew = etree.Element('p') + xmlNew.text = "(" + strEquationNumber + ")" + xmlEquation.addnext(xmlNew) + # Parent tag of Equation should be
instead of

, so that it may be removed + #xmlEquation.getparent().tag = "div" + +for xmlChapter in xmlChapters: + xmlEquations = xmlChapter.findall(".//EOAequationnonumber") + for xmlEquation in xmlEquations: + strFilename = xmlEquation.get("filename") + # Copy image of Equation + shutil.copy(os.getcwd() + "/items/" + strFilename, os.getcwd() + "/CONVERT/epub/OEBPS/images/" + strFilename) + contentopf = addToContentopf(contentopf, "images/" + strFilename, strFilename, "png") + # Rework XML + xmlEquation.clear() + xmlEquation.tag = "p" + xmlEquationImage = etree.Element("img") + xmlEquationImage.set("src", "images/" + strFilename) + xmlEquationImage.set("alt", "") + xmlEquation.append(xmlEquationImage) + # Parent tag of Equation should be

instead of

, so that it may be removed + #xmlEquation.getparent().tag = "div" + +# EOAequationarray not handled so far. However: my solution (renaming +# the div) just makes the element disappear, leaving only its children! +for xmlChapter in xmlChapters: + xmlEquationarrays = xmlChapter.findall(".//EOAequationarray") + for xmlEquationarray in xmlEquationarrays: + xmlEquationarray.tag = "div" + + +print ("-----------------------------------------------------") +print ("Preparing Letterheads") +for xmlChapter in xmlChapters: + xmlLetterheads = xmlChapter.xpath(".//EOAletterhead") + print (len(xmlLetterheads)) + for xmlLetterhead in xmlLetterheads: + xmlRecipient = xmlLetterhead.find(".//Recipient") + print (etree.tostring(xmlRecipient)) + xmlRecipient.tag = "p" + xmlRecipient.getchildren()[0].tag = "em" + xmlArchive = xmlLetterhead.find(".//Archive") + xmlArchive.tag = "p" + xmlArchive.getchildren()[0].tag = "em" + xmlAdditional = xmlLetterhead.find(".//Additional") + xmlAdditional.tag = "p" + xmlAdditional.getchildren()[0].tag = "em" + xmlPages = xmlLetterhead.find(".//Pages") + xmlPages.tag = "p" + xmlPages.getchildren()[0].tag = "em" + xmlHR = etree.Element("hr") + xmlHR2 = etree.Element("hr") + xmlLetterhead.insert(0, xmlHR) + xmlLetterhead.insert(5, xmlHR2) + +print ("-----------------------------------------------------") +print ("Preparing Transcriptions") +# TODO: May need rework concerning the right Column +for xmlChapter in xmlChapters: + etree.strip_elements(xmlChapter, "Facsimilelink") + xmlTranscriptions = xmlChapter.xpath(".//EOAtranscripted") + for xmlTranscription in xmlTranscriptions: + print ("Processing Transcription") + print (etree.tostring(xmlTranscription)) + xmlTranscription.tag = "table" + xmlHeader = xmlTranscription.find(".//EOAtranscriptedheader") + xmlHeader.tag = "tr" + xmlLeftHeader = xmlTranscription.find(".//Leftheader") + print (xmlLeftHeader.text) + xmlLeftHeader.tag = "td" + xmlLeftHeader.set("style", "width: 50%") + xmlRightHeader = xmlTranscription.find(".//Rightheader") + xmlRightHeader.tag = "td" + xmlTranscriptedtext = xmlTranscription.find(".//EOAtranscriptedtext") + # change \n\n into

and pagebreak into

to create some valid markup + strTranscriptedtext = etree.tostring(xmlTranscriptedtext, encoding="unicode") + #strTranscriptedtext = re.sub (r"\n\n\n\n", "

", str(strTranscriptedtext), re.MULTILINE) + #strTranscriptedtext = re.sub (r"\n\n\n", "

", str(strTranscriptedtext), re.MULTILINE) + #strTranscriptedtext = re.sub (r"\n\n", "

", str(strTranscriptedtext)) + #strTranscriptedtext = re.sub (r"", "

", strTranscriptedtext) + xmlLeftColumn = etree.Element("td") + xmlRightColumn = etree.Element("td") + boolRightColumn = False + xmlTemp = etree.XML(str(strTranscriptedtext)) + for xmlElement in xmlTemp.iterchildren(): + if xmlElement.tag == "pagebreak": + boolRightColumn = True + print ("Spaltenwechsel!") + continue + if boolRightColumn == False: + xmlLeftColumn.append(xmlElement) + if boolRightColumn == True: + xmlRightColumn.append(xmlElement) + xmlTranscriptedtext.clear() + xmlTranscriptedtext.tag = "tr" + xmlTranscriptedtext.set("valign", "top") + xmlTranscriptedtext.append(xmlLeftColumn) + xmlTranscriptedtext.append(xmlRightColumn) + +# Remove + +print ("-----------------------------------------------------") +print ("Preparing Tables") +intChapterNumber = 1 +for xmlChapter in xmlChapters: + xmlTables = xmlChapter.findall(".//EOAtable") + for xmlTable in xmlTables: + xmlRawTable = xmlTable.find(".//table") + strTableCaption = xmlTable.find(".//EOAtablecaption").text or "" + print (strTableCaption) + if strTableCaption != "nonumber": + intTableNumber = dictTables[xmlTable.find(".//EOAtablelabel").text] + xmlTableCaption = etree.Element("p") + print (strTableCaption) + print (intTableNumber) + xmlTableCaption.text = str(intTableNumber) + " " + strTableCaption + if xmlTable.find(".//EOAtablecaption").getchildren() is not None: + for xmlChild in xmlTable.find(".//EOAtablecaption").iterchildren(): + xmlTableCaption.append(xmlChild) + xmlRawTable.addnext(xmlTableCaption) + xmlTable.find(".//EOAtablecaption").clear() + xmlTable.remove(xmlTable.find(".//EOAtablecaption")) + xmlTable.find(".//EOAtablelabel").clear() + xmlTable.remove(xmlTable.find(".//EOAtablelabel")) + # Analyze Width and Alignment of the Columns + strColumnString = xmlTable.find(".//EOAtablecolumns").text + strColumnString = re.sub(r"\|", "", strColumnString) + xmlTable.remove(xmlTable.find(".//EOAtablecolumns")) + reMatchObjects = re.findall(r'([L|R|C].*?cm)', strColumnString) + intTableWidth = 0 + listColumnAlignments = [None] + listColumnWidths = [None] + intNumberOfColumns = 0 + for strColumnDefinition in reMatchObjects: + strColumnDefinition = strColumnDefinition.rstrip("cm") + strColumnDefinition = strColumnDefinition.rstrip("mm") + strColumnAlignment = strColumnDefinition[0] + if strColumnAlignment == "L": + strColumnAlignment = "left" + if strColumnAlignment == "C": + strColumnAlignment = "center" + if strColumnAlignment == "R": + strColumnAlignment = "right" + listColumnAlignments.append(strColumnAlignment) + intColumnWidth = int(float(strColumnDefinition.lstrip("LRC")) * 75) + listColumnWidths.append(intColumnWidth) + intTableWidth += intColumnWidth + intNumberOfColumns += 1 + xmlRawTable.set("width", str(intTableWidth)) + del xmlRawTable.attrib["rend"] + del xmlRawTable.attrib["id-text"] + del xmlRawTable.attrib["id"] + del xmlRawTable.attrib["place"] + # Figure out and deal with the Header + xmlHeader = xmlRawTable.find(".//row/cell/tableheader") + if xmlHeader is not None: + xmlHeader.text = "" + xmlHeader.getparent().text = xmlHeader.tail + xmlHeader.getparent().remove(xmlHeader) + xmlFirstRow = xmlRawTable.find(".//row") + xmlFirstRow.tag = "tr" + xmlFirstRowCells = xmlFirstRow.findall(".//cell") + for xmlFirstRowCell in xmlFirstRowCells: + xmlFirstRowCell.tag = "th" + # Now Deal with the rest of the rows + xmlTableRows = xmlRawTable.findall(".//row") + for xmlTableRow in xmlTableRows: + xmlTableCells = xmlTableRow.findall(".//cell") + intCurrentColumn = 1 + print (listColumnAlignments) + for xmlTableCell in xmlTableCells: + xmlTableCell.tag = "td" + xmlTableCell.set("align",listColumnAlignments[intCurrentColumn]) + xmlTableCell.set("style","width: " + str(listColumnWidths[intCurrentColumn]) + ";") + # Deal with multicolumn + if xmlTableCell.get("cols") is not None: + xmlTableCell.set("colspan", xmlTableCell.get("cols")) + if intCurrentColumn > len(xmlTableCells): + intCurrentColumn = 1 + # Deal with multicolumn again, increase intCurrentColumn by the columns being spanned + elif xmlTableCell.get("cols") is not None: + intCurrentColumn = intCurrentColumn + int(xmlTableCell.get("cols")) + del xmlTableCell.attrib["cols"] + else: + intCurrentColumn += 1 + xmlTableRow.tag = "tr" + xmlTableRow.set("valign", "top") + xmlTableParent = xmlTable.getparent() + xmlTableParent.addnext(xmlTable) + xmlTableParent.getparent().remove(xmlTableParent) + intChapterNumber += 1 + +print ("-----------------------------------------------------") +print ("Preparing Facsimiles") +xmlParts = xmlEbookTree.findall(".//div0") +for xmlPart in xmlParts: + xmlFacsimiles = xmlPart.findall(".//EOAfacsimilepage") + for xmlFacsimile in xmlFacsimiles: + strImageFile = xmlFacsimile.find(".//file").text + strFacsimileLabel = xmlFacsimile.find(".//label").text + etree.strip_elements(xmlFacsimile, "file") + etree.strip_elements(xmlFacsimile, "label") + # TODO: Hier noch irgendwie (fehlendem) Suffix der Datei umgehen. Und ggf. Dateien Konvertieren + strImageFile = strImageFile.rstrip("\n") + strImageFileDir = os.path.dirname(strImageFile) + strImageFileDir = re.sub("/", "", strImageFileDir) + strImageFileName = os.path.basename(strImageFile) + shutil.copy(os.getcwd() + "/" + strImageFile, os.getcwd() + "/CONVERT/epub/OEBPS/images/" + strImageFileDir + strImageFileName) + # Add copied file to contentopf + contentopf = addToContentopf(contentopf, "images/" + strImageFileDir + strImageFileName, strImageFileDir + strImageFileName, "jpg") + strSVGTemplate = """""" + xmlSVGFacsimile = etree.fromstring(strSVGTemplate) + xmlNew = etree.Element('image') + xmlNew.set("width", "600") + xmlNew.set("height", "800") + xmlNew.set("{http://www.w3.org/1999/xlink}href", "images/" + strImageFileDir + strImageFileName) + xmlSVGFacsimile.append(xmlNew) + xmlFacsimile.getparent().replace(xmlFacsimile, xmlSVGFacsimile) + +print ("-----------------------------------------------------") +print ("Preparing Cross-References") +for xmlChapter in xmlChapters: + xmlReferences = xmlChapter.findall(".//EOAref") + for xmlReference in xmlReferences: + print ("XXXXXXXX") + strResult = "!!! Cross Reference !!!" + xmlReferenceLabel = xmlReference.find("Label") + xmlReferenceLabelText = xmlReferenceLabel.text + xmlReferenceRef = xmlReference.find("ref") + xmlReferenceRefTarget = xmlReferenceRef.get("target") + if xmlReferenceLabelText in dictEquations: + print ("Verweis auf Array gefunden:" + xmlReferenceLabelText) + strResult = dictEquations[xmlReferenceLabelText] + if xmlReferenceRefTarget in dictEquations: + print ("Verweis auf Equation gefunden:" + xmlReferenceRefTarget) + strResult = dictEquations[xmlReferenceRefTarget] + if xmlReferenceRefTarget in dictLists: + print ("Verweis auf Liste gefunden") + strResult = dictLists[xmlReferenceRefTarget] + if xmlReferenceRefTarget in dictChapters: + print ("Verweis auf Kapitel gefunden") + strResult = dictChapters[xmlReferenceRefTarget] + if xmlReferenceRefTarget in dictSections: + print ("Verweis auf Section gefunden") + strResult = dictSections[xmlReferenceRefTarget] + if xmlReferenceRefTarget in dictFigures: + print ("Verweis auf Abbildung gefunden") + strResult = dictFigures[xmlReferenceRefTarget] + if xmlReferenceRefTarget in dictFootnotes: + print ("Verweis auf Fussnote gefunden") + strResult = dictFootnotes[xmlReferenceRefTarget] + if xmlReferenceRefTarget in dictTheorems: + print ("Verweis auf Theorem gefunden") + strResult = dictTheorems[xmlReferenceRefTarget] + if xmlReferenceLabelText in dictTables: + print ("Verweis auf Tabelle gefunden") + strResult = dictTables[xmlReferenceLabelText] + tmpTail = xmlReference.tail or "" + #tmpTail = tmpTail.strip() + print ("XXXXXXXX") + xmlReference.clear() + xmlReference.text = strResult + xmlReference.tail = tmpTail + +# Substitute Page-References with their targets +for xmlChapter in xmlChapters: + xmlReferences = xmlChapter.findall(".//EOApageref") + for xmlReference in xmlReferences: + strResult = "!!! Page Reference !!!" + xmlReferenceLabel = xmlReference.find("Label") + xmlReferenceLabelText = xmlReferenceLabel.text + xmlReferenceRef = xmlReference.find("ref") + xmlReferenceRefTarget = xmlReferenceRef.get("target") + if xmlReferenceLabelText in dictPagelabels: + print ("Verweis auf Seite gefunden" + xmlReferenceLabelText) + strResult = dictPagelabels[xmlReferenceLabelText] + tmpTail = xmlReference.tail or "" + xmlReference.clear() + xmlReference.text = strResult + xmlReference.tail = tmpTail + +# Correcting References to Publications +# NOTE: This may be reworked in the future to enable popups in the ebook +# NOTE: For the time being, span ist going to be removed +for xmlChapter in xmlChapters: + xmlPublicationreferences = xmlChapter.findall(".//span") + for xmlPublicationreference in xmlPublicationreferences: + if xmlPublicationreference.get("rel") == "popover": + xmlPublicationreference.tag = "EOAcitation" + +############################################################## +# Finish ePub Conversion, save File # +############################################################## + +print ("-----------------------------------------------------") +print ("Cleaning up XML") +xmlIndexentries = xmlEbookTree.xpath(".//EOAindex | .//EOAindexperson | .//EOAindexlocation") +for xmlIndexentry in xmlIndexentries: + tmpTail = xmlIndexentry.tail or "" + xmlIndexentry.clear() + xmlIndexentry.tail = tmpTail +etree.strip_tags(xmlEbookTree, "EOAlabel", "EOAindex", "EOApageref", "EOAcitenumeric", "EOAtable", "EOAref", "note", "div", "div2", "div3", "div4", "citetext", "newpage", "EOAciteyear", "EOAtablelabel" , "hi", "pagebreak", "page", "pagestyle", "EOAcitation", "EOAciteauthoryear", "EOAcitemanual", "EOAprintbibliography", "EOAindexperson", "EOAprintindex", "EOAprintpersonindex", "EOAindexlocation", "EOAprintlocationindex","anchor", "temp", "EOAletterhead") +etree.strip_attributes(xmlEbookTree, "id-text", "id", "noindent", "type", "label", "spacebefore", "rend") +etree.strip_elements(xmlEbookTree, "citekey", with_tail=False) + +# Write every Part and Chapter into one file +xmlChapters = xmlEbookTree.findall("//div1") +listParts = [] +intTechnicalChapterNumber = 1 +for xmlChapter in xmlChapters: + # Load xmlHTMLTemplate + htmlChapter = etree.parse(SUPPORT_TEMPLATE_PATH + "Templates/epubchapter.xml", xmlChapterParser) + # Find out, if it's inside a part. If Part has not been worked on, then do it + xmlChapterParent = xmlChapter.getparent() + if xmlChapterParent.tag == "div0" and xmlChapterParent.get("id") not in listParts: + listParts.append(xmlChapterParent.get("id")) + strPartTitle = xmlChapterParent.find(".//head").text + htmlChapter.find(".//" + htmlns + "title").text = strPartTitle + xmlNew = etree.Element('h1') + xmlNew.text = strPartTitle + htmlChapter.find(".//" + htmlns + "body").append(xmlNew) + # Save Part + tmpFileName = os.getcwd() + "/CONVERT/epub/OEBPS/chapter" + (str(intTechnicalChapterNumber)) + ".xhtml" + tmpFile = open (tmpFileName, "w") + tmpResult = etree.tostring(htmlChapter, pretty_print=True, encoding="unicode") + tmpFile.write(tmpResult) + tmpFile.close() + # Add to TocNCX + tocncx = addToTocncx(tocncx, htmlChapter.find(".//" + htmlns + "title").text, intTechnicalChapterNumber) + contentopf = addToContentopf(contentopf, "chapter" + str(intTechnicalChapterNumber) + ".xhtml", "chapter" + str(intTechnicalChapterNumber), "xml") + intTechnicalChapterNumber += 1 + # Reset htmlChapter + htmlChapter = etree.parse(SUPPORT_TEMPLATE_PATH + "Templates/epubchapter.xml", xmlChapterParser) + # Aus div1 alle kinder auslesen und an htmlChapter dran hängen + xmlChildren = xmlChapter.getchildren() + for xmlChild in xmlChildren: + # Using Deepcopy, coz a simple append will delete the original + htmlChapter.find(".//" + htmlns + "body").append(deepcopy(xmlChild)) + # Save Chapter + tmpFileName = os.getcwd() + "/CONVERT/epub/OEBPS/chapter" + (str(intTechnicalChapterNumber)) + ".xhtml" + tmpFile = open (tmpFileName, "w") + tmpResult = etree.tostring(htmlChapter, pretty_print=True, encoding="unicode") + tmpFile.write(tmpResult) + tmpFile.close() + # Add to TocNCX + tocncx = addToTocncx(tocncx, xmlChapter.find(".//h1").text, intTechnicalChapterNumber) + contentopf = addToContentopf(contentopf, "chapter" + str(intTechnicalChapterNumber) + ".xhtml", "chapter" + str(intTechnicalChapterNumber), "xml") + # Content_OPF hinzufügen + intTechnicalChapterNumber += 1 + +# Convert Facsimile-Parts +xmlParts = xmlEbookTree.findall("//div0") +for xmlPart in xmlParts: + print ("-------------") + print ("Working on Facsimile-Part") + print ("-------------") + # check if it has a child element EOAfacsimilepart + if bool(xmlPart.findall(".//EOAfacsimilepart")): + htmlChapter = etree.parse(SUPPORT_TEMPLATE_PATH + "Templates/epubchapter.xml", xmlChapterParser) + # Change EOAfacsimilepart into H1 + xmlHeadline = xmlPart.find(".//EOAfacsimilepart") + xmlHeadline.tag = "h1" + etree.strip_elements(xmlPart, "head") + # Aus div0 alle kinder auslesen und an htmlChapter dran hängen + xmlChildren = xmlPart.getchildren() + for xmlChild in xmlChildren: + # Using Deepcopy, coz a simple append will delete the original + htmlChapter.find(".//" + htmlns + "body").append(deepcopy(xmlChild)) + # Save Chapter + tmpFileName = os.getcwd() + "/CONVERT/epub/OEBPS/chapter" + (str(intTechnicalChapterNumber)) + ".xhtml" + tmpFile = open (tmpFileName, "w") + tmpResult = etree.tostring(htmlChapter, pretty_print=True, encoding="unicode") + tmpFile.write(tmpResult) + tmpFile.close() + # Save Chapter + tmpFileName = os.getcwd() + "/CONVERT/epub/OEBPS/chapter" + (str(intTechnicalChapterNumber)) + ".xhtml" + tmpFile = open (tmpFileName, "w") + tmpResult = etree.tostring(htmlChapter, pretty_print=True, encoding="unicode") + tmpFile.write(tmpResult) + tmpFile.close() + # Add to TocNCX + tocncx = addToTocncx(tocncx, xmlChapter.find("..//h1").text, intTechnicalChapterNumber) + contentopf = addToContentopf(contentopf, "chapter" + str(intTechnicalChapterNumber) + ".xhtml", "chapter" + str(intTechnicalChapterNumber), "xml") + # Content_OPF hinzufügen + intTechnicalChapterNumber += 1 + +# Saving toc.ncx +tmpFileName = os.getcwd() + "/CONVERT/epub/OEBPS/toc.ncx" +tmpFile = open (tmpFileName, "w") +tmpResult = etree.tostring(tocncx, pretty_print=True, encoding="unicode") +tmpFile.write(tmpResult) +tmpFile.close() + +# Saving content.opf +tmpFileName = os.getcwd() + "/CONVERT/epub/OEBPS/content.opf" +tmpFile = open (tmpFileName, "w") +tmpResult = etree.tostring(contentopf, pretty_print=True, encoding="unicode") +tmpFile.write(tmpResult) +tmpFile.close() + +############################################################################ +# Convert tralics-XML to Django Data Structure # +############################################################################ + +# Create django File Structure +if os.path.exists(os.getcwd() + "/CONVERT/django") == False: + os.mkdir(os.getcwd() + "/CONVERT/django") + os.mkdir(os.getcwd() + "/CONVERT/django/images") + os.mkdir(os.getcwd() + "/CONVERT/django/images/embedded") + os.mkdir(os.getcwd() + "/CONVERT/django/files") + +# Create empty xmlTree +xmlEOAdocument = etree.Element("EOAdocument") +xmlDjangoTree = etree.ElementTree(xmlEOAdocument) +etree.strip_attributes(xmlTree, "noindent") +# Remove temp-Tag +etree.strip_tags(xmlTree, "temp") + +# Write Temporary XML-Maintree +ergebnisdatei = open("Devel_django.xml", "w") +ergebnis = etree.tostring(xmlTree, pretty_print=True, encoding="unicode") +ergebnisdatei.write(ergebnis) +ergebnisdatei.close() + + +# Find all Chapters from the original tralics XML +xmlChapters = xmlTree.findall("//div1") + +def djangoParseObject(xmlElement, indent=False, listtype=None, listnumber=0, uid=None): + # Get Dictionaries of Numbers via Global Variables + global dictChapters + global dictFigures + global dictEquations + global dictSections + global dictFootnotes + global dictPagelabels + global dictTables + global dictLists + global intObjectNumber + # Check what kind of Element we have and change the data + if xmlElement.tag == "EOAtranscripted": + xmlResult = etree.Element("temp") + xmlEOATranscription = etree.Element("EOAtranscription") + xmlEOATranscription.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlLeftheader = xmlElement.find(".//Leftheader") + etree.strip_tags(xmlLeftheader, "p") + xmlEOATranscription.append(xmlLeftheader) + xmlRightheader = xmlElement.find(".//Rightheader") + etree.strip_tags(xmlRightheader, "p") + xmlEOATranscription.append(xmlRightheader) + xmlTranscriptedtext = xmlElement.find(".//EOAtranscriptedtext") + # change \n\n into

and pagebreak intto

to create some valid markup + strTranscriptedtext = etree.tostring(xmlTranscriptedtext, encoding="unicode") + #strTranscriptedtext = re.sub (r"\n\n", "

", str(strTranscriptedtext)) + #strTranscriptedtext = re.sub (r"

", "", strTranscriptedtext) + xmlLeftColumn = etree.Element("EOAtranscriptionleft") + xmlRightColumn = etree.Element("EOAtranscriptionright") + boolRightColumn = False + xmlTemp = etree.XML(str(strTranscriptedtext)) + for xmlElement in xmlTemp.iterchildren(): + if xmlElement.tag == "pagebreak": + boolRightColumn = True + continue + if boolRightColumn == False: + xmlLeftColumn.append(xmlElement) + if boolRightColumn == True: + xmlRightColumn.append(xmlElement) + xmlEOATranscription.append(xmlLeftColumn) + xmlEOATranscription.append(xmlRightColumn) + # Convert Images within the transcription + xmlFigures = xmlEOATranscription.findall(".//EOAfigurenonumber") + if xmlFigures is not None: + for xmlFigure in xmlFigures: + strImageFileString = xmlFigure.find(".//file").text + strImageFileString = strImageFileString.rstrip("\n") + strImageFileDir = os.path.dirname(strImageFileString) + strImageFileDir = re.sub("/", "", strImageFileDir) + strImageFileName = os.path.basename(strImageFileString) + strImageFileNamewoSuffix = os.path.splitext(strImageFileName)[0] + strCommand = GM_PATH + " convert " + os.getcwd() + "/" + strImageFileString + " -resize 250x250\\> " + os.getcwd() + "/CONVERT/django/images/embedded/" + strImageFileDir + strImageFileName + listArguments = shlex.split(strCommand) + subprocess.check_output(listArguments, shell=False) + tmpStrTail = xmlFigure.tail + xmlFigure.clear() + xmlFigure.tag = "img" + xmlFigure.set("src", strImageFileDir + strImageFileName) + xmlFigure.set("alt", "") + xmlResult.append(xmlEOATranscription) + elif xmlElement.tag == "EOAletterhead": + xmlResult = etree.Element("temp") + xmlEOAletterhead = etree.Element("EOAletterhead") + xmlEOAletterrecipient = xmlElement.find(".//Recipient") + xmlEOAletterhead.append(xmlEOAletterrecipient) + xmlEOAletterarchive = xmlElement.find(".//Archive") + xmlEOAletterhead.append(xmlEOAletterarchive) + xmlEOAletteradditional = xmlElement.find(".//Additional") + xmlEOAletterhead.append(xmlEOAletteradditional) + xmlEOAletterpages = xmlElement.find(".//Pages") + xmlEOAletterhead.append(xmlEOAletterpages) + xmlEOAletterhead.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlResult.append(xmlEOAletterhead) + elif xmlElement.findall(".//EOAfigurenonumber"): + xmlResult = etree.Element("temp") + # Create basic Element EOAfigurenonumber + xmlEOAfigure = etree.Element("EOAfigurenonumber") + # Copy Image + strImageFileString = xmlElement.find(".//file").text + strImageFileString = strImageFileString.rstrip("\n") + strImageFileDir = os.path.dirname(strImageFileString) + strImageFileDir = re.sub("/", "", strImageFileDir) + strImageFileName = os.path.basename(strImageFileString) + strImageFileNamewoSuffix = os.path.splitext(strImageFileName)[0] + shutil.copy(os.getcwd() + "/" + strImageFileString, os.getcwd() + "/CONVERT/django/images/" + strImageFileDir + strImageFileName) + xmlEOAfigure.set("file", strImageFileDir + strImageFileName) + xmlEOAfigure.set("width", xmlElement.find(".//width").text) + xmlEOAfigure.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlResult.append(xmlEOAfigure) + elif xmlElement.tag == "EOAfigure": + xmlResult = etree.Element("temp") + # Create basic Element EOAfigure + xmlEOAfigure = etree.Element("EOAfigure") + # Copy Image + strImageFileString = xmlElement.find(".//file").text + strImageFileString = strImageFileString.rstrip("\n") + strImageFileDir = os.path.dirname(strImageFileString) + strImageFileDir = re.sub("/", "", strImageFileDir) + strImageFileName = os.path.basename(strImageFileString) + strImageFileNamewoSuffix = os.path.splitext(strImageFileName)[0] + shutil.copy(os.getcwd() + "/" + strImageFileString, os.getcwd() + "/CONVERT/django/images/" + strImageFileDir + strImageFileName) + xmlEOAfigure.set("file", strImageFileDir + strImageFileName) + xmlEOAfigure.set("width", xmlElement.find(".//width").text) + xmlEOAfigure.set("order", str(intObjectNumber)) + intObjectNumber += 1 + # Insert visual Number and uid + strFigureNumber = dictFigures[xmlElement.find(".//anchor").get("id")] + xmlEOAfigure.set("number", strFigureNumber) + strFigureUID = xmlElement.find(".//anchor").get("id") + xmlEOAfigure.set("id", strFigureUID) + # Insert Caption + xmlEOAfigure.append(xmlElement.find(".//caption")) + xmlResult.append(xmlEOAfigure) + elif xmlElement.findall(".//EOAtable"): + xmlResult = etree.Element("EOAtable") + xmlRawTable = xmlElement.find(".//table") + xmlResult.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlResult.append(xmlRawTable) + # Copy Number, Label and Caption + if xmlElement.find(".//EOAtablecaption").text != "nonumber": + xmlResult.append(xmlElement.find(".//EOAtablecaption")) + xmlResult.set("label", xmlElement.find(".//EOAtablelabel").text) + xmlResult.set("number", dictTables[xmlElement.find(".//EOAtablelabel").text]) + xmlResult.set("id", xmlRawTable.get("id")) + else: + xmlElement.set("numbering", "false") + #if xmlElement.find(".//EOAtablelabel").text is not None: + # Transform width of Columns + strColumnString = xmlElement.find(".//EOAtablecolumns").text + strColumnString = re.sub(r"\|", "", strColumnString) + reMatchObjects = re.findall(r'([L|R|C].*?cm)', strColumnString) + intTableWidth = 0 + listColumnAlignments = [None] + listColumnWidths = [None] + intNumberOfColumns = 0 + for strColumnDefinition in reMatchObjects: + strColumnDefinition = strColumnDefinition.rstrip("cm") + strColumnAlignment = strColumnDefinition[0] + if strColumnAlignment == "L": + strColumnAlignment = "left" + if strColumnAlignment == "C": + strColumnAlignment = "center" + if strColumnAlignment == "R": + strColumnAlignment = "right" + listColumnAlignments.append(strColumnAlignment) + intColumnWidth = int(float(strColumnDefinition.lstrip("LRC")) * 75) + listColumnWidths.append(intColumnWidth) + intTableWidth += intColumnWidth + intNumberOfColumns += 1 + xmlRawTable.set("width", str(intTableWidth)) + # Figure out and deal with the Header + xmlHeader = xmlRawTable.find(".//row/cell/tableheader") + if xmlHeader is not None: + xmlHeader.text = "" + xmlHeader.getparent().text = xmlHeader.tail + xmlHeader.getparent().remove(xmlHeader) + xmlFirstRow = xmlRawTable.find(".//row") + xmlFirstRow.tag = "tr" + xmlFirstRowCells = xmlFirstRow.findall(".//cell") + for xmlFirstRowCell in xmlFirstRowCells: + xmlFirstRowCell.tag = "th" + # Now Deal with the rest of the rows + xmlTableRows = xmlRawTable.findall(".//row") + for xmlTableRow in xmlTableRows: + xmlTableCells = xmlTableRow.findall(".//cell") + intCurrentColumn = 1 + for xmlTableCell in xmlTableCells: + xmlTableCell.tag = "td" + xmlTableCell.set("align",listColumnAlignments[intCurrentColumn]) + xmlTableCell.set("style","width: " + str(listColumnWidths[intCurrentColumn]) + ";") + # Deal with multicolumn + if xmlTableCell.get("cols") is not None: + xmlTableCell.set("colspan", xmlTableCell.get("cols")) + if intCurrentColumn > len(xmlTableCells): + intCurrentColumn = 1 + # Deal with multicolumn again, increase intCurrentColumn by the columns being spanned + elif xmlTableCell.get("cols") is not None: + intCurrentColumn = intCurrentColumn + int(xmlTableCell.get("cols")) + del xmlTableCell.attrib["cols"] + else: + intCurrentColumn += 1 + xmlTableRow.tag = "tr" + xmlTableRow.set("valign", "top") + elif xmlElement.tag == "list" and xmlElement.get('type') != 'description': + xmlResult = etree.Element("temp") + if xmlElement.get('type') == 'ordered': + # Change first item into EOAlistfirstitem + xmlFirstItem = xmlElement.find("..//item") + xmlFirstItemElement = xmlFirstItem.getchildren()[0] + xmlResult.append(djangoParseObject(xmlFirstItemElement,indent=True, listtype="ordered", listnumber="1", uid=xmlFirstItem.get("id"))) + # Process Child Elements which are Part of this item + if len(xmlFirstItem.getchildren()) >= 1: + for xmlChild in xmlFirstItem.iterchildren(): + xmlResult.append(djangoParseObject(xmlChild,indent=True)) + xmlFirstItem.getparent().remove(xmlFirstItem) + # Process remaining items in this list + tmpIntNumber = 2 + for xmlItem in xmlElement.iterchildren(): + xmlItemElement = xmlItem.getchildren()[0] + xmlResult.append(djangoParseObject(xmlItemElement,indent=True,listtype="ordered",listnumber=str(tmpIntNumber), uid=xmlItem.get("id"))) + tmpIntNumber += 1 + if len(xmlItem.getchildren()) >= 1: + for xmlChild in xmlItem.iterchildren(): + xmlResult.append(djangoParseObject(xmlChild, indent=True)) + xmlItem.getparent().remove(xmlItem) + if xmlElement.get('type') == 'simple': + # Change first item into EOAlistfirstitem + xmlFirstItem = xmlElement.find("..//item") + xmlFirstItemElement = xmlFirstItem.getchildren()[0] + xmlResult.append(djangoParseObject(xmlFirstItemElement,indent=True,listtype="unordered", listnumber="-")) + # Process Child Elements which are Part of this item + if len(xmlFirstItem.getchildren()) >= 1: + for xmlChild in xmlFirstItem.iterchildren(): + xmlResult.append(djangoParseObject(xmlChild,indent=True)) + xmlFirstItem.getparent().remove(xmlFirstItem) + for xmlItem in xmlElement.iterchildren(): + xmlItemElement = xmlItem.getchildren()[0] + xmlResult.append(djangoParseObject(xmlItemElement,indent=True)) + if len(xmlItem.getchildren()) >= 1: + for xmlChild in xmlItem.iterchildren(): + xmlResult.append(djangoParseObject(xmlChild,indent=True)) + xmlItem.getparent().remove(xmlItem) + elif xmlElement.tag == "list" and xmlElement.get('type') == 'description': + xmlResult = etree.Element("temp") + while len(xmlElement.getchildren()) != 0: + xmlDescription = etree.Element("EOAdescription") + xmlDescription.set("order", str(intObjectNumber)) + xmlLabel = xmlElement.getchildren()[0] + print (etree.tostring(xmlLabel)) + xmlItem = xmlElement.getchildren()[1] + if len(xmlItem.getchildren()) > 0: + xmlContent = xmlItem.getchildren()[0] + else: + xmlContent = etree.Element("p") + xmlLabel.tag = "description" + xmlDescription.append(xmlLabel) + xmlDescription.append(xmlContent) + xmlResult.append(xmlDescription) + intObjectNumber += 1 + if len(xmlItem.getchildren()) > 0: + for xmlChild in xmlItem.iterchildren(): + xmlResult.append(djangoParseObject(xmlChild,indent=True)) + xmlItem.getparent().remove(xmlItem) + elif xmlElement.tag == "theorem": + xmlTheoremHead = xmlElement.find(".//head") + xmlTheoremText = xmlElement.find(".//p") + strTheoremNumber = xmlElement.get("id-text") + strTheoremID = xmlElement.get("id") + xmlResult = etree.Element("EOAtheorem") + xmlResult.append(xmlTheoremHead) + xmlResult.append(xmlTheoremText) + xmlResult.set("order", str(intObjectNumber)) + xmlResult.set("number", strTheoremNumber) + xmlResult.set("uid", strTheoremID) + intObjectNumber += 1 + elif xmlElement.findall(".//EOAequationarray"): + xmlResult = etree.Element("temp") + for xmlEquation in xmlElement.findall(".//EOAequation"): + xmlEOAequation = etree.Element("EOAequation") + xmlEOAequation.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlEOAequation.set("number", xmlEquation.get("number")) + xmlEOAequation.set("filename", xmlEquation.get("filename")) + if xmlEquation.get("label") is not None: + xmlEOAequation.set("label", xmlEquation.get("label")) + shutil.copy(os.getcwd() + "/items/" + xmlEquation.get("filename"), os.getcwd() + "/CONVERT/django/images/") + xmlEOAequation.set("TeX", xmlEquation.get("TeX")) + if xmlEquation.get("label") is not None: + xmlEOAequation.set("label", xmlEquation.get("label")) + xmlResult.append(xmlEOAequation) + elif xmlElement.findall(".//EOAequationarraynonumber"): + xmlResult = etree.Element("temp") + for xmlEquation in xmlElement.findall(".//EOAequationarraynonumber"): + xmlEOAequation = etree.Element("EOAequation") + xmlEOAequation.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlEOAequation.set("number", "") + xmlEOAequation.set("filename", xmlEquation.get("filename")) + shutil.copy(os.getcwd() + "/items/" + xmlEquation.get("filename"), os.getcwd() + "/CONVERT/django/images/") + xmlEOAequation.set("TeX", xmlEquation.get("TeX")) + xmlResult.append(xmlEOAequation) + elif xmlElement.tag == "EOAequationnonumber": + # Process one EOAequation which is not encapsulated + xmlResult = etree.Element("EOAequation") + xmlResult.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlResult.set("filename", xmlElement.get("filename")) + xmlResult.set("TeX", xmlElement.get("TeX")) + shutil.copy(os.getcwd() + "/items/" + xmlElement.get("filename"), os.getcwd() + "/CONVERT/django/images/") + xmlResult.set("number", "") + elif xmlElement.findall(".//EOAequation"): + # Process various Equations which may be encapsulated within

+ xmlEquations = xmlElement.findall(".//EOAequation") + xmlResult = etree.Element("temp") + for xmlEquation in xmlEquations: + # Create basic Element EOAequation + xmlEOAequation = etree.Element("EOAequation") + xmlEOAequation.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlEOAequation.set("number", xmlEquation.get("number")) + xmlEOAequation.set("TeX", xmlEquation.get("TeX")) + if xmlEquation.get("uid") is not None: + xmlEOAequation.set("uid", xmlEquation.get("uid")) + shutil.copy(os.getcwd() + "/items/" + xmlEquation.get("filename"), os.getcwd() + "/CONVERT/django/images/") + xmlEOAequation.set("filename", xmlEquation.get("filename")) + xmlResult.append(xmlEOAequation) + elif xmlElement.tag == "EOAequation": + # Process one EOAequation which is not encapsulated + xmlResult = etree.Element("EOAequation") + xmlResult.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlResult.set("number", xmlElement.get("number")) + xmlResult.set("TeX", xmlElement.get("TeX")) + if xmlElement.get("uid") is not None: + xmlResult.set("uid", xmlElement.get("uid")) + shutil.copy(os.getcwd() + "/items/" + xmlElement.get("filename"), os.getcwd() + "/CONVERT/django/images/") + xmlResult.set("filename", xmlElement.get("filename")) + elif xmlElement.tag == "div4": + xmlResult = etree.Element("EOAsubsubsection") + xmlResult.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlResult.append(xmlElement.find("head")) + for xmlChild in xmlElement.iterchildren(): + xmlResult.append(djangoParseObject(xmlChild)) + else: + xmlElement.tag = "EOAparagraph" + xmlElement.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlResult = xmlElement + if indent==True: + xmlResult.set("indent", "True") + if listtype != None: + xmlResult.set("listtype", listtype) + if listnumber != 0: + xmlResult.set("listnumber", listnumber) + if uid != None: + xmlResult.set("id", uid) + return xmlResult + +def djangoParseHeadline(xmlElement): + # Parse EOAauthor and append it to the Chapter Information + xmlAuthors = xmlElement.find(".//EOAauthor") + if xmlAuthors is not None: + strAuthors = xmlAuthors.text + xmlElement.remove(xmlAuthors) + strAuthors = re.sub("(, and | and | und )", ",", strAuthors) + listAuthors = re.split("\,", strAuthors) + print (listAuthors) + if len(listAuthors) >= 1: + for i in range(len(listAuthors)): + xmlAuthor = etree.Element("EOAauthor") + # Remove Spaces before and after AuthorString + if listAuthors[i][0] == " ": + strAuthor = listAuthors[i][1:] + elif listAuthors[i].endswith(" "): + strAuthor = listAuthors[i][:-1] + else: + strAuthor = listAuthors[i] + xmlAuthor.text = strAuthor + xmlElement.append(xmlAuthor) + return xmlElement + +# Iterate over Chapters, Sections, Subsections, and Subsubsections and +# Put all on one level: EOAchapter +intChapterNumber = 1 +listPartIDs = [] +for xmlChapter in xmlChapters: + intObjectNumber = 1 + # Process Chapter Title + xmlEOAchapter = etree.Element("EOAchapter") + xmlEOAchapter.set("type","regular") + xmlEOAchapter.set("language", xmlChapter.get("language")) + xmlEOAchapter.set("order", str(intChapterNumber)) + if xmlChapter.get("rend") != "nonumber": + xmlEOAchapter.set("id", xmlChapter.get("id")) + xmlChapterHeadline = xmlChapter.find(".//head") + if xmlChapter.get("id") in dictChapters: + xmlEOAchapter.set("number", dictChapters[xmlChapter.get("id")]) + else: + xmlEOAchapter.set("number", "") + print ("-----------------------------------------------------") + print (gettext(xmlChapterHeadline)) + xmlEOAchapter.append(djangoParseHeadline(xmlChapterHeadline)) + # Deal with EOAauthor + if xmlChapter.find(".//EOAauthor") is not None: + xmlEOAchapter.append(xmlChapter.find(".//EOAauthor")) + # Attache enclosing Part to Chapter, see django structure for this purpose + if xmlChapter.getparent().tag == "div0": + if xmlChapter.getparent().get("id") not in listPartIDs: + listPartIDs.append(xmlChapter.getparent().get("id")) + xmlPartHeadline = xmlChapter.getparent().find("head") + xmlPartHeadline.tag = "EOAparthtml" + xmlEOAchapter.append(xmlPartHeadline) + # Append Chapter to xmlEOAdocument + xmlEOAdocument.append(xmlEOAchapter) + # iterate over children of Chapter + for xmlChapterChild in xmlChapter.iterchildren(): + if xmlChapterChild.tag == "div2": + # Process Section Title + xmlEOAsection = etree.Element("EOAsection") + xmlEOAsection.set("order", str(intObjectNumber)) + if xmlChapterChild.get("rend") != "nonumber": + xmlEOAsection.set("id", xmlChapterChild.get("id")) + xmlEOAsection.set("number", dictSections[xmlChapterChild.get("id")]) + intObjectNumber += 1 + xmlHead = xmlChapter.find(".//head") + xmlEOAsection.append(djangoParseHeadline(xmlHead)) + xmlEOAchapter.append(xmlEOAsection) + # Iterate over Children of Section + for xmlSectionChild in xmlChapterChild.iterchildren(): + if xmlSectionChild.tag == "div3": + # Process Subsection Title + xmlEOAsubsection = etree.Element("EOAsubsection") + xmlEOAsubsection.set("order", str(intObjectNumber)) + if xmlSectionChild.get("rend") != "nonumber": + xmlEOAsubsection.set("id", xmlSectionChild.get("id")) + xmlEOAsubsection.set("number", dictSections[xmlSectionChild.get("id")]) + intObjectNumber += 1 + xmlHead = xmlSectionChild.find(".//head") + xmlEOAsubsection.append(djangoParseHeadline(xmlHead)) + xmlEOAchapter.append(xmlEOAsubsection) + # Iterate over children of Subsection + for xmlSubsectionChild in xmlSectionChild.iterchildren(): + if xmlSubsectionChild.tag == "div4": + # Process Subsubsection Title + xmlEOAsubsubsection = etree.Element("EOAsubsubsection") + xmlEOAsubsubsection.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlHead = xmlSubsectionChild.find(".//head") + xmlEOAsubsubsection.append(djangoParseHeadline(xmlHead)) + xmlEOAchapter.append(xmlEOAsubsubsection) + # Iterate over children of Subsubsection + for xmlSubsubsectionChild in xmlSubsectionChild.iterchildren(): + xmlEOAchapter.append(djangoParseObject(xmlSubsubsectionChild)) + else: + xmlEOAchapter.append(djangoParseObject(xmlSubsectionChild)) + elif xmlSectionChild.tag == "div4": + # Process Subsubsection Title + xmlEOAsubsubsection = etree.Element("EOAsubsubsection") + xmlEOAsubsubsection.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlHead = xmlSectionChild.find(".//head") + xmlEOAsubsubsection.append(djangoParseHeadline(xmlHead)) + xmlEOAchapter.append(xmlEOAsubsubsection) + # Iterate over children of Subsubsection + for xmlSubsubsectionChild in xmlSectionChild.iterchildren(): + xmlEOAchapter.append(djangoParseObject(xmlSubsubsectionChild)) + else: + xmlEOAchapter.append(djangoParseObject(xmlSectionChild)) + else: + xmlEOAchapter.append(djangoParseObject(xmlChapterChild)) + intChapterNumber += 1 + +print ("----------------------------------------------") +print ("Processing Facsimile Parts") + +listModes = ["text", "textPollux", "xml"] +strBasicURL = "http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/interface/page-fragment.xql?document=" +parserECHO = etree.XMLParser() + +xmlParts = xmlTree.findall("//div0") +intFacNumber = 1 +for xmlPart in xmlParts: + intObjectNumber = 1 + intFacPartNumber = 1 + if xmlPart.find(".//EOAfacsimilepart") is None: + continue + xmlEOAfacsimilepart = etree.Element("EOAfacsimilepart") + xmlEOAfacsimilepart.set("order", str(intChapterNumber)) + xmlEOAfacsimileparthead = xmlPart.find(".//head") + for xmlChild in xmlEOAfacsimileparthead: + if xmlChild.tag == "hi": + xmlChild.tag = "em" + del xmlChild.attrib["rend"] + xmlEOAfacsimilepart.append(xmlEOAfacsimileparthead) + intChapterNumber += 1 + xmlEOAdocument.append(xmlEOAfacsimilepart) + xmlFacsimilepages = xmlPart.findall(".//EOAfacsimilepage") + intFacPageNumber = 1 + for xmlFacsimilepage in xmlFacsimilepages: + strImageFile = xmlFacsimilepage.find(".//file").text + strLabel = xmlFacsimilepage.find(".//label").text + strPagenumber = xmlFacsimilepage.find(".//pagenumber").text or "" + xmlEOAfacsimilepage = etree.Element("EOAfacsimilepage") + xmlEOAfacsimilepage.set("order", str(intObjectNumber)) + # TODO: Hier noch irgendwie (fehlendem) Suffix der Datei umgehen. Und ggf. Dateien Konvertieren + strImageFile = strImageFile.rstrip("\n") + strImageFileDir = os.path.dirname(strImageFile) + strImageFileDir = re.sub("/", "", strImageFileDir) + strImageFileName = os.path.basename(strImageFile) + shutil.copy(os.getcwd() + "/" + strImageFile, os.getcwd() + "/CONVERT/django/images/" + strImageFileDir + strImageFileName) + intObjectNumber += 1 + # Download transcription for this Page + if xmlFacsimilepage.find(".//fulltext").text is not None: + print ("Ein Link zum Volltext wurde gefunden") + strFacsimileURL = re.split(",", xmlFacsimilepage.find(".//fulltext").text)[0] + strFacsimilePage = re.split(",", xmlFacsimilepage.find(".//fulltext").text)[1] + for strMode in listModes: + strURL = strBasicURL + strFacsimileURL + "&pn=" + strFacsimilePage + "&mode=" + strMode + print ("Processing Facsimile : " + strURL) + xmlECHOtree = etree.parse(strURL, parserECHO) + # Remove ECHO-namespaces + objectify.deannotate(xmlECHOtree, xsi_nil=True) + etree.cleanup_namespaces(xmlECHOtree) + xmlDivs = xmlECHOtree.findall(".//div") + for xmlDiv in xmlDivs: + if xmlDiv.get("class") == "pageContent": + # Create new EOA-Element + xmlEOAfacsimileelement = etree.Element("EOAfacsimileelement") + xmlEOAfacsimileelement.set("type", strMode) + # Fix Images in the

-Element + xmlImages = xmlDiv.findall(".//img") + intFacImgNumber = 1 + for xmlImage in xmlImages: + strImageSrc = xmlImage.get("src") + strCommand = "curl " + strImageSrc + " -o CONVERT/django/images/facsupplements_" + str(intFacNumber) + "_" + str(intFacPageNumber) + "_" + str(intFacImgNumber) + ".jpg" + listArguments = shlex.split(strCommand) + try: + exeShell = subprocess.check_output(listArguments, shell=False, universal_newlines=True) + xmlImage.set("src", "facsupplements_" + str(intFacNumber) + "_" + str(intFacPageNumber) + "_" + str(intFacImgNumber) + ".jpg") + except: + xmlImage.tag = "temp" + intFacImgNumber += 1 + # Change of scr of img-Element + xmlEOAfacsimileelement.append(xmlDiv) + xmlEOAfacsimilepage.append(xmlEOAfacsimileelement) + intFacPageNumber += 1 + xmlEOAfacsimilepage.set("file", strImageFileDir + strImageFileName) + xmlEOAfacsimilepage.set("label", str(strLabel)) + xmlEOAfacsimilepage.set("pagenumber", str(strPagenumber)) + xmlEOAfacsimilepart.append(xmlEOAfacsimilepage) + intFacNumber =+ 1 +etree.strip_tags(xmlDjangoTree, "temp") +print ("----------------------------------------------") +print ("Processing and linking Footnotes for django") + +xmlEOAchapters = xmlEOAdocument.findall(".//EOAchapter") +for xmlEOAchapter in xmlEOAchapters: + if len(xmlEOAchapter.findall(".//note")) == 0: + continue + # Find out running order of last item the chapter + # Hier pro FN zunächst die EOAequationnonumber in

korrigieren + # Dann pro FN die Kindelemente abarbeiten und an die neue FN dran hängen + # Ggf. aufpassen, ob ein Absatz mit indent versehen ist, dann blockquote drum herum machen + xmlElement = xmlEOAchapter[(len(xmlEOAchapter)-1)] + print (etree.tostring(xmlElement)) + intObjectNumber = (int(xmlElement.get("order")) + 1) + intFootnoteNumber = 1 + xmlResult = etree.Element("temp") + xmlEOAsection = etree.Element("EOAsection") + xmlEOAsection.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlHead = etree.Element("head") + xmlHead.text = dictLangFootnotes[xmlEOAchapter.get("language")] + xmlEOAsection.append(xmlHead) + xmlResult.append(xmlEOAsection) + xmlFootnotes = xmlEOAchapter.findall(".//note") + for xmlFootnote in xmlFootnotes: + xmlFootnoteContent = xmlFootnote.getchildren() + strFootnoteText = xmlFootnote.text or "" + tmpTail = xmlFootnote.tail + tmpStrUID = xmlFootnote.get("id") + xmlFootnote.clear() + xmlFootnote.tail = tmpTail + xmlFootnote.tag = "sup" + xmlFootnote.set("class", "footnote") + xmlFootnoteLink = etree.Element("a") + xmlFootnoteLink.set("href", "#fn" + str(intFootnoteNumber)) + xmlFootnoteLink.text = str(intFootnoteNumber) + xmlFootnote.append(xmlFootnoteLink) + xmlEOAfootnote = etree.Element("EOAfootnote") + xmlEOAfootnote.set("order", str(intObjectNumber)) + intObjectNumber += 1 + xmlEOAfootnote.set("number", str(intFootnoteNumber)) + for xmlParent in xmlFootnote.iterancestors(): + if xmlParent.get("order") is not None: + strFootnoteAnchorNumber = xmlParent.get("order") + break + xmlEOAfootnote.set("anchor", strFootnoteAnchorNumber) + xmlEOAfootnote.set("id", tmpStrUID) + xmlEOAfootnote.text = strFootnoteText + for xmlElement in xmlFootnoteContent: + if xmlElement.tag == "EOAequationnonumber": + shutil.copy(os.getcwd() + "/items/" + xmlElement.get("filename"), os.getcwd() + "/CONVERT/django/images/") + xmlEOAfootnote.append(xmlElement) + xmlResult.append(xmlEOAfootnote) + intFootnoteNumber += 1 + xmlEOAchapter.append(xmlResult) + +# Remove temp-Tag +etree.strip_tags(xmlDjangoTree, "temp") + +print ("----------------------------------------------") +print ("Processing various Elements") + +for xmlEOAchapter in xmlEOAchapters: + xmlEmphasized = xmlEOAchapter.findall(".//hi") + for xmlEmph in xmlEmphasized: + if xmlEmph.get("rend") == "it": + xmlEmph.tag = "em" + del xmlEmph.attrib["rend"] + xmlHyperlinks = xmlEOAchapter.findall(".//xref") + for xmlHyperlink in xmlHyperlinks: + strURL = xmlHyperlink.get('url') + if strURL.startswith("http://") == False: + strURL = "http://" + strURL + xmlHyperlink.tag = "a" + del xmlHyperlink.attrib["url"] + xmlHyperlink.set("href", strURL) + etree.strip_elements(xmlHyperlink, with_tail=True, *['allowbreak']) + xmlHyperlink.text = strURL + # Convert bold text + xmlBolds = xmlEOAchapter.findall(".//hi") + for xmlBold in xmlBolds: + if xmlBold.get("rend") == "bold": + xmlBold.tag = "b" + del xmlBold.attrib["rend"] + # Convert EOAup to + xmlUps = xmlEOAchapter.findall(".//EOAup") + for xmlUp in xmlUps: + xmlUp.tag = "sup" + # Convert EOAdown to + xmlDowns = xmlEOAchapter.findall(".//EOAdown") + for xmlDown in xmlDowns: + xmlDown.tag = "sub" + # Convert EOAst to + xmlStrikeouts = xmlEOAchapter.findall(".//EOAst") + for xmlStrikeout in xmlStrikeouts: + xmlStrikeout.tag = "span" + xmlStrikeout.set("style", "text-decoration: line-through;") + # Convert letter-spacing into something nice + xmlLetterspaceds = xmlEOAchapter.findall(".//EOAls") + for xmlLetterspaced in xmlLetterspaceds: + xmlLetterspaced.tag = "span" + xmlLetterspaced.set("style", "letter-spacing: 0.5em;") + # Convert letter-spacing into something nice + xmlCaps = xmlEOAchapter.findall(".//EOAcaps") + for xmlCap in xmlCaps: + xmlCap.tag = "span" + xmlCap.set("style", "font-variant:small-caps;") + # Convert EOAineq into appropriate IMG-Tags + xmlInlineEquations = xmlEOAchapter.findall(".//EOAineq") + for xmlInlineEquation in xmlInlineEquations: + xmlInlineEquation.tag = "img" + xmlInlineEquation.set("class", "EOAineq") + xmlInlineEquation.set("alt", "") + shutil.copy(os.getcwd() + "/items/" + xmlInlineEquation.get("src"), os.getcwd() + "/CONVERT/django/images/" + xmlInlineEquation.get("src")) + # Convert EOAinline into appropriate IMG-Tags + xmlInlineElements = xmlEOAchapter.findall(".//EOAinline") + for xmlInlineElement in xmlInlineElements: + xmlInlineElement.tag = "img" + xmlInlineElement.set("class", "EOAinline") + xmlInlineElement.set("alt", "") + xmlInlineElement.set("class", "eoainlineimage") + strInlineElementFilePath = xmlInlineElement.text + strInlineElementFileName = os.path.basename(strInlineElementFilePath) + strInlineElementDirName = os.path.dirname(strInlineElementFilePath) + xmlInlineElement.text = None + xmlInlineElement.set("src", strInlineElementDirName + strInlineElementFileName) + shutil.copy(os.getcwd() + "/" + strInlineElementDirName + "/" + strInlineElementFileName, os.getcwd() + "/CONVERT/django/images/embedded/" + strInlineElementDirName + strInlineElementFileName) + strNewImagePath = os.getcwd() + "/CONVERT/django/images/embedded/" + strInlineElementDirName + strInlineElementFileName + strCommand = GM_PATH + " convert " + strNewImagePath + " -resize 20x20 " + strNewImagePath + listArguments = shlex.split(strCommand) + subprocess.check_output(listArguments, shell=False) + # Change EOAcitenumeric into a span to create approriate link + xmlEOAcitenumerics = xmlEOAchapter.findall(".//EOAcitenumeric") + for xmlEOAcitenumeric in xmlEOAcitenumerics: + xmlEOAcitenumeric.tag = "span" + xmlEOAcitenumeric.set("class", "citation") + xmlEOAcitenumeric.set("rel", "popover") + # Change EOAciteauthoryear into a span to create approriate link + xmlEOAciteauthoryears = xmlEOAchapter.findall(".//EOAciteauthoryear") + for xmlEOAciteauthoryear in xmlEOAciteauthoryears: + xmlEOAciteauthoryear.tag = "span" + xmlEOAciteauthoryear.set("class", "citation") + xmlEOAciteauthoryear.set("rel", "popover") + # Change EOAciteauthoryear into a span to create approriate link + xmlEOAciteyears = xmlEOAchapter.findall(".//EOAciteyear") + for xmlEOAciteyear in xmlEOAciteyears: + xmlEOAciteyear.tag = "span" + xmlEOAciteyear.set("class", "citation") + xmlEOAciteyear.set("rel", "popover") + # Change EOAciteauthoryear into a span to create approriate link + xmlEOAcitemanuals = xmlEOAchapter.findall(".//EOAcitemanual") + for xmlEOAcitemanual in xmlEOAcitemanuals: + xmlEOAcitemanual.tag = "span" + xmlEOAcitemanual.set("class", "citation") + xmlEOAcitemanual.set("rel", "popover") + +print ("----------------------------------------------") +print ("Processing Cross References") + +# Substitute References with their targets (wit links) +for xmlEOAchapter in xmlEOAchapters: + xmlReferences = xmlEOAchapter.findall(".//EOAref") + for xmlReference in xmlReferences: + strResult = "!!! Cross Reference !!!" + strChapterOrder = "" + strObjectOrder = "" + xmlReferenceLabel = xmlReference.find("Label") + xmlReferenceLabelText = xmlReferenceLabel.text + xmlReferenceRef = xmlReference.find("ref") + xmlReferenceRefTarget = xmlReferenceRef.get("target") + if xmlReferenceLabelText in dictEquations: + # Grab Number from Dictionary + strResult = dictEquations[xmlReferenceLabelText] + # Go through all equations and find the corresponding Equation + xmlEOAequations = xmlEOAdocument.findall(".//EOAequation") + for xmlEOAequation in xmlEOAequations: + tmpReferenceLabelText = xmlEOAequation.get("label") + if xmlReferenceLabelText == tmpReferenceLabelText: + print ("Erfolgreich Verweis auf Array-Formel gefunden:" + strResult) + for xmlParent in xmlEOAequation.iterancestors(): + if xmlParent.tag == "EOAchapter": + strChapterOrder = xmlParent.get("order") + strObjectOrder = xmlEOAequation.get("order") + if xmlReferenceRefTarget in dictEquations: + # Grab Number from Dictionary + strResult = dictEquations[xmlReferenceRefTarget] + # Go through all equations and find the corresponding Equation + xmlEOAequations = xmlEOAdocument.findall(".//EOAequation") + for xmlEOAequation in xmlEOAequations: + tmpReferenceRefTarget = xmlEOAequation.get("uid") + if xmlReferenceRefTarget == tmpReferenceRefTarget: + print ("Erfolgreich Verweis auf normale Formel gefunden: " + strResult) + for xmlParent in xmlEOAequation.iterancestors(): + if xmlParent.tag == "EOAchapter": + strChapterOrder = xmlParent.get("order") + strObjectOrder = xmlEOAequation.get("order") + if xmlReferenceRefTarget in dictLists: + print ("Verweis auf Liste gefunden") + strResult = dictLists[xmlReferenceRefTarget] + xmlEOAlistitem = xmlEOAdocument.xpath("//EOAchapter/*[contains(@id, $targetuid)]", targetuid = xmlReferenceRefTarget)[0] + for xmlParent in xmlEOAlistitem.iterancestors(): + if xmlParent.tag == "EOAchapter": + strChapterOrder = xmlParent.get("order") + strObjectOrder = xmlEOAlistitem.get("order") + if xmlReferenceRefTarget in dictChapters: + print ("Verweis auf Kapitel gefunden") + strResult = dictChapters[xmlReferenceRefTarget] + for xmlEOAchapter in xmlEOAdocument.findall(".//EOAchapter"): + if xmlEOAchapter.get("id") == xmlReferenceRefTarget: + print ("Erfolgreich Verweis auf ein Kapitel bearbeitet: " + strResult) + strObjectOrder = "top" + strChapterOrder = xmlEOAchapter.get("order") + if xmlReferenceRefTarget in dictTheorems: + print ("Verweis auf ein Theorem gefunden") + strResult = dictTheorems[xmlReferenceRefTarget] + for xmlEOAtheorem in xmlEOAdocument.findall(".//EOAtheorem"): + if xmlEOAtheorem.get("uid") == xmlReferenceRefTarget: + print ("Erfolgrech Verweis auf ein Theorem bearbeitet: " + strResult) + for xmlParent in xmlEOAtheorem.iterancestors(): + if xmlParent.tag == "EOAchapter": + strObjectOrder = xmlEOAtheorem.get("order") + strChapterOrder = xmlParent.get("order") + if xmlReferenceRefTarget in dictSections: + print ("Verweis auf Section gefunden") + strResult = dictSections[xmlReferenceRefTarget] + xmlEOAsections = xmlEOAdocument.findall(".//EOAsection") + for xmlEOAsection in xmlEOAsections: + tmpReferenceRefTarget = xmlEOAsection.get("id") + if xmlReferenceRefTarget == tmpReferenceRefTarget: + print ("Erfolgreich Verweis auf eine Section bearbeitet: " + strResult) + for xmlParent in xmlEOAsection.iterancestors(): + if xmlParent.tag == "EOAchapter": + strChapterOrder = xmlParent.get("order") + strObjectOrder = xmlEOAsection.get("order") + xmlEOAsubsections = xmlEOAdocument.findall(".//EOAsubsection") + for xmlEOAsubsection in xmlEOAsubsections: + tmpReferenceRefTarget = xmlEOAsubsection.get("id") + if xmlReferenceRefTarget == tmpReferenceRefTarget: + print ("Erfolgreich Verweis auf eine Sub-Section bearbeitet: " + strResult) + for xmlParent in xmlEOAsubsection.iterancestors(): + if xmlParent.tag == "EOAchapter": + strChapterOrder = xmlParent.get("order") + strObjectOrder = xmlEOAsubsection.get("order") + if xmlReferenceRefTarget in dictFigures: + print ("Verweis auf Abbildung gefunden") + strResult = dictFigures[xmlReferenceRefTarget] + xmlEOAfigures = xmlEOAdocument.findall(".//EOAfigure") + for xmlEOAfigure in xmlEOAfigures: + tmpReferenceRefTarget = xmlEOAfigure.get("id") + if xmlReferenceRefTarget == tmpReferenceRefTarget: + print ("Erfolgreich Verweis auf eine Abbildung bearbeitet: " + strResult) + for xmlParent in xmlEOAfigure.iterancestors(): + if xmlParent.tag == "EOAchapter": + strChapterOrder = xmlParent.get("order") + strObjectOrder = xmlEOAfigure.get("order") + if xmlReferenceRefTarget in dictFootnotes: + print ("Verweis auf Fussnote gefunden") + strResult = dictFootnotes[xmlReferenceRefTarget] + xmlEOAfootnotes = xmlEOAdocument.findall(".//EOAfootnote") + for xmlEOAfootnote in xmlEOAfootnotes: + tmpReferenceRefTarget = xmlEOAfootnote.get("id") + if xmlReferenceRefTarget == tmpReferenceRefTarget: + print ("Erfolgreich Verweis auf eine Fussnote bearbeitet: " + strResult) + for xmlParent in xmlEOAfootnote.iterancestors(): + if xmlParent.tag == "EOAchapter": + strChapterOrder = xmlParent.get("order") + strObjectOrder = xmlEOAfootnote.get("order") + if xmlReferenceLabelText in dictTables: + print ("Verweis auf Tabelle gefunden") + strResult = dictTables[xmlReferenceLabelText] + xmlEOAtables = xmlEOAdocument.findall(".//EOAtable") + for xmlEOAtable in xmlEOAtables: + tmpReferenceRefTarget = xmlEOAtable.get("label") + if xmlReferenceLabelText == tmpReferenceRefTarget: + print ("Erfolgreich Verweis auf eine Tabelle bearbeitet:" + strResult) + for xmlParent in xmlEOAtable.iterancestors(): + if xmlParent.tag == "EOAchapter": + strChapterOrder = xmlParent.get("order") + strObjectOrder = xmlEOAtable.get("order") + tmpTail = xmlReference.tail or "" + xmlReference.clear() + xmlReference.text = strResult + xmlReference.tail = tmpTail + xmlReference.tag = "a" + xmlReference.set("href", "../" + strChapterOrder + "/index.html#" + strObjectOrder) + +print ("----------------------------------------------") +print ("Processing Page References") + +for xmlEOAchapter in xmlEOAchapters: + xmlPageReferences = xmlEOAchapter.findall(".//EOApageref") + strResult = "!!! Page Reference !!!" + for xmlReference in xmlPageReferences: + xmlReferenceLabel = xmlReference.find("Label") + xmlReferenceLabelText = xmlReferenceLabel.text + xmlReferenceRef = xmlReference.find("ref") + xmlReferenceRefTarget = xmlReferenceRef.get("target") + if xmlReferenceLabelText in dictPagelabels: + print ("Verweis auf Seite gefunden: " + xmlReferenceLabelText) + strResult = dictPagelabels[xmlReferenceLabelText] + xmlReference.text = strResult + for xmlChild in xmlReference.iterchildren(): + xmlReference.remove(xmlChild) + # Check, if EOApageref points to a Facsimile-Page + # If yes, make a href to the facsimile + xmlEOAfacsimilepages = xmlEOAdocument.findall(".//EOAfacsimilepage") + for xmlEOAfacsimilepage in xmlEOAfacsimilepages: + if xmlEOAfacsimilepage.get("label") == xmlReferenceLabelText: + print ("Querverweis auf ein Facsimile gefunden") + xmlReference.tag = "a" + strPartOrder = xmlEOAfacsimilepage.getparent().get("order") + strFacsimileOrder = xmlEOAfacsimilepage.get("order") + print (strFacsimileOrder) + xmlReference.set("href", "../" + strPartOrder + "/" + strFacsimileOrder + ".html") + +print ("----------------------------------------------") +print ("Normalizing Index Entries") + +for xmlEOAchapter in xmlEOAchapters: + xmlEOAindexs = xmlEOAchapter.xpath(".//EOAindex | .//EOAindexperson | .//EOAindexlocation") + for xmlEOAindex in xmlEOAindexs: + strEOAindextext = xmlEOAindex.text + xmlEOAindex.text = None + listFirstPart = re.split('\|', strEOAindextext) + tmpEntry = listFirstPart[0] + listSecondPart = re.split('\!', tmpEntry) + strMainEntry = listSecondPart[0] + # Check if a sortkey is present via @ + listSortKey = re.split('@', strMainEntry) + if len(listSortKey) == 2: + xmlEOAindex.set("main", listSortKey[0]) + xmlEOAindex.set("display", listSortKey[1]) + else: + xmlEOAindex.set("main", strMainEntry) + if len(listSecondPart) > 1: + strSecondPart = listSecondPart[1] + listSecondarySortkey = re.split('@', strSecondPart) + if len(listSecondarySortkey) == 2: + xmlEOAindex.set("secondary", listSecondarySortkey[0]) + xmlEOAindex.set("secondarydisplay", listSecondarySortkey[1]) + else: + xmlEOAindex.set("secondary", strSecondPart) + if len(listFirstPart) > 1: + strAddition = listFirstPart[1] + if strAddition == "textbf": + xmlEOAindex.set("bold", "true") + tmpseealso = re.match('seealso', strAddition) + if tmpseealso != None: + tmpAddition = re.sub('seealso', '', strAddition) + xmlEOAindex.set("seealso", tmpAddition) + # Entries containing seealso are omitted for the time being + xmlEOAindex.tag = "temp" + tmpsee = re.match('^see(?!also)', strAddition) + if tmpsee != None: + tmpAddition = re.sub('see', '', strAddition) + xmlEOAindex.set("see", tmpAddition) + # Entries containing seealso are omitted for the time being + xmlEOAindex.tag = "temp" + # Figure out parent chapter number and parent Element order + for xmlParent in xmlEOAindex.iterancestors(): + if xmlParent.get("order") != None and xmlParent.tag != "EOAchapter": + xmlEOAindex.set("elementorder", xmlParent.get("order")) + if xmlParent.get("order") != None and xmlParent.tag == "EOAchapter": + xmlEOAindex.set("chapterorder", xmlParent.get("order")) + print (etree.tostring(xmlEOAindex)) + + +etree.strip_tags(xmlDjangoTree, "temp") + +print ("----------------------------------------------") +print ("Removing Duplicate Index Entries") + +for xmlEOAchapter in xmlEOAchapters: + for xmlChild in xmlEOAchapter.iterchildren(): + dictEntries = {} + xmlEOAindexs = xmlChild.xpath(".//EOAindex | .//EOAindexperson | .//EOAindexlocation") + for xmlEOAindex in xmlEOAindexs: + listEntry = [] + strEntry = xmlEOAindex.get("main") + if strEntry in dictEntries: + strSubentry = xmlEOAindex.get("secondary") + if strSubentry in dictEntries[strEntry] or strSubentry == None: + if (xmlChild.get("see") is None) and (xmlChild.get("seealso") is None): + xmlEOAindex.tag = "temp" + else: + dictEntries[strEntry].append(strSubentry) + else: + dictEntries[strEntry] = listEntry + +print ("----------------------------------------------") +print ("Removing Index Entries in Footnotes") + +for xmlEOAchapter in xmlEOAchapters: + for xmlChild in xmlEOAchapter.iterchildren(): + dictEntries = {} + xmlEOAindexs = xmlChild.xpath(".//EOAindex | .//EOAindexperson | .//EOAindexlocation") + for xmlEOAindex in xmlEOAindexs: + for xmlParent in xmlEOAindex.iterancestors(): + if xmlParent.tag == "EOAfootnote": + xmlEOAindex.tag = "temp" + print ("Ding Index in Footnote") + + +print ("----------------------------------------------") +print ("Sorting and Creating Regular Index") + +dictIndex = {} +xmlEOAindexs = xmlDjangoTree.findall("//EOAindex") +print ("Sorting " + str(len(xmlEOAindexs)) + " Entries") +for xmlEOAindex in xmlEOAindexs: + strMainEntry = xmlEOAindex.get("main") + # If strMainEntry not in Index, then create new index element + if strMainEntry not in dictIndex: + dictIndex[strMainEntry] = {} + dictIndex[strMainEntry]["listMainentries"] = [] + dictIndex[strMainEntry]["dictSubentries"] = {} + # if entry has no subentry then append it to listMainentries + if strMainEntry in dictIndex and xmlEOAindex.get("secondary") == None: + dictIndex[strMainEntry]["listMainentries"].append(xmlEOAindex) + # if entry has subentry, proceed on the second level + if strMainEntry in dictIndex and xmlEOAindex.get("secondary") != None: + strSubEntry = xmlEOAindex.get("secondary") + # if strSubEntry is not in dictSubentries, then create new list + if strSubEntry not in dictIndex[strMainEntry]["dictSubentries"]: + dictIndex[strMainEntry]["dictSubentries"][strSubEntry] = [] + dictIndex[strMainEntry]["dictSubentries"][strSubEntry].append(xmlEOAindex) + else: + dictIndex[strMainEntry]["dictSubentries"][strSubEntry].append(xmlEOAindex) + +# Sort the main index +listSortedKeys = sorted(dictIndex.keys(), key=str.lower) + +# Create new and empty xmlTree for xmlEOAindex +xmlEOAprintindex = etree.Element("EOAprintindex") +xmlEOAindexsection = None +listFirstChars = [] + +for strSortedKey in listSortedKeys: + strFirstChar = strSortedKey[0].upper() + if strFirstChar not in listFirstChars: + print (strFirstChar) + listFirstChars.append(strFirstChar) + if xmlEOAindexsection is not None: + xmlEOAprintindex.append(xmlEOAindexsection) + xmlEOAindexsection = etree.Element("EOAindexsection") + xmlEOAindexsection.set("Character", strFirstChar) + xmlEOAindexentry = etree.Element("EOAindexentry") + xmlEOAindexentry.set("main", strSortedKey) + for xmlMainelement in dictIndex[strSortedKey]["listMainentries"]: + if xmlMainelement.get("display") != None: + strMainEntry = xmlMainelement.get("display") + else: + strMainEntry = xmlMainelement.get("main") + xmlEOAindexentry.set("display", strMainEntry) + print (strMainEntry) + print (xmlMainelement.get("chapterorder") + ":" + xmlMainelement.get("elementorder")) + xmlEOAindexlink = etree.Element("EOAindexlink") + xmlEOAindexlink.set("chapterorder", xmlMainelement.get("chapterorder")) + xmlEOAindexlink.set("elementorder", xmlMainelement.get("elementorder")) + if xmlMainelement.get("bold") is not None: + xmlEOAindexlink.set("bold", "True") + xmlEOAindexentry.append(xmlEOAindexlink) + # If there are any subentries, process them now + if len(dictIndex[strSortedKey]["dictSubentries"]) > 0: + print ("Processing Subentries") + listSortedSubKeys = sorted(dictIndex[strSortedKey]["dictSubentries"]) + for strSortedSubKey in listSortedSubKeys: + xmlEOAindexsubentry = etree.Element("EOAindexsubentry") + xmlEOAindexsubentry.set("secondary", strSortedSubKey) + for xmlSubElement in dictIndex[strSortedKey]["dictSubentries"][strSortedSubKey]: + strSubEntry = xmlSubElement.get("secondary") + # Hier noch die Links auf den Untereintrag einfügen + xmlEOAindexlink = etree.Element("EOAindexlink") + xmlEOAindexlink.set("chapterorder", xmlSubElement.get("chapterorder")) + xmlEOAindexlink.set("elementorder", xmlSubElement.get("elementorder")) + xmlEOAindexsubentry.append(xmlEOAindexlink) + if xmlSubElement.get("bold") is not None: + xmlEOAindexlink.set("bold", "True") + print (strSubEntry) + xmlEOAindexentry.append(xmlEOAindexsubentry) + xmlEOAindexsection.append(xmlEOAindexentry) + +if xmlEOAindexsection is not None: + xmlEOAprintindex.append(xmlEOAindexsection) + +# If EOAprintindex is gonna be found, append xmlEOAprintindex to xmlEOAdocument +xmlPrintindex = xmlDjangoTree.find(".//EOAprintindex") +if xmlPrintindex is not None != 0: + # Remove

from xmlDjangoTree + xmlPrintindex.tag = "temp" + xmlPrintindex.getparent().tag = "temp" + xmlEOAdocument.append(xmlEOAprintindex) + +print ("----------------------------------------------") +print ("Sorting and Creating Person Index") + +dictIndex = {} +xmlEOAindexs = xmlDjangoTree.findall("//EOAindexperson") +print ("Sorting " + str(len(xmlEOAindexs)) + " Entries") +for xmlEOAindex in xmlEOAindexs: + strMainEntry = xmlEOAindex.get("main") + # If strMainEntry not in Index, then create new index element + if strMainEntry not in dictIndex: + dictIndex[strMainEntry] = {} + dictIndex[strMainEntry]["listMainentries"] = [] + dictIndex[strMainEntry]["dictSubentries"] = {} + # if entry has no subentry then append it to listMainentries + if strMainEntry in dictIndex and xmlEOAindex.get("secondary") == None: + dictIndex[strMainEntry]["listMainentries"].append(xmlEOAindex) + # if entry has subentry, proceed on the second level + if strMainEntry in dictIndex and xmlEOAindex.get("secondary") != None: + strSubEntry = xmlEOAindex.get("secondary") + # if strSubEntry is not in dictSubentries, then create new list + if strSubEntry not in dictIndex[strMainEntry]["dictSubentries"]: + dictIndex[strMainEntry]["dictSubentries"][strSubEntry] = [] + dictIndex[strMainEntry]["dictSubentries"][strSubEntry].append(xmlEOAindex) + else: + dictIndex[strMainEntry]["dictSubentries"][strSubEntry].append(xmlEOAindex) + +# Sort the main index +listSortedKeys = sorted(dictIndex.keys(), key=str.lower) + +# Create new and empty xmlTree for xmlEOAindex +xmlEOAprintindex = etree.Element("EOAprintpersonindex") +xmlEOAindexsection = None +listFirstChars = [] + +# doing the same for location index +print ("----------------------------------------------") +print ("Sorting and Creating Location Index") + +dictIndex = {} +xmlEOAindexs = xmlDjangoTree.findall("//EOAindexlocation") +print ("Sorting " + str(len(xmlEOAindexs)) + " Entries") +for xmlEOAindex in xmlEOAindexs: + strMainEntry = xmlEOAindex.get("main") + # If strMainEntry not in Index, then create new index element + if strMainEntry not in dictIndex: + dictIndex[strMainEntry] = {} + dictIndex[strMainEntry]["listMainentries"] = [] + dictIndex[strMainEntry]["dictSubentries"] = {} + # if entry has no subentry then append it to listMainentries + if strMainEntry in dictIndex and xmlEOAindex.get("secondary") == None: + dictIndex[strMainEntry]["listMainentries"].append(xmlEOAindex) + # if entry has subentry, proceed on the second level + if strMainEntry in dictIndex and xmlEOAindex.get("secondary") != None: + strSubEntry = xmlEOAindex.get("secondary") + # if strSubEntry is not in dictSubentries, then create new list + if strSubEntry not in dictIndex[strMainEntry]["dictSubentries"]: + dictIndex[strMainEntry]["dictSubentries"][strSubEntry] = [] + dictIndex[strMainEntry]["dictSubentries"][strSubEntry].append(xmlEOAindex) + else: + dictIndex[strMainEntry]["dictSubentries"][strSubEntry].append(xmlEOAindex) + +# Sort the main index +listSortedKeys = sorted(dictIndex.keys(), key=str.lower) + +# Create new and empty xmlTree for xmlEOAindex +xmlEOAprintindex = etree.Element("EOAprintlocationindex") +xmlEOAindexsection = None +listFirstChars = [] +# end here + +for strSortedKey in listSortedKeys: + strFirstChar = strSortedKey[0].upper() + if strFirstChar not in listFirstChars: + print (strFirstChar) + listFirstChars.append(strFirstChar) + if xmlEOAindexsection is not None: + xmlEOAprintindex.append(xmlEOAindexsection) + xmlEOAindexsection = etree.Element("EOAindexsection") + xmlEOAindexsection.set("Character", strFirstChar) + xmlEOAindexentry = etree.Element("EOAindexentry") + xmlEOAindexentry.set("main", strSortedKey) + for xmlMainelement in dictIndex[strSortedKey]["listMainentries"]: + if xmlMainelement.get("display") != None: + strMainEntry = xmlMainelement.get("display") + else: + strMainEntry = xmlMainelement.get("main") + xmlEOAindexentry.set("display", strMainEntry) + print (strMainEntry) + print (xmlMainelement.get("chapterorder") + ":" + xmlMainelement.get("elementorder")) + xmlEOAindexlink = etree.Element("EOAindexlink") + xmlEOAindexlink.set("chapterorder", xmlMainelement.get("chapterorder")) + xmlEOAindexlink.set("elementorder", xmlMainelement.get("elementorder")) + if xmlMainelement.get("bold") is not None: + xmlEOAindexlink.set("bold", "True") + xmlEOAindexentry.append(xmlEOAindexlink) + # If there are any subentries, process them now + if len(dictIndex[strSortedKey]["dictSubentries"]) > 0: + print ("Processing Subentries") + listSortedSubKeys = sorted(dictIndex[strSortedKey]["dictSubentries"]) + for strSortedSubKey in listSortedSubKeys: + xmlEOAindexsubentry = etree.Element("EOAindexsubentry") + xmlEOAindexsubentry.set("secondary", strSortedSubKey) + for xmlSubElement in dictIndex[strSortedKey]["dictSubentries"][strSortedSubKey]: + strSubEntry = xmlSubElement.get("secondary") + # Hier noch die Links auf den Untereintrag einfügen + xmlEOAindexlink = etree.Element("EOAindexlink") + xmlEOAindexlink.set("chapterorder", xmlSubElement.get("chapterorder")) + xmlEOAindexlink.set("elementorder", xmlSubElement.get("elementorder")) + xmlEOAindexsubentry.append(xmlEOAindexlink) + if xmlSubElement.get("bold") is not None: + xmlEOAindexlink.set("bold", "True") + print (strSubEntry) + xmlEOAindexentry.append(xmlEOAindexsubentry) + xmlEOAindexsection.append(xmlEOAindexentry) + +if xmlEOAindexsection is not None: + xmlEOAprintindex.append(xmlEOAindexsection) + +# If EOAprintpersonindex is gonna be found, append xmlEOAprintindex to xmlEOAdocument +xmlPrintindex = xmlDjangoTree.find(".//EOAprintpersonindex") +if xmlPrintindex is not None != 0: + # Remove

from xmlDjangoTree + xmlPrintindex.tag = "temp" + xmlPrintindex.getparent().tag = "temp" + xmlEOAdocument.append(xmlEOAprintindex) + +# If EOAprintlocationindex is found, append xmlEOAprintindex to xmlEOAdocument +xmlPrintindex = xmlDjangoTree.find(".//EOAprintlocationindex") +if xmlPrintindex is not None != 0: + # Remove

from xmlDjangoTree + xmlPrintindex.tag = "temp" + xmlPrintindex.getparent().tag = "temp" + xmlEOAdocument.append(xmlEOAprintindex) + + +# TODO: Die unnötigen Attribute wie id löschen +# TODO: Die unnötigen Tags wie EOAlabel löschen +etree.strip_tags(xmlDjangoTree, "temp", "citetext", "EOAprintbibliography") +etree.strip_elements(xmlDjangoTree, "citekey", with_tail=False) +etree.strip_attributes(xmlDjangoTree, "id-text", "id", "noindent", "type", "label", "spacebefore", "rend") + +############################################################################ +# Save xmlDjangoTree # +############################################################################ + +tmpFile = open ("CONVERT/django/Django.xml", "w") +tmpResult = etree.tostring(xmlDjangoTree, pretty_print=True, encoding="unicode") +tmpFile.write(tmpResult) +tmpFile.close() + +############################################################################ +# Finishing various Stuff # +############################################################################ + +# Write Temporary XML-Tree +ergebnisdatei = open("Devel_ebook.xml", "w") +ergebnis = etree.tostring(xmlEbookTree, pretty_print=True, encoding="unicode") +ergebnisdatei.write(ergebnis) +ergebnisdatei.close() + + +cleanup() +print ("Done!") +sys.exit() diff --git a/Skripten/echoparser.py b/Skripten/echoparser.py new file mode 100755 index 0000000..9b53e7d --- /dev/null +++ b/Skripten/echoparser.py @@ -0,0 +1,41 @@ +#!/opt/local/bin/python3.1 +# -*- coding: UTF-8 -*- + +from lxml import etree +from lxml import objectify +import shlex +import subprocess + +parser = etree.XMLParser() + +strBasicURL = "http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/interface/page-fragment.xql?document=/archimedes/la/monte_mecha_036_la_1577.xml&pn=122&mode=" +listModes = ["text", "textPollux", "xml"] + +for strMode in listModes: + strURL = strBasicURL + strMode + xmlECHOtree = etree.parse(strURL, parser) + # Remove namespaces from ECHO + objectify.deannotate(xmlECHOtree, xsi_nil=True) + etree.cleanup_namespaces(xmlECHOtree) + xmlDivs = xmlECHOtree.findall(".//div") + for xmlDiv in xmlDivs: + if xmlDiv.get("class") == "pageContent": + print ("PageContent gefunden") + #print (etree.tostring(xmlDiv)) + if strMode == "text": + # Download images + xmlImages = xmlDiv.findall(".//img") + for xmlImage in xmlImages: + strImageSrc = xmlImage.get("src") + print (strImageSrc) + strCommand = "curl " + strImageSrc + " -o test.jpg" + listArguments = shlex.split(strCommand) + exeShell = subprocess.check_output(listArguments, shell=False, universal_newlines=True) + + + + +#dieHTMLWebseite = etree.fromstring(dieWebseite) + +#print (dieWebseite) + diff --git a/Skripten/epub.sh b/Skripten/epub.sh new file mode 100755 index 0000000..97029ea --- /dev/null +++ b/Skripten/epub.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +zip -X -Z store $1.epub mimetype +zip -X $1.epub META-INF/container.xml +zip -X $1.epub OEBPS/* +zip -X $1.epub OEBPS/images/* +#zip -X Test.epub OEBPS/facsimile/* +mv $1.epub ../ \ No newline at end of file diff --git a/Skripten/epub_test.sh b/Skripten/epub_test.sh new file mode 100755 index 0000000..ab16f5e --- /dev/null +++ b/Skripten/epub_test.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +java -jar /Library/MPIWG/epubcheck/epubcheck-1.0.5.jar $1 diff --git a/Skripten/tralics b/Skripten/tralics new file mode 100755 index 0000000..6e3ef9b Binary files /dev/null and b/Skripten/tralics differ diff --git a/Support/classes.dtd b/Support/classes.dtd new file mode 100644 index 0000000..b13e540 --- /dev/null +++ b/Support/classes.dtd @@ -0,0 +1,378 @@ + + + + + + + + + + + + + + + +%mathml; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/html/lat1.ent b/Support/html/lat1.ent new file mode 100644 index 0000000..8d72f3d --- /dev/null +++ b/Support/html/lat1.ent @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/html/special.ent b/Support/html/special.ent new file mode 100644 index 0000000..3ac3cdc --- /dev/null +++ b/Support/html/special.ent @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/html/symbol.ent b/Support/html/symbol.ent new file mode 100644 index 0000000..7b27069 --- /dev/null +++ b/Support/html/symbol.ent @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isoamsa.ent b/Support/iso8879/isoamsa.ent new file mode 100644 index 0000000..18a7406 --- /dev/null +++ b/Support/iso8879/isoamsa.ent @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isoamsb.ent b/Support/iso8879/isoamsb.ent new file mode 100644 index 0000000..6e68d60 --- /dev/null +++ b/Support/iso8879/isoamsb.ent @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isoamsc.ent b/Support/iso8879/isoamsc.ent new file mode 100644 index 0000000..c825204 --- /dev/null +++ b/Support/iso8879/isoamsc.ent @@ -0,0 +1,31 @@ + + + + + + + + + + + + + diff --git a/Support/iso8879/isoamsn.ent b/Support/iso8879/isoamsn.ent new file mode 100644 index 0000000..e2482c5 --- /dev/null +++ b/Support/iso8879/isoamsn.ent @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isoamso.ent b/Support/iso8879/isoamso.ent new file mode 100644 index 0000000..9fce88f --- /dev/null +++ b/Support/iso8879/isoamso.ent @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isoamsr.ent b/Support/iso8879/isoamsr.ent new file mode 100644 index 0000000..ad08603 --- /dev/null +++ b/Support/iso8879/isoamsr.ent @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isobox.ent b/Support/iso8879/isobox.ent new file mode 100644 index 0000000..05e2b13 --- /dev/null +++ b/Support/iso8879/isobox.ent @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isocyr1.ent b/Support/iso8879/isocyr1.ent new file mode 100644 index 0000000..b4149c7 --- /dev/null +++ b/Support/iso8879/isocyr1.ent @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isocyr2.ent b/Support/iso8879/isocyr2.ent new file mode 100644 index 0000000..b038bd9 --- /dev/null +++ b/Support/iso8879/isocyr2.ent @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isodia.ent b/Support/iso8879/isodia.ent new file mode 100644 index 0000000..39ccfcd --- /dev/null +++ b/Support/iso8879/isodia.ent @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isogrk1.ent b/Support/iso8879/isogrk1.ent new file mode 100644 index 0000000..1ed96fa --- /dev/null +++ b/Support/iso8879/isogrk1.ent @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isogrk2.ent b/Support/iso8879/isogrk2.ent new file mode 100644 index 0000000..d8212b4 --- /dev/null +++ b/Support/iso8879/isogrk2.ent @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isogrk3.ent b/Support/iso8879/isogrk3.ent new file mode 100644 index 0000000..e62868f --- /dev/null +++ b/Support/iso8879/isogrk3.ent @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isogrk4.ent b/Support/iso8879/isogrk4.ent new file mode 100644 index 0000000..28cba46 --- /dev/null +++ b/Support/iso8879/isogrk4.ent @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isolat1.ent b/Support/iso8879/isolat1.ent new file mode 100644 index 0000000..43ae764 --- /dev/null +++ b/Support/iso8879/isolat1.ent @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isolat2.ent b/Support/iso8879/isolat2.ent new file mode 100644 index 0000000..c29b828 --- /dev/null +++ b/Support/iso8879/isolat2.ent @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isonum.ent b/Support/iso8879/isonum.ent new file mode 100644 index 0000000..79f4380 --- /dev/null +++ b/Support/iso8879/isonum.ent @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isopub.ent b/Support/iso8879/isopub.ent new file mode 100644 index 0000000..9b27b63 --- /dev/null +++ b/Support/iso8879/isopub.ent @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso8879/isotech.ent b/Support/iso8879/isotech.ent new file mode 100644 index 0000000..ee25b5b --- /dev/null +++ b/Support/iso8879/isotech.ent @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso9573-13/isoamsa.ent b/Support/iso9573-13/isoamsa.ent new file mode 100644 index 0000000..c413168 --- /dev/null +++ b/Support/iso9573-13/isoamsa.ent @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso9573-13/isoamsb.ent b/Support/iso9573-13/isoamsb.ent new file mode 100644 index 0000000..b74414b --- /dev/null +++ b/Support/iso9573-13/isoamsb.ent @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso9573-13/isoamsc.ent b/Support/iso9573-13/isoamsc.ent new file mode 100644 index 0000000..46ea221 --- /dev/null +++ b/Support/iso9573-13/isoamsc.ent @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso9573-13/isoamsn.ent b/Support/iso9573-13/isoamsn.ent new file mode 100644 index 0000000..a1df8b7 --- /dev/null +++ b/Support/iso9573-13/isoamsn.ent @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso9573-13/isoamso.ent b/Support/iso9573-13/isoamso.ent new file mode 100644 index 0000000..f99cf11 --- /dev/null +++ b/Support/iso9573-13/isoamso.ent @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso9573-13/isoamsr.ent b/Support/iso9573-13/isoamsr.ent new file mode 100644 index 0000000..2251ef1 --- /dev/null +++ b/Support/iso9573-13/isoamsr.ent @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso9573-13/isogrk3.ent b/Support/iso9573-13/isogrk3.ent new file mode 100644 index 0000000..0cbde88 --- /dev/null +++ b/Support/iso9573-13/isogrk3.ent @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso9573-13/isogrk4.ent b/Support/iso9573-13/isogrk4.ent new file mode 100644 index 0000000..097f90e --- /dev/null +++ b/Support/iso9573-13/isogrk4.ent @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso9573-13/isomfrk.ent b/Support/iso9573-13/isomfrk.ent new file mode 100644 index 0000000..0e1a943 --- /dev/null +++ b/Support/iso9573-13/isomfrk.ent @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso9573-13/isomopf.ent b/Support/iso9573-13/isomopf.ent new file mode 100644 index 0000000..4b26425 --- /dev/null +++ b/Support/iso9573-13/isomopf.ent @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso9573-13/isomscr.ent b/Support/iso9573-13/isomscr.ent new file mode 100644 index 0000000..a2174f0 --- /dev/null +++ b/Support/iso9573-13/isomscr.ent @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/iso9573-13/isotech.ent b/Support/iso9573-13/isotech.ent new file mode 100644 index 0000000..83db0a5 --- /dev/null +++ b/Support/iso9573-13/isotech.ent @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml/mmlalias.ent b/Support/mathml/mmlalias.ent new file mode 100644 index 0000000..afaf4fd --- /dev/null +++ b/Support/mathml/mmlalias.ent @@ -0,0 +1,564 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml/mmlextra.ent b/Support/mathml/mmlextra.ent new file mode 100644 index 0000000..669f86b --- /dev/null +++ b/Support/mathml/mmlextra.ent @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2-qname-1.mod b/Support/mathml2-qname-1.mod new file mode 100644 index 0000000..821ef3d --- /dev/null +++ b/Support/mathml2-qname-1.mod @@ -0,0 +1,286 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + +]]> + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2.dtd b/Support/mathml2.dtd new file mode 100644 index 0000000..437ecd8 --- /dev/null +++ b/Support/mathml2.dtd @@ -0,0 +1,2206 @@ + + + + + + + + + + +%mathml-qname.mod;]]> + + + +]]> + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + +]]> + + + + + +]]> + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + +%ent-isoamsa; + + +%ent-isoamsb; + + +%ent-isoamsc; + + +%ent-isoamsn; + + +%ent-isoamso; + + +%ent-isoamsr; + + +%ent-isogrk3; + + +%ent-isomfrk; + + +%ent-isomopf; + + +%ent-isomscr; + + +%ent-isotech; + + + + +%ent-isobox; + + +%ent-isocyr1; + + +%ent-isocyr2; + + +%ent-isodia; + + +%ent-isolat1; + + +%ent-isolat2; + + +%ent-isonum; + + +%ent-isopub; + + + + +%ent-mmlextra; + + + + +%ent-mmlalias; + +]]> + + + + + + diff --git a/Support/mathml2/html/lat1.ent b/Support/mathml2/html/lat1.ent new file mode 100644 index 0000000..8d72f3d --- /dev/null +++ b/Support/mathml2/html/lat1.ent @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/html/special.ent b/Support/mathml2/html/special.ent new file mode 100644 index 0000000..3ac3cdc --- /dev/null +++ b/Support/mathml2/html/special.ent @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/html/symbol.ent b/Support/mathml2/html/symbol.ent new file mode 100644 index 0000000..7b27069 --- /dev/null +++ b/Support/mathml2/html/symbol.ent @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isoamsa.ent b/Support/mathml2/iso8879/isoamsa.ent new file mode 100644 index 0000000..18a7406 --- /dev/null +++ b/Support/mathml2/iso8879/isoamsa.ent @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isoamsb.ent b/Support/mathml2/iso8879/isoamsb.ent new file mode 100644 index 0000000..6e68d60 --- /dev/null +++ b/Support/mathml2/iso8879/isoamsb.ent @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isoamsc.ent b/Support/mathml2/iso8879/isoamsc.ent new file mode 100644 index 0000000..c825204 --- /dev/null +++ b/Support/mathml2/iso8879/isoamsc.ent @@ -0,0 +1,31 @@ + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isoamsn.ent b/Support/mathml2/iso8879/isoamsn.ent new file mode 100644 index 0000000..e2482c5 --- /dev/null +++ b/Support/mathml2/iso8879/isoamsn.ent @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isoamso.ent b/Support/mathml2/iso8879/isoamso.ent new file mode 100644 index 0000000..9fce88f --- /dev/null +++ b/Support/mathml2/iso8879/isoamso.ent @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isoamsr.ent b/Support/mathml2/iso8879/isoamsr.ent new file mode 100644 index 0000000..ad08603 --- /dev/null +++ b/Support/mathml2/iso8879/isoamsr.ent @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isobox.ent b/Support/mathml2/iso8879/isobox.ent new file mode 100644 index 0000000..05e2b13 --- /dev/null +++ b/Support/mathml2/iso8879/isobox.ent @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isocyr1.ent b/Support/mathml2/iso8879/isocyr1.ent new file mode 100644 index 0000000..b4149c7 --- /dev/null +++ b/Support/mathml2/iso8879/isocyr1.ent @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isocyr2.ent b/Support/mathml2/iso8879/isocyr2.ent new file mode 100644 index 0000000..b038bd9 --- /dev/null +++ b/Support/mathml2/iso8879/isocyr2.ent @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isodia.ent b/Support/mathml2/iso8879/isodia.ent new file mode 100644 index 0000000..39ccfcd --- /dev/null +++ b/Support/mathml2/iso8879/isodia.ent @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isogrk1.ent b/Support/mathml2/iso8879/isogrk1.ent new file mode 100644 index 0000000..1ed96fa --- /dev/null +++ b/Support/mathml2/iso8879/isogrk1.ent @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isogrk2.ent b/Support/mathml2/iso8879/isogrk2.ent new file mode 100644 index 0000000..d8212b4 --- /dev/null +++ b/Support/mathml2/iso8879/isogrk2.ent @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isogrk3.ent b/Support/mathml2/iso8879/isogrk3.ent new file mode 100644 index 0000000..e62868f --- /dev/null +++ b/Support/mathml2/iso8879/isogrk3.ent @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isogrk4.ent b/Support/mathml2/iso8879/isogrk4.ent new file mode 100644 index 0000000..28cba46 --- /dev/null +++ b/Support/mathml2/iso8879/isogrk4.ent @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isolat1.ent b/Support/mathml2/iso8879/isolat1.ent new file mode 100644 index 0000000..43ae764 --- /dev/null +++ b/Support/mathml2/iso8879/isolat1.ent @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isolat2.ent b/Support/mathml2/iso8879/isolat2.ent new file mode 100644 index 0000000..c29b828 --- /dev/null +++ b/Support/mathml2/iso8879/isolat2.ent @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isonum.ent b/Support/mathml2/iso8879/isonum.ent new file mode 100644 index 0000000..79f4380 --- /dev/null +++ b/Support/mathml2/iso8879/isonum.ent @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isopub.ent b/Support/mathml2/iso8879/isopub.ent new file mode 100644 index 0000000..9b27b63 --- /dev/null +++ b/Support/mathml2/iso8879/isopub.ent @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso8879/isotech.ent b/Support/mathml2/iso8879/isotech.ent new file mode 100644 index 0000000..ee25b5b --- /dev/null +++ b/Support/mathml2/iso8879/isotech.ent @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso9573-13/isoamsa.ent b/Support/mathml2/iso9573-13/isoamsa.ent new file mode 100644 index 0000000..c413168 --- /dev/null +++ b/Support/mathml2/iso9573-13/isoamsa.ent @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso9573-13/isoamsb.ent b/Support/mathml2/iso9573-13/isoamsb.ent new file mode 100644 index 0000000..b74414b --- /dev/null +++ b/Support/mathml2/iso9573-13/isoamsb.ent @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso9573-13/isoamsc.ent b/Support/mathml2/iso9573-13/isoamsc.ent new file mode 100644 index 0000000..46ea221 --- /dev/null +++ b/Support/mathml2/iso9573-13/isoamsc.ent @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso9573-13/isoamsn.ent b/Support/mathml2/iso9573-13/isoamsn.ent new file mode 100644 index 0000000..a1df8b7 --- /dev/null +++ b/Support/mathml2/iso9573-13/isoamsn.ent @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso9573-13/isoamso.ent b/Support/mathml2/iso9573-13/isoamso.ent new file mode 100644 index 0000000..f99cf11 --- /dev/null +++ b/Support/mathml2/iso9573-13/isoamso.ent @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso9573-13/isoamsr.ent b/Support/mathml2/iso9573-13/isoamsr.ent new file mode 100644 index 0000000..2251ef1 --- /dev/null +++ b/Support/mathml2/iso9573-13/isoamsr.ent @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso9573-13/isogrk3.ent b/Support/mathml2/iso9573-13/isogrk3.ent new file mode 100644 index 0000000..0cbde88 --- /dev/null +++ b/Support/mathml2/iso9573-13/isogrk3.ent @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso9573-13/isogrk4.ent b/Support/mathml2/iso9573-13/isogrk4.ent new file mode 100644 index 0000000..097f90e --- /dev/null +++ b/Support/mathml2/iso9573-13/isogrk4.ent @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso9573-13/isomfrk.ent b/Support/mathml2/iso9573-13/isomfrk.ent new file mode 100644 index 0000000..0e1a943 --- /dev/null +++ b/Support/mathml2/iso9573-13/isomfrk.ent @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso9573-13/isomopf.ent b/Support/mathml2/iso9573-13/isomopf.ent new file mode 100644 index 0000000..4b26425 --- /dev/null +++ b/Support/mathml2/iso9573-13/isomopf.ent @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso9573-13/isomscr.ent b/Support/mathml2/iso9573-13/isomscr.ent new file mode 100644 index 0000000..a2174f0 --- /dev/null +++ b/Support/mathml2/iso9573-13/isomscr.ent @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/iso9573-13/isotech.ent b/Support/mathml2/iso9573-13/isotech.ent new file mode 100644 index 0000000..83db0a5 --- /dev/null +++ b/Support/mathml2/iso9573-13/isotech.ent @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/mathml/mmlalias.ent b/Support/mathml2/mathml/mmlalias.ent new file mode 100644 index 0000000..afaf4fd --- /dev/null +++ b/Support/mathml2/mathml/mmlalias.ent @@ -0,0 +1,564 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/mathml/mmlextra.ent b/Support/mathml2/mathml/mmlextra.ent new file mode 100644 index 0000000..669f86b --- /dev/null +++ b/Support/mathml2/mathml/mmlextra.ent @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/mathml2-qname-1.mod b/Support/mathml2/mathml2-qname-1.mod new file mode 100644 index 0000000..821ef3d --- /dev/null +++ b/Support/mathml2/mathml2-qname-1.mod @@ -0,0 +1,286 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + +]]> + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Support/mathml2/mathml2.dtd b/Support/mathml2/mathml2.dtd new file mode 100644 index 0000000..437ecd8 --- /dev/null +++ b/Support/mathml2/mathml2.dtd @@ -0,0 +1,2206 @@ + + + + + + + + + + +%mathml-qname.mod;]]> + + + +]]> + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + +]]> + + + + + +]]> + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + +%ent-isoamsa; + + +%ent-isoamsb; + + +%ent-isoamsc; + + +%ent-isoamsn; + + +%ent-isoamso; + + +%ent-isoamsr; + + +%ent-isogrk3; + + +%ent-isomfrk; + + +%ent-isomopf; + + +%ent-isomscr; + + +%ent-isotech; + + + + +%ent-isobox; + + +%ent-isocyr1; + + +%ent-isocyr2; + + +%ent-isodia; + + +%ent-isolat1; + + +%ent-isolat2; + + +%ent-isonum; + + +%ent-isopub; + + + + +%ent-mmlextra; + + + + +%ent-mmlalias; + +]]> + + + + + + diff --git a/Support/mathml2/xhtml-math11-f.dtd b/Support/mathml2/xhtml-math11-f.dtd new file mode 100644 index 0000000..8b3ce7e --- /dev/null +++ b/Support/mathml2/xhtml-math11-f.dtd @@ -0,0 +1,9828 @@ + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + +]]> + +]]> + +]]> + + + +]]> + + +]]> + +]]> + + + + + + + + + + + + + + + + + + + + + +]]> +]]> + + + + + + + + +]]> + +]]> + + + +]]> + +]]> + + + +]]> + +]]> + + + + + + + + +]]> + + +]]> + + +]]> + + +]]> + + +]]> + + + + + +]]> + + +]]> + + + +]]> + + + + + + + + + +]]> +]]> + + + + + + + +]]> +]]> + + + + + + +]]> + + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + + + + +%SVG.dtd; +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + +%xhtml-arch.mod;]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + +]]> + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + +]]> + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + +]]> + + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + + + + +]]> + + + +]]> + + + + +]]> + + + +]]> + + + + +]]> + + + +]]> + + + + +]]> + + + +]]> + + + + +]]> + + + +]]> + + + + +]]> + + + +]]> + + +]]> + + +]]> + + + + + + + + + + + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + + + + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + + + + + +]]> + + + +]]> + + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + +]]> + + + +]]> + + + + + + + + + + + + + +]]> + + + + + + +]]> + + + + + + +]]> +]]> + + + + + + + +]]> + + + + + + + + +]]> + + + + +]]> +]]> + + + + + + +]]> +]]> + + + + + + + + + + +]]> + + + + + +]]> + + + + + +]]> +]]> + + + + + +]]> + + + + + +]]> + + + + + +]]> +]]> +]]> + + +]]> + + + + + + + + + + + + + + + + + + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + +]]> + + + +]]> + + +]]> + + +]]> + + + + + + + + + + + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + + + +]]> + + + +]]> + + + + +]]> + + + + + + + + + + + + + + + + +]]> + + + +]]> + + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + +]]> + + + + + + +]]> + + + + + + + + + + + + + + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + + + + + + + +]]> + + + +]]> + + + + + + + + +]]> + + + +]]> + + + + + + + + +]]> + + + +]]> + + + + + + + + +]]> + + + +]]> + + + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + +]]> + + + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + + + +]]> + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + + + + + +]]> + + + +]]> + + +]]> + + + + +%xhtml-legacy.mod;]]> + + + + + + + + + + + + + + + + + + +]]> + + + +]]> + + + + + + + +]]> + + + + + + +]]> + + + + + + + +]]> + + + +]]> + + + + + + + +]]> + + + + + + + +]]> + + +]]> + + + + +]]> + + + + + + + + + + + + + + +%mathml-qname.mod;]]> + + + +]]> + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + +]]> + + + + + +]]> + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + +]]> + + + + + + + + diff --git a/TeX/frontmatter.tex b/TeX/frontmatter.tex new file mode 100644 index 0000000..2c541b5 --- /dev/null +++ b/TeX/frontmatter.tex @@ -0,0 +1,176 @@ +% Version 1.0 +% 19. 11. 2012 +% Enable blank page style (no headings and footers) +\pagestyle{empty} +\pagenumbering{roman} +\setcounter{page}{1} % + +% Page 1: Just the title +\begin{center} +{\Large The Globalization of Knowledge in History} +\end{center} +\newpage + +% Page 2: Library, Editors, Team, Board, Series #, Edition Open Access YEAR +\begin{minipage}[t]{113mm} +\begin{center} +\Large \textbf{Max Planck Research Library\\ for the History and Development\\ of Knowledge} +\end{center} + +\vspace{15mm} +\noindent\textbf{Series Editors}\\[2mm] +Jürgen Renn, +Robert Schlögl, +Bernard F. Schutz. + +\vspace{10mm} +\noindent\textbf{Edition Open Access Development Team}\\[2mm] +Lindy Divarci, +Jörg Kantel, +Matthias Schemmel +and Kai Surendorf. + +\vspace{10mm} +\noindent\textbf{Scientific Board}\\[2mm] +Markus Antonietti, +Ian Baldwin, +Antonio Becchi, +Fabio Bevilacqua, +William G. Boltz, +Jens Braarvik, +Horst Bredekamp, +Jed Z. Buchwald, +Olivier Darrigol, +Thomas Duve, +Mike Edmunds, +Yehuda Elkana, +Fynn Ole Engler, +Robert K. Englund, +Mordechai Feingold, +Rivka Feldhay, +Gideon Freudenthal, +Paolo Galluzzi, +Kostas Gavroglu, +Mark Geller, +Dominico Giulini, +Günther Görz, +Gerd Graßhoff, +James Hough, +Manfred Laubichler, +Glenn Most, +Klaus Müllen, +Pier Daniele Napolitani, +Alessandro Nova, +Hermann Parzinger, +Dan Potts, +Circe Silva da Silva, +Ana Simões, +Dieter Stein, +Richard Stephenson, +Mark Stitt, +Noel M. Swerdlow, +Liba Taub, +Martin Vingron, +Scott Walter, +Norton Wise, +Gerhard Wolf, +Rüdiger Wolfrum, +Gereon Wolters, +Zhang Baichun. + +\vspace{10mm} +\begin{center} +{\Large \textbf{Studies 1}} +\end{center} + +\vspace{13mm} +\begin{center}% +\large\textbf{Edition Open Access\\ 2012\\} +\end{center} +\end{minipage} +\newpage + +% Page 3: Title, subtitle, author/editor, Edition Open Access Year +\begin{minipage}[t]{90mm} +\vspace*{12mm} +\begin{center} +\huge\textbf{This ist the title of the publication} +\end{center} + +\vspace{8mm} +\begin{center} +\large\textbf{Subtitle} +\end{center} + +\vspace{4mm} +\begin{center} +\Large John Doe +\end{center} + +\vspace{88mm} +\begin{center}% +\large\textbf{Edition Open Access\\ 2012\\} +\end{center} +\end{minipage} +\newpage + +% Page 4: Complete Series Information, Communicator, Editor, Gratitude, +% ISBN-Number, License +\noindent Max Planck Research Library for the History and Development of Knowledge\\ +Series Number\\ + +\noindent \emph{Communicated by}:\\ +Jane Doe, John Doe and Harald Paslewski\\ + +\noindent \emph{Edited by}:\\ +Hans Müller\\ + +\noindent \emph{Editorial Coordination}:\\ +Lindy Divarci and Some1 Else\\ + +%\noindent \emph{Institutional / Conference Information}:\\ +%Some more words about the conference and what it was about and where it took place and what happened there\\ + +%\noindent \emph{Participants}:\\ +% If necessary al long list of names + +\vfill +\begin{flushleft} +\noindent ISBN 978-3-8442-XXXX-X\\ +First published 201X\\ +Printed in Germany by epubli, Oranienstraße 183, 10999 Berlin\\ +http://www.epubli.de\\ +Edition Open Access\\ +http://www.edition-open-access.de\\ +Published under Creative Commons by-nc-sa 3.0 Germany Licence\\ +http://creativecommons.org/licenses/by-nc-sa/3.0/de/\\[2mm]The Deutsche Nationalbibliothek lists this publication in the Deutsche Nationalbibliografie; detailed bibliographic data are available in the Internet at http://dnb.d-nb.de. +\end{flushleft} +\newpage + +% Page 5 and 6: Description of the whole project +\noindent The \emph{Max Planck Research Library for the History and Development of Knowledge} comprises three subseries, \emph{Studies}, \emph{Proceedings}, and \emph{Sources}. They present research results and the relevant sources in a new format, combining the advantages of traditional publications and the digital medium. The volumes are available both as printed books and as online open access publications. They present original scientific work submitted under the scholarly responsibility of members of the Scientific Board and their academic peers. + +The volumes of the three subseries and their electronic counterparts are directed at scholars and students of various disciplines, as well as at a broader public interested in how science shapes our world. They provide rapid access to knowledge at low cost. Moreover, by combining print with digital publication, the three series offer a new way of publishing research in flux and of studying historical topics or current issues in relation to primary materials that are otherwise not easily available. + +The initiative is supported, for the time being, by research departments of three Max Planck Institutes, the MPI for the History of Science, the Fritz Haber Institute of the MPG, and the MPI for Gravitational Physics (Albert Einstein Institute). This is in line with the \emph{Berlin Declaration on Open Access to Knowledge in the Sciences and Humanities}, launched by the Max Planck Society in 2003. + +Each volume of the \emph{Studies} series is dedicated to a key subject in the history and development of knowledge, bringing together perspectives from different fields and combining source-based empirical research with theoretically guided approaches. The studies are typically working group volumes presenting integrative approaches to problems ranging from the globalization of knowledge to the nature of spatial thinking. + +Each volume of the \emph{Proceedings} series presents the results of a scientific meeting on current issues and supports, at the same time, further cooperation on these issues by offering an electronic platform with further resources and the possibility for comments and interactions. + +Each volume of the \emph{Sources} series typically presents a primary source -- relevant for the history and development of knowledge -- in facsimile, transcription, or translation. The original sources are complemented by an introduction and by commentaries reflecting original scholarly work. The sources reproduced in this series may be rare books, manuscripts, documents or data that are not readily accessible in libraries and archives. + +On the basis of scholarly expertise the publication of the three series brings together traditional books produced by print-on-demand techniques with modern information technology. Based on and extending the functionalities of the existing open access repository European Cultural Heritage Online (ECHO), this initiative aims at a model for an unprecedented, Web-based scientific working environment integrating access to information with interactive features. +\newpage + +% Pages 7 and 8: Dedication, followed by a blank page +\vspace*{40mm} +\begin{center} +The dedication +\end{center} +\clearpage +\mbox{} +\newpage + +% Following pages use normal page style, which is fancy +\pagestyle{fancy} \ No newline at end of file diff --git a/TeX/pre_bib.tex b/TeX/pre_bib.tex new file mode 100644 index 0000000..4bbc73d --- /dev/null +++ b/TeX/pre_bib.tex @@ -0,0 +1,69 @@ +\documentclass{book} +\usepackage{url} +\usepackage{html} +% Erstmal die Refsection erstellen +\newcommand*{\refsection}[1]{\begin{xmlelement}{refsection}\begin{xmlelement}{number}#1\end{xmlelement}} +\newcommand*{\endrefsection}{\end{xmlelement}} +% Start und Ende des Eintrags festlegen +\newcommand*{\entry}[3]{ +\begin{xmlelement}{entry} +% Das Tag entry bleibt hier offen, weil es vom nächsten Befehl geschlossen wird +\begin{xmlelement}{label}#1\end{xmlelement} +\begin{xmlelement}{type}#2\end{xmlelement} +} +\newcommand*{\endentry}{ +\end{xmlelement} +} +% Generische Felder festlegen +\newcommand*{\field}[2]{\begin{xmlelement}{#1}#2\end{xmlelement}} +% Anzahl der Autoren +\newcommand*{\name}[4]{\begin{xmlelement}{#1}\begin{xmlelement}{number}#2\end{xmlelement}\begin{math}#4\end{math}\end{xmlelement}} + +% Noch zu klären: +\renewcommand*{\list}[3]{\begin{xmlelement}{#1}#3\end{xmlelement}} + + +% Verschiedene Kommandos +% Punkt nach Kürzel einfügen +\newcommand*{\bibinitperiod}{.} +% | dient zur Trennung von Bestandteilen des Namens +\newcommand*{\bibnamedelimb}{°} +\newcommand*{\bibnamedelima}{°} +\newcommand*{\bibnamedelimi}{°} +\newcommand*{\bibrangedash}{-} +% Werden hier nicht gebraucht +\renewcommand*{\verb}{} +\newcommand*{\endverb}{} +\newcommand*{\bibinithyphendelim}{} +\newcommand*{\sortlist}[2]{} +\newcommand*{\endsortlist}{} +\newcommand*{\warn}[1]{} +\newcommand*{\bibinitdelim}{} +\newcommand*{\keyw}{} +\renewcommand*{\par}{} + +% Zu definierende Kommandos: +% \bibinithyphendelim +% \bibnamedelima +% \bibinitdelim + + +% Wird wohl nicht benötigt +\newcommand*{\strng}{} + +% EOAcommandos übernehmen +\newcommand*{\EOAgreek}[1]{#1} +\newcommand*{\EOAemph}[1]{#1} + + +% +%\newcommand*{\EOAtoc}[1]{\xbox{tableofcontents}{toc}} +%\newenvironment{EOAequation}[1]{ +%\begin{xmlelement}{EOAequation} +%\anchor\label{#1} +%\begin{equation} +%} +%{ +%\end{equation} +%\end{xmlelement} +%} diff --git a/TeX/pre_eoa.tex b/TeX/pre_eoa.tex new file mode 100755 index 0000000..0f4f479 --- /dev/null +++ b/TeX/pre_eoa.tex @@ -0,0 +1,611 @@ +% Version: 1.5 +% 14/07/2015 +% Last modifier: Georg + +\documentclass[10pt,openright,twoside]{scrbook} + +% Basic packages used for if-else +\usepackage{xifthen} +\usepackage{ifplatform} + +% Redefining the header +\usepackage{fancyhdr} +\pagestyle{fancy} % eigenen Seitestil aktivieren} +\fancyhfoffset{0pt} +%\fancyhead[RO,LE]{\footnotesize \nouppercase\thepage} +\fancyhead[RO,LE]{\normalfont\changefontsizes{8pt} \nouppercase\thepage} +%\fancyhead[RE,LO]{\footnotesize \nouppercase\leftmark} +\fancyhead[RE,LO]{\normalfont\changefontsizes{8pt} \nouppercase\leftmark} + +\renewcommand\chaptermark[1]{\markboth{\thechapter. #1}{}} +\renewcommand{\headrulewidth}{0pt} +\fancyfoot{} +\fancypagestyle{plain}{% +\fancyhead{}} + +% Activate fontspec for various fonts +\usepackage[no-math]{fontspec} +\setmainfont[Mapping=tex-text]{Times New Roman} +%\setsansfont[Mapping=tex-text]{Skia} +%\setromanfont{Geneva} + +% Activate Unicode-Support +\usepackage{xltxtra} +\usepackage{xunicode} + +% Polyglossia is being used instead of babel. +\usepackage{polyglossia} +\setmainlanguage{english} +\setotherlanguage[variant=polytonic]{greek} +\setotherlanguage{english} + +% Definition of fonts for Chinese based on OS +\ifwindows +\newfontfamily\zhfont{DFKai-SB} +\newfontfamily\zhpunctfont{DFKai-SB} +\else +\newfontfamily\zhfont{BiauKai} +\newfontfamily\zhpunctfont{BiauKai} +\fi + +% The package zhspacing makes typesetting chinese much better +\usepackage{zhspacing} +\zhspacing + +% assigning explicit character classes for CJK ambiguous characters +\XeTeXcharclass`“=6 +\XeTeXcharclass`”=6 +\XeTeXcharclass`‘=6 +\XeTeXcharclass`’=6 +\XeTeXcharclass`’=6 +\XeTeXcharclass`…=6 + +% Definition of various fonts based on OS +\ifwindows +\newfontfamily\textchinese{DFKai-SB} +\newfontfamily\chinesefont{DFKai-SB} +\else +\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} +% Those fonts are being used in Berlin only, no need for Windows +\ifwindows +\else +\newfontfamily\Arial{ArialMT} +\newfontfamily\Courier{Courier} +\newfontfamily\Helvetica{Helvetica} +\newfontfamily\Verdana{Verdana} +\fi + +% Equation- and formula-fun +\usepackage{amsmath} +\usepackage{amsthm} +\usepackage{amssymb} +\usepackage{braket} +\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} +\DeclareMathSizes{8}{6.5}{6}{5} + +% Chemical formulas +\usepackage[version=3]{mhchem} + +% Definition of page dimensions depending on serie +\newcommand{\EOAseries}[1]{ +\ifthenelse% +{\equal{#1}{Studies}}% +{\usepackage[paperwidth=170mm,paperheight=240mm,inner=22mm,outer=20mm,top=14mm,bottom=20mm,includehead]{geometry}} +{\usepackage[paperwidth=148mm,paperheight=210mm,inner=20mm,outer=15mm,top=13mm,bottom=15mm,includehead]{geometry}} +} + +\usepackage{pdflscape} + +% Schusterjungen und Hurenkinder +\clubpenalty = 10000 +\widowpenalty = 10000 +\displaywidowpenalty = 10000 + +% Mit raggedbottom wird verhindert, dass Seiten nach unten hin aufgefüllt werden, das Paket here ermöglicht die fixe Positionierung von Bildern +\usepackage{here} +\raggedbottom + +% Gestaltung von Auflistungen im Text +\usepackage{paralist} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% One Command to tweak the style of the bibliography +\newcommand{\EOAbibtweaks}{ +% Remove pp from references +\DeclareFieldFormat{postnote}{##1} +% Remove quotation marks from certain titles +\DeclareFieldFormat[thesis]{title}{\mkbibemph{##1}} +\DeclareFieldFormat[article]{title}{##1} +\DeclareFieldFormat[incollection]{title}{##1} +\DeclareFieldFormat[inproceedings]{title}{##1} +\DeclareFieldFormat[inbook]{title}{\mkbibemph{##1}} +\DeclareFieldFormat{title}{\mkbibemph{##1}} +% Remove pp from bibliography at all +\DeclareFieldFormat{pages}{##1}% +% Remove "In:" from articles +\renewbibmacro{in:}{% + \ifentrytype{article}{}{% + \printtext{\bibstring{in}\intitlepunct}}} +% Delete Vol. as praefix +\DeclareFieldFormat*{volume}{##1} +% Use : for pages of an article, use . for the rest +\renewcommand*{\bibpagespunct}{% +\ifentrytype{article}% +{% +\iffieldundef{Number}% +{\addcolon\hspace{0pt}}% +{}% +}% +{.\space}% +} +% Group Volume and Issue in {Brackets} +\renewbibmacro*{journal+issuetitle}{% + \usebibmacro{journal}% + \setunit*{\addspace}% + \iffieldundef{series} + {} + {\newunit + \printfield{series}% + \setunit{\addspace}}% + \printfield{volume}% + \iffieldundef{number} + {} + {\mkbibparens{\printfield{number}}}% + \setunit{\addcomma\space}% + \printfield{eid}% + \setunit{\addspace}% + \usebibmacro{issue+date}% + \setunit{\addcolon\space}% + \usebibmacro{issue}% + \newunit} +% Bug fix for Windows +\defbibheading{none}[]{} +} + +% Einbindung des biblatex-Pakets mittels \EOAbibliographytype +\newcommand{\EOAbibliographytype}[1]{% +\ifthenelse% +{\equal{#1}{anthology}}% +{\usepackage[mincitenames=1,maxcitenames=3,maxbibnames=100,style=authoryear,backend=biber,babel=hyphen]{biblatex} +\newboolean{anthology} +\setboolean{anthology}{true} +\EOAbibtweaks +}{}% +\ifthenelse% +{\equal{#1}{anthology-numeric}}% +{\usepackage[mincitenames=1,maxcitenames=3,maxbibnames=100,style=numeric-comp,sorting=none,backend=biber,babel=hyphen]{biblatex} +\newboolean{anthology} +\setboolean{anthology}{true} +\EOAbibtweaks +}{}% +\ifthenelse% +{\equal{#1}{monograph}}% +{\usepackage[mincitenames=1,maxcitenames=3,maxbibnames=100,style=authoryear,backend=biber,babel=hyphen,language=english]{biblatex} +\newboolean{anthology} +\setboolean{anthology}{false} +\EOAbibtweaks +}{}% +\ifthenelse% +{\equal{#1}{monograph-numeric}}% +{\usepackage[mincitenames=1,maxcitenames=3,maxbibnames=100,style=numeric-comp,sorting=none,backend=biber,babel=hyphen]{biblatex} +\newboolean{anthology} +\setboolean{anthology}{false} +\EOAbibtweaks +}{}% +}% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% The command EOApublicationtype may be used to adjust some settings + +% If the type is essay, then the numbering of sections etc. need to be +% adjusted, ie. 1. Headline and not 0.1 Headline +\newboolean{essaynumbering} +\setboolean{essaynumbering}{false} +\newcommand{\EOApublicationtype}[1]{% +\ifthenelse% +{\equal{#1}{essay}}% +{ +\renewcommand{\thesection}{\arabic{section}} +\renewcommand{\theequation}{\arabic{equation}} +\renewcommand{\thefigure}{\arabic{figure}} +\renewcommand{\thetable}{\arabic{table}} +\setboolean{essaynumbering}{true} +}{} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% ------------------- formatierung der Fussnoten Anfang --------- +\usepackage[flushmargin]{footmisc} +\setlength{\footnotemargin}{2.4mm} +% ------------------- formatierung der Fussnoten Ende --------- + +% cpation dient zur Realisierung der Bildunterschriften +\usepackage{caption} +% footnote-package needed to typeset footnotes in captions +% problem was that both footnotes and captions are fragile +\usepackage{footnote} +% Für die Einbindung von Grafiken +\usepackage{graphicx} +% Mit float wird die Option H bei der Posotionierung von Graifken ermöglicht +\usepackage{float} + +% Für die Formatierung von URLs im Fließtext, escapen ist damit nicht mehr notwendig +\usepackage{url} +\urlstyle{rm} + +% Stichwortverzeichnis mit den Standard-TeX-Funktionen +\usepackage{imakeidx} +\makeindex[name=keywords] +\makeindex[name=persons] + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Formatierung der Überschriften Anfang +\usepackage{setspace} +\usepackage{titlesec} +\usepackage{titletoc} + +\titleformat{\part}[block] +{\normalfont \rmfamily}% +{\singlespacing\flushright\textbf{Part \thepart}\flushright}% +{0em}% +{\flushright\textbf} +\titlespacing*{\part} {0pt}{-30pt}{0pt} + +\titleformat{\chapter}[display] +{\normalfont \rmfamily\large} +{\singlespacing\textbf{Chapter \thechapter\quad}}% +{0em}% +{\textbf} +\titlespacing*{\chapter} {0pt}{-30pt}{80pt} + +\titleformat{\section}[hang] +{\normalfont \rmfamily} +{\bfseries\thesection\quad}% +{0em}% +{\textbf} + +\titleformat{\subsection}[hang] +{\normalfont \rmfamily} +{\textbf\thesubsection\quad}% +{0em}% +{\textbf} + +\titleformat{\subsubsection}[hang] +{\normalfont \rmfamily} +{\textbf\thesubsection\quad}% +{0em}% +{\textbf} + +% Formatierung der Überschriften Ende +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Tiefe des Inhaltsverzeichnisses +\setcounter{tocdepth}{1} +%use to repress subsections in the table of content (GP, 14.07.2015) +%\setcounter{tocdepth}{0} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Formatierung des Inhaltsverzeichnisses +\titlecontents{part}[0.2em]{\addvspace{1em}\bfseries}{}{}{\normalfont\rmfamily\hfill\contentspage} +\titlecontents{chapter}[3em]{\addvspace{1em}\bfseries}{\contentslabel{2.8em}}{}{\normalfont\rmfamily\dotfill\contentspage} +\titlecontents{section}[3em]{}{\contentslabel{2.8em}}{}{\dotfill\contentspage} +\makeatletter +\renewcommand\@pnumwidth{2em} +\makeatother +% Formatierung des Inhaltsverzeichnisses +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Definition einiger Makros zur Erhöhung des Bedienkomforts - Anfang + +% Makro für kursiven Text +\newcommand{\EOAemph}[1]{\emph{#1}} +% Makro für einen URL +\newcommand{\EOAurl}[1]{\protect\url{#1}} +% Makro für hochgestellten Text +\newcommand{\EOAup}[1]{\textsuperscript{#1}} +% Makro für tiefgestelten Text +\newcommand{\EOAdown}[1]{\textsubscript{#1}} +% Makro for Greek Text: \greek{} +\newcommand{\EOAgreek}[1]{{\greekfont #1}} +% Makro for chinese Text: \EOAchinese{} +\newcommand{\EOAchinese}[1]{{\chinesefont #1}} +% Makro for russian Text: \EOArussian{} +\newcommand{\EOArussian}[1]{{\russianfont #1}} +% Makro for hebrew Text: \EOAhebrew{} +\newcommand{\EOAhebrew}[1]{{\hebrewfont #1}} +% Makro for Inline-Figure: \EOAinline{File} +\newcommand{\EOAinline}[1]{\includegraphics[height=0.85em,keepaspectratio]{#1}} +% New command for Footnotes +\newcommand{\EOAfn}[1]{\protect\footnote{#1}} +% New command for ~ +\newcommand{\EOAtilde}{\textasciitilde{}} +% New command for referencing objects (i.e. figures) +\newcommand{\EOAref}[1]{\ref{#1}} +% New command for referencing pages +\newcommand{\EOApageref}[1]{\pageref{#1}} +% New command for label +\newcommand{\EOAlabel}[1]{\label{#1}} +% New command for marking index entries +\newcommand{\EOAindex}[1]{\index[keywords]{#1}} +% New command for printing index +\newcommand{\EOAprintindex}{\printindex[keywords]} +% New command for marking person index entries +\newcommand{\EOAindexperson}[1]{\index[persons]{#1}} +% New command for printing person index +\newcommand{\EOAprintpersonindex}{\printindex[persons]} +% New command for marking location index entries +\newcommand{\EOAindexlocation}[1]{\index[locations]{#1}} +% New command for printing location index +\newcommand{\EOAprintlocationindex}{\printindex[locations]} + +% New command for Table of Content +\newcommand{\EOAtoc}{\tableofcontents} +% New command for ToC-Entries +\newcommand{\EOAtocentry}[1]{\addtocontents{toc}{\hspace{15pt}\normalfont{\textbf{#1}}\par}} +% New command for parts +\newcommand{\EOApart}[1]{\part*{#1}} +% New command for parts +\newcommand{\EOAfacsimilepart}[1]{\part*{#1} +%--------------------- Formatting the facsimile part +\pagestyle{fancy} % eigenen Seitestil aktivieren} +\fancyhf{} % Alle Felder loeschen +\renewcommand{\headrulewidth}{0pt} +\fancyhead[EL,OR]{\footnotesize\thepage} +\fancypagestyle{plain}{% +\fancyhead{}} +} +% New command for numbered chapters +\newcommand{\EOAchapter}[2]{ +\chapter[#2]{#2} +\chaptermark{#1} +\ifthenelse{\boolean{anthology}}{ +\newrefsection +} +{} +} +% New command for not numbered chapters +\newcommand{\EOAchapternonumber}[2]{ +\setcounter{secnumdepth}{-1} +\chapter[#2]{#2} +\markboth{#1}{} +\ifthenelse{\boolean{anthology}}{ +\newrefsection +} +{} +\ifthenelse{\boolean{essaynumbering}}{ +\setcounter{section}{0} +\setcounter{equation}{0} +\setcounter{figure}{0} +\setcounter{table}{0} +\setcounter{footnote}{0} +} +{} +\setcounter{secnumdepth}{2} +} +% New command for Author in Headline +\newcommand{\EOAauthor}[1]{\\ \textnormal{\textit{ #1}}} +% New command for sections +\newcommand{\EOAsection}[1]{\section{#1}} +% New command for subsections +\newcommand{\EOAsubsection}[1]{\subsection{#1}} +% New command for not numbered sections +\newcommand{\EOAsectionnonumber}[1]{\setcounter{secnumdepth}{-1}\section{#1}\setcounter{secnumdepth}{2}} +% New command for not numbered subsections +\newcommand{\EOAsubsectionnonumber}[1]{\setcounter{secnumdepth}{-1}\subsection{#1}\setcounter{secnumdepth}{2}} +%New command for subsubsection +\newcommand{\EOAsubsubsection}[1]{\subsubsection*{#1}} + +% New command for an empty page +\newcommand{\EOAemptypage}{\clearpage% +\thispagestyle{empty}% +     %-------------------------- using invisible characters +\newpage% +} +% New command for a pagebreak +\newcommand{\EOAnewpage}{ +\ifthenelse% +{\strcmp{\@currenvir}{EOAtranscripted}=1}% +{\newpage\EOAtranscriptedheader} +{\clearpage} +} +% New Environment for bilungual doublesided transcription +\newenvironment{EOAtranscripted}[2]{ +\renewcommand{\EOAtranscriptedheader}{\noindent\makebox[\textwidth][c]{\footnotesize\MakeUppercase{#2}}\vspace*{0.5cm}\\} +\makeatletter +\clearpage\if@twoside + \ifodd\c@page \hbox{}\newpage\if@twocolumn\hbox{}% + \newpage\fi\fi\fi +\makeatother +\noindent\makebox[\textwidth][c]{\footnotesize\MakeUppercase{#1}}\vspace*{0.5cm}\\ +}{\clearpage} +% Here definded pro forma in conjunction with EOAtranscripted +\newcommand{\EOAtranscriptedheader}{} +% Environment for quoting +\newenvironment{EOAquote}{\begin{quote}}{\end{quote}} +% Environment for Lists +\newenvironment{EOAlist}{\medskip\begin{compactenum}}{\end{compactenum}\medskip} +% Environment for undordered list +\newenvironment{EOAitems}{\medskip\begin{compactitem}}{\end{compactitem}\medskip} +% Command to define a theorem +\newcommand{\EOAnewtheorem}[2]{\newtheorem{#1}{#2}} +% Environment for descriptions +\newenvironment{EOAdescription}{\medskip\begin{description}}{\end{description}\medskip} +\renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\emph{#1}} +% New command for short equation +\newcommand{\EOAineq}[1]{$#1$} +% Environment for Equations +% Multilines may be used with \begin{split} and \\ to mark a linebreak +\newenvironment{EOAequation}[1]{\begin{equation} +\label{#1} +}{\end{equation}} +% Environment for Subequations +\newenvironment{EOAsubequations}[1]{\begin{subequations} +\label{#1} +}{\end{subequations}} +% Environment for unnumbered Equation +\newenvironment{EOAequationnonumber}{\begin{equation*}}{\end{equation*}} +% Environment for numbered Equation array +\newenvironment{EOAequationarray}[1]{\csname align\endcsname}{\csname endalign\endcsname\ignorespacesafterend} +% Environment for not numbered Equation array +\newenvironment{EOAequationarraynonumber}{\csname align*\endcsname}{\csname endalign*\endcsname\ignorespacesafterend} + +% Makro for Figure: \EOAfigure{File}{Caption}{Label}{Width}{Position} +\newcommand{\EOAfigure}[5]{ +% Redefinition and \makesavenoteenv necessary to enable footnotes in captions +\makesavenoteenv[figure*]{figure} +\begin{figure*}[#5] +\begin{center} +\includegraphics[width=0.#4\textwidth]{#1} +\captionsetup{format=hang,singlelinecheck=false}\caption{#2} +%use to center single-line captions and have captions longer than one line at the left, in the preamble (GP, 14.07.2015) +%\captionsetup{singlelinecheck=false,font=small,format=hang,justification=centering,singlelinecheck=true,font=small,format=hang,justification=raggedright} +\caption{#2} +\label{#3} +\end{center} +\end{figure*} +} +% Makro for non numbered Figure: \EOAfigurenonumber{File}{Width}{Position} +\newcommand{\EOAfigurenonumber}[3]{ +% Redefinition and \makesavenoteenv necessary to enable footnotes in captions +\makesavenoteenv[figure*]{figure} +\begin{figure*}[#3] +\begin{center} +\includegraphics[width=0.#2\textwidth]{#1} +\end{center} +\end{figure*} +} +% Makro for Landscape-Figure: \EOAfigure{File}{Caption}{Label} +\newcommand{\EOAlsfigure}[3]{ +\begin{landscape} +\begin{figure}[p] +\begin{center} +\includegraphics[width=1.35\textwidth]{#1} +\caption{#2} +\label{#3} +\end{center} +\end{figure} +\end{landscape} +} +% Makro for Facimile: \EOAfacsimile{File}{Label} +\newcommand{\EOAfacsimile}[4][]{% +\fancyhead[RE,LO]{\footnotesize \nouppercase #4}\begin{figure}[H] \begin{center} \label{#3} \includegraphics[width=1.0\textwidth]{#2} \end{center} \end{figure}\clearpage% +} +% Command for bibliographies as sections within a chapter +\newcommand{\EOAprintbibliography}{\printbibliography[heading=none]} +% Command for .bib-Database +\newcommand{\EOAbibliographydatabase}[1]{ +\bibliography{#1} +} +% Command for quotation Name Year, Page +\newcommand{\EOAciteauthoryear}[2][seitenangabe]{% +\ifthenelse% +{\equal{#1}{seitenangabe}}% +{\cite{#2}}% +{\cite[#1]{#2}}% +} +% Command for quotation Year, Page +\newcommand{\EOAciteyear}[2][seitenangabe]{% +\ifthenelse% +{\equal{#1}{seitenangabe}}% +{\cite*{#2}}% +{\cite*[#1]{#2}}% +} +% Command for manual quotation +\newcommand{\EOAcitemanual}[2][kuerzel]{% +\ifthenelse% +{\equal{#1}{kuerzel}}% +{\notecite{#2}}% +{\notecite[#1]{#2}}% +} +% Command for manual quotation +\newcommand{\EOAcitenumeric}[2][seitenangabe]{% +\ifthenelse% +{\equal{#1}{seitenangabe}}% +{\cites{#2}}% +{\cites[#1]{#2}}% +} +% Definition einiger Makros zur Erhöhung des Bedienkomforts - Ende +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%% Tables - Beginning + +\usepackage[table]{xcolor} +\usepackage{tabularx} +\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} % linksbündig mit Breitenangabe +\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % zentriert mit Breitenangabe +\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % rechtsbündig mit Breitenangabe + +\newcommand{\EOAtablehead}[1]{\rowcolor{black!10} +#1\\ +\hline\hline +} +\newenvironment{EOAtable}[4]% +{ +\rowcolors{1}{black!3}{black!7} +\ifthenelse% +{\strcmp{#2}{nonumber}=0}% +{ +% if the caption is equal to 'no number', then omit caption and label +} +{ +% if the caption is not equal to 'no number', then use caption and label +\renewcommand{\tmpEOAtablecaption}{\caption{#2}} +\renewcommand{\tmpEOAtablelable}{\label{#3}} +} +\begin{table}[#4] +\begin{center} +\begin{tabular}{|#1|} +\hline +} +{ +\hline +\end{tabular} +\end{center} +\tmpEOAtablecaption +\tmpEOAtablelable +\renewcommand{\tmpEOAtablecaption}{} +\renewcommand{\tmpEOAtablelable}{} +\end{table} +} +% Definition of temporary commands to enable the caption and the label in the ending part of the EOAtable-environment +\newcommand{\tmpEOAtablecaption}{} +\newcommand{\tmpEOAtablelable}{} + +%%%%%%%%%%%% Tables - End + +%%%%%%%%%%%% Letter - Beginning (Work in Progress) +\newcommand{\EOAletterhead}[4]{% +\definecolor{grau}{rgb}{0.9,0.9,0.9} +\definecolor{schwarz}{rgb}{0,0,0} +\fcolorbox{schwarz}{grau}{#1} +%\framebox[\textwidth][l]{TEST} +#1\\ #2 \\ #3 \\ #4 +} +\newcommand{\kopf}[1]{#1} +\newcommand{\kurz}[1]{#1} +%%%%%%%%%%%% Letter - End + +% Some fixes concerning XeTeX and the n-dash + +\XeTeXinterchartokenstate=1 +\XeTeXcharclass`\–=150 +\XeTeXinterchartoks 150 0 = {\kern0em } + +% Give more space per line, makes hyphenation better +\setlength\emergencystretch{3em} + +\usepackage[german=quotes]{csquotes} \ No newline at end of file diff --git a/TeX/pre_mac.tex b/TeX/pre_mac.tex new file mode 100755 index 0000000..3047c43 --- /dev/null +++ b/TeX/pre_mac.tex @@ -0,0 +1,571 @@ +% Version: 1.1 +% 24.10.2012 +% Last modifier: Kai + +\documentclass[10pt,openright,twoside]{scrbook} + +% Grundlegende Paketes, das für die Programmierlogik hilfreich ist +\usepackage{xifthen} + +% Redefinierung der Kopfzeile +\usepackage{fancyhdr} +\pagestyle{fancy} % eigenen Seitestil aktivieren} +\fancyhfoffset{0pt} +\fancyhead[RO,LE]{\footnotesize \nouppercase\thepage} +\fancyhead[RE,LO]{\footnotesize \nouppercase\leftmark} +\renewcommand\chaptermark[1]{\markboth{\thechapter. #1}{}} +\renewcommand{\headrulewidth}{0pt} +\fancyfoot{} +\fancypagestyle{plain}{% +\fancyhead{}} + +% Mit fontspec werden die Schriftarten definiert. +\usepackage[no-math]{fontspec} +\setmainfont[Mapping=tex-text]{Times New Roman} +%\setsansfont[Mapping=tex-text]{Skia} +%\setromanfont{Geneva} + +% Unicode-Unterstützung +\usepackage{xltxtra} +\usepackage{xunicode} + +% Polyglossia ist für Silbentrennung und generell Sprachunterstützung zuständig. +\usepackage{polyglossia} +\setmainlanguage{english} +\setotherlanguage[variant=polytonic]{greek} +\setotherlanguage{german} + +% 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 + +% assigning explicit character classes for CJK ambiguous characters +\XeTeXcharclass`“=6 +\XeTeXcharclass`”=6 +\XeTeXcharclass`‘=6 +\XeTeXcharclass`’=6 +\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} +% Diese Schriftarten werden in der finalen Fassung nur für die interne Präambel insbesondere für den Frontmatter genutzt +\newfontfamily\Arial{ArialMT} +\newfontfamily\Courier{Courier} +\newfontfamily\Helvetica{Helvetica} +\newfontfamily\Verdana{Verdana} + +% Für mathematische und physikalische Formeln +\usepackage{amsmath} +\usepackage{amsthm} +\usepackage{amssymb} +\usepackage{braket} +\usepackage{slashed} +\usepackage[bold-style=TeX,math-style=TeX]{unicode-math} +\setmathfont[active-frac=small]{Cambria Math} +\setmathfont[version=bold,FakeBold=1.5]{Cambria Math} +\DeclareMathSizes{8}{6.5}{6}{5} + +% Für chemische Formeln +\usepackage[version=3]{mhchem} + +% Definition der Seitengröße +\usepackage[paperwidth=148mm,paperheight=210mm,inner=20mm,outer=15mm,top=13mm,bottom=15mm,includehead]{geometry} +\usepackage{pdflscape} + +% Schusterjungen und Hurenkinder +\clubpenalty = 10000 +\widowpenalty = 10000 +\displaywidowpenalty = 10000 + +% Mit raggedbottom wird verhindert, dass Seiten nach unten hin aufgefüllt werden, das Paket here ermöglicht die fixe Positionierung von Bildern +\usepackage{here} +\raggedbottom + +% Gestaltung von Auflistungen im Text +\usepackage{paralist} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% One Command to tweak the style of the bibliography +\newcommand{\EOAbibtweaks}{ +% Remove pp from references +\DeclareFieldFormat{postnote}{##1} +% Remove quotation marks from certain titles +\DeclareFieldFormat[thesis]{title}{\mkbibemph{##1}} +\DeclareFieldFormat[article]{title}{##1} +\DeclareFieldFormat[incollection]{title}{##1} +\DeclareFieldFormat[inproceedings]{title}{##1} +\DeclareFieldFormat[inbook]{title}{\mkbibemph{##1}} +\DeclareFieldFormat{title}{\mkbibemph{##1}} +% Remove pp from bibliography at all +\DeclareFieldFormat{pages}{##1}% +% Remove "In:" from articles +\renewbibmacro{in:}{% + \ifentrytype{article}{}{% + \printtext{\bibstring{in}\intitlepunct}}} +% Delete Vol. as praefix +\DeclareFieldFormat*{volume}{##1} +% Use : for pages of an article, use . for the rest +\renewcommand*{\bibpagespunct}{% +\ifentrytype{article}% +{% +\iffieldundef{Number}% +{\addcolon\hspace{0pt}}% +{}% +}% +{.\space}% +} +% Group Volume and Issue in {Brackets} +\renewbibmacro*{journal+issuetitle}{% + \usebibmacro{journal}% + \setunit*{\addspace}% + \iffieldundef{series} + {} + {\newunit + \printfield{series}% + \setunit{\addspace}}% + \printfield{volume}% + \iffieldundef{number} + {} + {\mkbibparens{\printfield{number}}}% + \setunit{\addcomma\space}% + \printfield{eid}% + \setunit{\addspace}% + \usebibmacro{issue+date}% + \setunit{\addcolon\space}% + \usebibmacro{issue}% + \newunit} +% Bug fix for Windows +\defbibheading{none}[]{} +} + +% Einbindung des biblatex-Pakets mittels \EOAbibliographytype +\newcommand{\EOAbibliographytype}[1]{% +\ifthenelse% +{\equal{#1}{anthology}}% +{\usepackage[mincitenames=1,maxcitenames=3,maxbibnames=100,style=authoryear,backend=biber,babel=hyphen]{biblatex} +\newboolean{anthology} +\setboolean{anthology}{true} +\EOAbibtweaks +}{}% +\ifthenelse% +{\equal{#1}{anthology-numeric}}% +{\usepackage[mincitenames=1,maxcitenames=3,maxbibnames=100,style=numeric-comp,sorting=none,backend=biber,babel=hyphen]{biblatex} +\newboolean{anthology} +\setboolean{anthology}{true} +\EOAbibtweaks +}{}% +\ifthenelse% +{\equal{#1}{monograph}}% +{\usepackage[mincitenames=1,maxcitenames=3,maxbibnames=100,style=authoryear,backend=biber,babel=hyphen]{biblatex} +\newboolean{anthology} +\setboolean{anthology}{false} +\EOAbibtweaks +}{}% +\ifthenelse% +{\equal{#1}{monograph-numeric}}% +{\usepackage[mincitenames=1,maxcitenames=3,maxbibnames=100,style=numeric-comp,sorting=none,backend=biber,babel=hyphen]{biblatex} +\newboolean{anthology} +\setboolean{anthology}{false} +\EOAbibtweaks +}{}% +}% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% The command EOApublicationtype may be used to adjust some settings + +% If the type is essay, then the numbering of sections etc. need to be +% adjusted, ie. 1. Headline and not 0.1 Headline +\newboolean{essaynumbering} +\setboolean{essaynumbering}{false} +\newcommand{\EOApublicationtype}[1]{% +\ifthenelse% +{\equal{#1}{essay}}% +{ +\renewcommand{\thesection}{\arabic{section}} +\renewcommand{\theequation}{\arabic{equation}} +\renewcommand{\thefigure}{\arabic{figure}} +\renewcommand{\thetable}{\arabic{table}} +\setboolean{essaynumbering}{true} +}{} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% ------------------- formatierung der Fussnoten Anfang --------- +\usepackage[flushmargin]{footmisc} +\setlength{\footnotemargin}{2.4mm} +% ------------------- formatierung der Fussnoten Ende --------- + +% cpation dient zur Realisierung der Bildunterschriften +\usepackage{caption} +% footnote-package needed to typeset footnotes in captions +% problem was that both footnotes and captions are fragile +\usepackage{footnote} +% Für die Einbindung von Grafiken +\usepackage{graphicx} +% Mit float wird die Option H bei der Posotionierung von Graifken ermöglicht +\usepackage{float} + +% Für die Formatierung von URLs im Fließtext, escapen ist damit nicht mehr notwendig +\usepackage{url} +\urlstyle{rm} + +% Stichwortverzeichnis mit den Standard-TeX-Funktionen +\usepackage{imakeidx} +\makeindex[name=keywords] +\makeindex[name=persons] + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Formatierung der Überschriften Anfang +\usepackage{setspace} +\usepackage{titlesec} +\usepackage{titletoc} + +\titleformat{\part}[block] +{\rm}% +{\singlespacing\flushright\textbf{Part \thepart}\flushright}% +{0em}% +{\flushright\textbf} +\titlespacing*{\part} {0pt}{-30pt}{0pt} + +\titleformat{\chapter}[display] +{\rm\large} +{\singlespacing\textbf{Chapter \thechapter\quad}}% +{0em}% +{\textbf} +\titlespacing*{\chapter} {0pt}{-30pt}{80pt} + +\titleformat{\section}[hang] +{\rm} +{\bfseries\thesection\quad}% +{0em}% +{\textbf} + +\titleformat{\subsection}[hang] +{\rm} +{\textbf\thesubsection\quad}% +{0em}% +{\textbf} + +\titleformat{\subsubsection}[hang] +{\rm} +{\textbf\thesubsection\quad}% +{0em}% +{\textbf} + +% Formatierung der Überschriften Ende +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Tiefe des Inhaltsverzeichnisses +\setcounter{tocdepth}{1} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Formatierung des Inhaltsverzeichnisses +\titlecontents{part}[0.2em]{\addvspace{1em}\bfseries}{}{}{\rm\hfill\contentspage} +\titlecontents{chapter}[3em]{\addvspace{1em}\bfseries}{\contentslabel{2.8em}}{}{\rm\dotfill\contentspage} +\titlecontents{section}[3em]{}{\contentslabel{2.8em}}{}{\dotfill\contentspage} +\makeatletter +\renewcommand\@pnumwidth{2em} +\makeatother +% Formatierung des Inhaltsverzeichnisses +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Definition einiger Makros zur Erhöhung des Bedienkomforts - Anfang + +% Makro für kursiven Text +\newcommand{\EOAemph}[1]{\emph{#1}} +% Makro für einen URL +\newcommand{\EOAurl}[1]{\protect\url{#1}} +% Makro für hochgestellten Text +\newcommand{\EOAup}[1]{\textsuperscript{#1}} +% Makro für tiefgestelten Text +\newcommand{\EOAdown}[1]{\textsubscript{#1}} +% Makro for Greek Text: \greek{} +\newcommand{\EOAgreek}[1]{{\greekfont #1}} +% Makro for chinese Text: \EOAchinese{} +\newcommand{\EOAchinese}[1]{{\chinesefont #1}} +% Makro for russian Text: \EOArussian{} +\newcommand{\EOArussian}[1]{{\russianfont #1}} +% Makro for hebrew Text: \EOAhebrew{} +\newcommand{\EOAhebrew}[1]{{\hebrewfont #1}} +% Makro for Inline-Figure: \EOAinline{File} +\newcommand{\EOAinline}[1]{\includegraphics[height=0.7em,keepaspectratio]{#1}} +% New command for Footnotes +\newcommand{\EOAfn}[1]{\protect\footnote{#1}} +% New command for ~ +\newcommand{\EOAtilde}{\textasciitilde{}} +% New command for referencing objects (i.e. figures) +\newcommand{\EOAref}[1]{\ref{#1}} +% New command for referencing pages +\newcommand{\EOApageref}[1]{\pageref{#1}} +% New command for label +\newcommand{\EOAlabel}[1]{\label{#1}} +% New command for marking index entries +\newcommand{\EOAindex}[1]{\index[keywords]{#1}} +% New command for printing index +\newcommand{\EOAprintindex}{\printindex[keywords]} +% New command for marking person index entries +\newcommand{\EOAindexperson}[1]{\index[persons]{#1}} +% New command for printing person index +\newcommand{\EOAprintpersonindex}{\printindex[persons]} + +% New command for Table of Content +\newcommand{\EOAtoc}{\tableofcontents} +% New command for ToC-Entries +\newcommand{\EOAtocentry}[1]{\addtocontents{toc}{\hspace{15pt}\rm{\bf{#1}}\par}} +% New command for parts +\newcommand{\EOApart}[1]{\part*{#1}} +% New command for parts +\newcommand{\EOAfacsimilepart}[1]{\part*{#1} +%--------------------- Formatting the facsimile part +\pagestyle{fancy} % eigenen Seitestil aktivieren} +\fancyhf{} % Alle Felder loeschen +\renewcommand{\headrulewidth}{0pt} +\fancyhead[EL,OR]{\footnotesize\thepage} +\fancypagestyle{plain}{% +\fancyhead{}} +} +% New command for numbered chapters +\newcommand{\EOAchapter}[2]{ +\chapter[#2]{#2} +\chaptermark{#1} +\ifthenelse{\boolean{anthology}}{ +\newrefsection +} +{} +} +% New command for not numbered chapters +\newcommand{\EOAchapternonumber}[2]{ +\setcounter{secnumdepth}{-1} +\chapter[#2]{#2} +\markboth{#1}{} +\ifthenelse{\boolean{anthology}}{ +\newrefsection +} +{} +\ifthenelse{\boolean{essaynumbering}}{ +\setcounter{section}{0} +\setcounter{equation}{0} +\setcounter{figure}{0} +\setcounter{table}{0} +} +{} +\setcounter{secnumdepth}{2} +} +% New command for Author in Headline +\newcommand{\EOAauthor}[1]{\\ {\rm{\it #1}}} +% New command for sections +\newcommand{\EOAsection}[1]{\section{#1}} +% New command for subsections +\newcommand{\EOAsubsection}[1]{\subsection{#1}} +% New command for not numbered sections +\newcommand{\EOAsectionnonumber}[1]{\setcounter{secnumdepth}{-1}\section{#1}\setcounter{secnumdepth}{2}} +% New command for not numbered subsections +\newcommand{\EOAsubsectionnonumber}[1]{\setcounter{secnumdepth}{-1}\subsection{#1}\setcounter{secnumdepth}{2}} +%New command for subsubsection +\newcommand{\EOAsubsubsection}[1]{\subsubsection*{#1}} + +% New command for an empty page +\newcommand{\EOAemptypage}{\clearpage% +\thispagestyle{empty}% +     %-------------------------- using invisible characters +\newpage% +} +% New command for a pagebreak +\newcommand{\EOAnewpage}{ +\ifthenelse% +{\strcmp{\@currenvir}{EOAtranscripted}=1}% +{\newpage\EOAtranscriptedheader} +{\clearpage} +} +% New Environment for bilungual doublesided transcription +\newenvironment{EOAtranscripted}[2]{ +\renewcommand{\EOAtranscriptedheader}{\noindent\makebox[\textwidth][c]{\footnotesize\MakeUppercase{#2}}\vspace*{0.5cm}\\} +\makeatletter +\clearpage\if@twoside + \ifodd\c@page \hbox{}\newpage\if@twocolumn\hbox{}% + \newpage\fi\fi\fi +\makeatother +\noindent\makebox[\textwidth][c]{\footnotesize\MakeUppercase{#1}}\vspace*{0.5cm}\\ +}{\clearpage} +% Here definded pro forma in conjunction with EOAtranscripted +\newcommand{\EOAtranscriptedheader}{} +% Environment for quoting +\newenvironment{EOAquote}{\begin{quote}}{\end{quote}} +% Environment for Lists +\newenvironment{EOAlist}{\medskip\begin{compactenum}}{\end{compactenum}\medskip} +% Environment for undordered list +\newenvironment{EOAitems}{\medskip\begin{compactitem}}{\end{compactitem}\medskip} +% Command to define a theorem +\newcommand{\EOAnewtheorem}[2]{\newtheorem{#1}{#2}} +% Environment for descriptions +\newenvironment{EOAdescription}{\medskip\begin{description}}{\end{description}\medskip} +\renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\emph{#1}} +% New command for short equation +\newcommand{\EOAineq}[1]{$#1$} +% Environment for Equations +% Multilines may be used with \begin{split} and \\ to mark a linebreak +\newenvironment{EOAequation}[1]{\begin{equation} +\label{#1} +}{\end{equation}} +% Environment for Subequations +\newenvironment{EOAsubequations}[1]{\begin{subequations} +\label{#1} +}{\end{subequations}} +% Environment for unnumbered Equation +\newenvironment{EOAequationnonumber}{\begin{equation*}}{\end{equation*}} +% Environment for numbered Equation array +\newenvironment{EOAequationarray}[1]{\csname align\endcsname}{\csname endalign\endcsname\ignorespacesafterend} +% Environment for not numbered Equation array +\newenvironment{EOAequationarraynonumber}{\csname align*\endcsname}{\csname endalign*\endcsname\ignorespacesafterend} + +% Makro for Figure: \EOAfigure{File}{Caption}{Label}{Width}{Position} +\newcommand{\EOAfigure}[5]{ +% Redefinition and \makesavenoteenv necessary to enable footnotes in captions +\makesavenoteenv[figure*]{figure} +\begin{figure*}[#5] +\begin{center} +\includegraphics[width=0.#4\textwidth]{#1} +\caption{#2} +\label{#3} +\end{center} +\end{figure*} +} +% Makro for non numbered Figure: \EOAfigurenonumber{File}{Width}{Position} +\newcommand{\EOAfigurenonumber}[3]{ +% Redefinition and \makesavenoteenv necessary to enable footnotes in captions +\makesavenoteenv[figure*]{figure} +\begin{figure*}[#3] +\begin{center} +\includegraphics[width=0.#2\textwidth]{#1} +\end{center} +\end{figure*} +} +% Makro for Landscape-Figure: \EOAfigure{File}{Caption}{Label} +\newcommand{\EOAlsfigure}[3]{ +\begin{landscape} +\begin{figure}[p] +\begin{center} +\includegraphics[width=1.35\textwidth]{#1} +\caption{#2} +\label{#3} +\end{center} +\end{figure} +\end{landscape} +} +% Makro for Facimile: \EOAfacsimile{File}{Label} +\newcommand{\EOAfacsimile}[4][]{% +\fancyhead[RE,LO]{\footnotesize \nouppercase #4}\begin{figure}[H] \begin{center} \label{#3} \includegraphics[width=1.0\textwidth]{#2} \end{center} \end{figure}\clearpage% +} +% Command for bibliographies as sections within a chapter +\newcommand{\EOAprintbibliography}{\printbibliography[heading=none]} +% Command for .bib-Database +\newcommand{\EOAbibliographydatabase}[1]{ +\bibliography{#1} +} +% Command for quotation Name Year, Page +\newcommand{\EOAciteauthoryear}[2][seitenangabe]{% +\ifthenelse% +{\equal{#1}{seitenangabe}}% +{\cite{#2}}% +{\cite[#1]{#2}}% +} +% Command for quotation Year, Page +\newcommand{\EOAciteyear}[2][seitenangabe]{% +\ifthenelse% +{\equal{#1}{seitenangabe}}% +{\cite*{#2}}% +{\cite*[#1]{#2}}% +} +% Command for manual quotation +\newcommand{\EOAcitemanual}[2][kuerzel]{% +\ifthenelse% +{\equal{#1}{kuerzel}}% +{\notecite{#2}}% +{\notecite[#1]{#2}}% +} +% Command for manual quotation +\newcommand{\EOAcitenumeric}[2][seitenangabe]{% +\ifthenelse% +{\equal{#1}{seitenangabe}}% +{\cites{#2}}% +{\cites[#1]{#2}}% +} +% Definition einiger Makros zur Erhöhung des Bedienkomforts - Ende +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%% Tables - Beginning + +\usepackage[table]{xcolor} +\usepackage{tabularx} +\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} % linksbündig mit Breitenangabe +\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % zentriert mit Breitenangabe +\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % rechtsbündig mit Breitenangabe + +\newcommand{\EOAtablehead}[1]{\rowcolor{black!10} +#1\\ +\hline\hline +} +\newenvironment{EOAtable}[4]% +{ +\rowcolors{1}{black!3}{black!7} +\ifthenelse% +{\strcmp{#2}{nonumber}=0}% +{ +% if the caption is equal to 'no number', then omit caption and label +} +{ +% if the caption is not equal to 'no number', then use caption and label +\renewcommand{\tmpEOAtablecaption}{\caption{#2}} +\renewcommand{\tmpEOAtablelable}{\label{#3}} +} +\begin{table}[#4] +\begin{center} +\begin{tabular}{|#1|} +\hline +} +{ +\hline +\end{tabular} +\end{center} +\tmpEOAtablecaption +\tmpEOAtablelable +\renewcommand{\tmpEOAtablecaption}{} +\renewcommand{\tmpEOAtablelable}{} +\end{table} +} +% Definition of temporary commands to enable the caption and the label in the ending part of the EOAtable-environment +\newcommand{\tmpEOAtablecaption}{} +\newcommand{\tmpEOAtablelable}{} + +%%%%%%%%%%%% Tables - End + +%%%%%%%%%%%% Letter - Beginning (Work in Progress) +\newcommand{\EOAletterhead}[4]{% +\definecolor{grau}{rgb}{0.9,0.9,0.9} +\definecolor{schwarz}{rgb}{0,0,0} +\fcolorbox{schwarz}{grau}{#1} +%\framebox[\textwidth][l]{TEST} +#1\\ #2 \\ #3 \\ #4 +} +\newcommand{\kopf}[1]{#1} +\newcommand{\kurz}[1]{#1} +%%%%%%%%%%%% Letter - End + +% Some fixes concerning XeTeX and the n-dash + +\XeTeXinterchartokenstate=1 +\XeTeXcharclass`\–=150 +\XeTeXinterchartoks 150 0 = {\kern0em } + + diff --git a/TeX/pre_win.tex b/TeX/pre_win.tex new file mode 100644 index 0000000..073b90c --- /dev/null +++ b/TeX/pre_win.tex @@ -0,0 +1,528 @@ +% Version: 1.1 +% 24.10.2012 +% Last modifier: Kai + +\documentclass[10pt,openright,twoside]{scrbook} + +% Grundlegende Paketes, das für die Programmierlogik hilfreich ist +\usepackage{xifthen} + +% Redefinierung der Kopfzeile +\usepackage{fancyhdr} +\pagestyle{fancy} % eigenen Seitestil aktivieren} +\fancyhfoffset{0pt} +\fancyhead[RO,LE]{\footnotesize \nouppercase\thepage} +\fancyhead[RE,LO]{\footnotesize \nouppercase\leftmark} +\renewcommand\chaptermark[1]{\markboth{\thechapter. #1}{}} +\renewcommand{\headrulewidth}{0pt} +\fancyfoot{} +\fancypagestyle{plain}{% +\fancyhead{}} + +% Mit fontspec werden die Schriftarten definiert. +\usepackage[no-math]{fontspec} +\setmainfont[Mapping=tex-text]{Times New Roman} +%\setsansfont[Mapping=tex-text]{Skia} +%\setromanfont{Geneva} + +% Unicode-Unterstützung +\usepackage{xltxtra} +\usepackage{xunicode} + +% Polyglossia ist für Silbentrennung und generell Sprachunterstützung zuständig. +\usepackage{polyglossia} +\setmainlanguage{english} +\setotherlanguage[variant=polytonic]{greek} +\setotherlanguage{german} + +% Definition der Schriftarten für die einzelnen Schriftsysteme. +% Das Paket zhspacing fügt weitere Unterstützung für Chinesisch hinzu +\newfontfamily\zhfont{DFKai-SB} +\newfontfamily\zhpunctfont{DFKai-SB} +\usepackage{zhspacing} +\zhspacing + +% assigning explicit character classes for CJK ambiguous characters +\XeTeXcharclass`“=6 +\XeTeXcharclass`”=6 +\XeTeXcharclass`‘=6 +\XeTeXcharclass`’=6 +\XeTeXcharclass`’=6 +\XeTeXcharclass`…=6 + +\newfontfamily\textchinese{DFKai-SB} +\newfontfamily\chinesefont{DFKai-SB} +\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} +\usepackage{amsfonts} +\usepackage{braket} + +% Für chemische Formeln +\usepackage[version=3]{mhchem} + +% Definition der Seitengröße +\usepackage[paperwidth=148mm,paperheight=210mm,inner=20mm,outer=15mm,top=13mm,bottom=15mm,includehead]{geometry} +\usepackage{pdflscape} + +% Schusterjungen und Hurenkinder +\clubpenalty = 10000 +\widowpenalty = 10000 +\displaywidowpenalty = 10000 + +% Mit raggedbottom wird verhindert, dass Seiten nach unten hin aufgefüllt werden, das Paket here ermöglicht die fixe Positionierung von Bildern +\usepackage{here} +\raggedbottom + +% Gestaltung von Auflistungen im Text +\usepackage{paralist} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% One Command to tweak the style of the bibliography +\newcommand{\EOAbibtweaks}{ +% Remove pp from references +\DeclareFieldFormat{postnote}{##1} +% Remove quotation marks from certain titles +\DeclareFieldFormat[thesis]{title}{\mkbibemph{##1}} +\DeclareFieldFormat[article]{title}{##1} +\DeclareFieldFormat[incollection]{title}{##1} +\DeclareFieldFormat[inproceedings]{title}{##1} +\DeclareFieldFormat[inbook]{title}{\mkbibemph{##1}} +\DeclareFieldFormat{title}{\mkbibemph{##1}} +% Remove pp from bibliography at all +\DeclareFieldFormat{pages}{##1}% +% Remove "In:" from articles +\renewbibmacro{in:}{% + \ifentrytype{article}{}{% + \printtext{\bibstring{in}\intitlepunct}}} +% Delete Vol. as praefix +\DeclareFieldFormat*{volume}{##1} +% Use : for pages of an article, use . for the rest +\renewcommand*{\bibpagespunct}{% +\ifentrytype{article}% +{% +\iffieldundef{Number}% +{\addcolon\hspace{0pt}}% +{}% +}% +{.\space}% +} +% Group Volume and Issue in {Brackets} +\renewbibmacro*{journal+issuetitle}{% + \usebibmacro{journal}% + \setunit*{\addspace}% + \iffieldundef{series} + {} + {\newunit + \printfield{series}% + \setunit{\addspace}}% + \printfield{volume}% + \iffieldundef{number} + {} + {\mkbibparens{\printfield{number}}}% + \setunit{\addcomma\space}% + \printfield{eid}% + \setunit{\addspace}% + \usebibmacro{issue+date}% + \setunit{\addcolon\space}% + \usebibmacro{issue}% + \newunit} +% Bug fix for Windows +\defbibheading{none}[]{} +} + +% Einbindung des biblatex-Pakets mittels \EOAbibliographytype +\newcommand{\EOAbibliographytype}[1]{% +\ifthenelse% +{\equal{#1}{anthology}}% +{\usepackage[mincitenames=1,maxcitenames=3,maxbibnames=100,style=authoryear,backend=biber,babel=hyphen]{biblatex} +\newboolean{anthology} +\setboolean{anthology}{true} +\EOAbibtweaks +}{}% +\ifthenelse% +{\equal{#1}{anthology-numeric}}% +{\usepackage[mincitenames=1,maxcitenames=3,maxbibnames=100,style=numeric-comp,sorting=none,backend=biber,babel=hyphen]{biblatex} +\newboolean{anthology} +\setboolean{anthology}{true} +\EOAbibtweaks +}{}% +\ifthenelse% +{\equal{#1}{monograph}}% +{\usepackage[mincitenames=1,maxcitenames=3,maxbibnames=100,style=authoryear,backend=biber,babel=hyphen]{biblatex} +\newboolean{anthology} +\setboolean{anthology}{false} +\EOAbibtweaks +}{}% +\ifthenelse% +{\equal{#1}{monograph-numeric}}% +{\usepackage[mincitenames=1,maxcitenames=3,maxbibnames=100,style=numeric-comp,sorting=none,backend=biber,babel=hyphen]{biblatex} +\newboolean{anthology} +\setboolean{anthology}{false} +\EOAbibtweaks +}{}% +}% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------------- formatierung der Fussnoten Anfang --------- +\usepackage[flushmargin]{footmisc} +\setlength{\footnotemargin}{2.4mm} +% ------------------- formatierung der Fussnoten Ende --------- + +% cpation dient zur Realisierung der Bildunterschriften +\usepackage{caption} +% footnote-package needed to typeset footnotes in captions +% problem was that both footnotes and captions are fragile +\usepackage{footnote} +% Für die Einbindung von Grafiken +\usepackage{graphicx} +% Mit float wird die Option H bei der Posotionierung von Graifken ermöglicht +\usepackage{float} + +% Für die Formatierung von URLs im Fließtext, escapen ist damit nicht mehr notwendig +\usepackage{url} +\urlstyle{rm} + +% Stichwortverzeichnis mit den Standard-TeX-Funktionen +\usepackage{imakeidx} +\makeindex[name=keywords] +\makeindex[name=persons] + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Formatierung der Überschriften Anfang +\usepackage{setspace} +\usepackage{titlesec} +\usepackage{titletoc} + +\titleformat{\part}[block] +{\rm}% +{\singlespacing\flushright\textbf{Part \thepart}\flushright}% +{0em}% +{\flushright\textbf} +\titlespacing*{\part} {0pt}{-30pt}{0pt} + +\titleformat{\chapter}[display] +{\rm\large} +{\singlespacing\textbf{Chapter \thechapter\quad}}% +{0em}% +{\textbf} +\titlespacing*{\chapter} {0pt}{-30pt}{80pt} + +\titleformat{\section}[hang] +{\rm} +{\bfseries\thesection\quad}% +{0em}% +{\textbf} + +\titleformat{\subsection}[hang] +{\rm} +{\textbf\thesubsection\quad}% +{0em}% +{\textbf} + +\titleformat{\subsubsection}[hang] +{\rm} +{\textbf\thesubsection\quad}% +{0em}% +{\textbf} + +% Formatierung der Überschriften Ende +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Tiefe des Inhaltsverzeichnisses +\setcounter{tocdepth}{1} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Formatierung des Inhaltsverzeichnisses +\titlecontents{part}[0.2em]{\addvspace{1em}\bfseries}{}{}{\rm\hfill\contentspage} +\titlecontents{chapter}[3em]{\addvspace{1em}\bfseries}{\contentslabel{2.8em}}{}{\rm\dotfill\contentspage} +\titlecontents{section}[3em]{}{\contentslabel{2.8em}}{}{\dotfill\contentspage} +\makeatletter +\renewcommand\@pnumwidth{2em} +\makeatother +% Formatierung des Inhaltsverzeichnisses +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Definition einiger Makros zur Erhöhung des Bedienkomforts - Anfang + +% Makro für kursiven Text +\newcommand{\EOAemph}[1]{\emph{#1}} +% Makro für einen URL +\newcommand{\EOAurl}[1]{\protect\url{#1}} +% Makro für hochgestellten Text +\newcommand{\EOAup}[1]{\textsuperscript{#1}} +% Makro für tiefgestelten Text +\newcommand{\EOAdown}[1]{\textsubscript{#1}} +% Makro for Greek Text: \greek{} +\newcommand{\EOAgreek}[1]{{\greekfont #1}} +% Makro for chinese Text: \EOAchinese{} +\newcommand{\EOAchinese}[1]{{\chinesefont #1}} +% Makro for russian Text: \EOArussian{} +\newcommand{\EOArussian}[1]{{\russianfont #1}} +% Makro for hebrew Text: \EOAhebrew{} +\newcommand{\EOAhebrew}[1]{{\hebrewfont #1}} +% Makro for Inline-Figure: \EOAinline{File} +\newcommand{\EOAinline}[1]{\includegraphics[height=0.7em,keepaspectratio]{#1}} +% New command for Footnotes +\newcommand{\EOAfn}[1]{\protect\footnote{#1}} +% New command for ~ +\newcommand{\EOAtilde}{\textasciitilde{}} +% New command for referencing objects (i.e. figures) +\newcommand{\EOAref}[1]{\ref{#1}} +% New command for referencing pages +\newcommand{\EOApageref}[1]{\pageref{#1}} +% New command for label +\newcommand{\EOAlabel}[1]{\label{#1}} +% New command for marking index entries +\newcommand{\EOAindex}[1]{\index[keywords]{#1}} +% New command for printing index +\newcommand{\EOAprintindex}{\printindex[keywords]} +% New command for marking person index entries +\newcommand{\EOAindexperson}[1]{\index[persons]{#1}} +% New command for printing person index +\newcommand{\EOAprintpersonindex}{\printindex[persons]} + +% New command for Table of Content +\newcommand{\EOAtoc}{\tableofcontents} +% New command for ToC-Entries +\newcommand{\EOAtocentry}[1]{\addtocontents{toc}{\hspace{15pt}\rm{\bf{#1}}\par}} +% New command for parts +\newcommand{\EOApart}[1]{\part*{#1}} +% New command for parts +\newcommand{\EOAfacsimilepart}[1]{\part*{#1} +%--------------------- Formatting the facsimile part +\pagestyle{fancy} % eigenen Seitestil aktivieren} +\fancyhf{} % Alle Felder loeschen +\renewcommand{\headrulewidth}{0pt} +\fancyhead[EL,OR]{\footnotesize\thepage} +\fancypagestyle{plain}{% +\fancyhead{}} +} +% New command for numbered chapters +\newcommand{\EOAchapter}[2]{ +\chapter[#2]{#2} +\chaptermark{#1} +\ifthenelse{\boolean{anthology}}{ +\newrefsection +} +{} +} +% New command for not numbered chapters +\newcommand{\EOAchapternonumber}[2]{ +\setcounter{secnumdepth}{-1} +\chapter[#2]{#2} +\markboth{#1}{} +\ifthenelse{\boolean{anthology}}{ +\newrefsection +} +{} +\setcounter{secnumdepth}{2} +} +% New command for Author in Headline +\newcommand{\EOAauthor}[1]{\\ {\rm{\it #1}}} +% New command for sections +\newcommand{\EOAsection}[1]{\section{#1}} +% New command for subsections +\newcommand{\EOAsubsection}[1]{\subsection{#1}} +% New command for not numbered sections +\newcommand{\EOAsectionnonumber}[1]{\setcounter{secnumdepth}{-1}\section{#1}\setcounter{secnumdepth}{2}} +% New command for not numbered subsections +\newcommand{\EOAsubsectionnonumber}[1]{\setcounter{secnumdepth}{-1}\subsection{#1}\setcounter{secnumdepth}{2}} +%New command for subsubsection +\newcommand{\EOAsubsubsection}[1]{\subsubsection*{#1}} + +% New command for an empty page +\newcommand{\EOAemptypage}{\clearpage% +\thispagestyle{empty}% +     %-------------------------- using invisible characters +\newpage% +} +% New command for a pagebreak +\newcommand{\EOAnewpage}{ +\ifthenelse% +{\strcmp{\@currenvir}{EOAtranscripted}=1}% +{\newpage\EOAtranscriptedheader} +{\clearpage} +} +% New Environment for bilungual doublesided transcription +\newenvironment{EOAtranscripted}[2]{ +\renewcommand{\EOAtranscriptedheader}{\noindent\makebox[\textwidth][c]{\footnotesize\MakeUppercase{#2}}\vspace*{0.5cm}\\} +\makeatletter +\clearpage\if@twoside + \ifodd\c@page \hbox{}\newpage\if@twocolumn\hbox{}% + \newpage\fi\fi\fi +\makeatother +\noindent\makebox[\textwidth][c]{\footnotesize\MakeUppercase{#1}}\vspace*{0.5cm}\\ +}{\clearpage} +% Here definded pro forma in conjunction with EOAtranscripted +\newcommand{\EOAtranscriptedheader}{} +% Environment for quoting +\newenvironment{EOAquote}{\begin{quote}}{\end{quote}} +% Environment for Lists +\newenvironment{EOAlist}{\medskip\begin{compactenum}}{\end{compactenum}\medskip} +% Environment for undordered list +\newenvironment{EOAitems}{\medskip\begin{compactitem}}{\end{compactitem}\medskip} +% New command for short equation +\newcommand{\EOAineq}[1]{$#1$} +% Environment for Equations +% Multilines may be used with \begin{split} and \\ to mark a linebreak +\newenvironment{EOAequation}[1]{\begin{equation} +\label{#1} +}{\end{equation}} +% Environment for Subequations +\newenvironment{EOAsubequations}[1]{\begin{subequations} +\label{#1} +}{\end{subequations}} +% Environment for unnumbered Equation +\newenvironment{EOAequationnonumber}{\begin{equation*}}{\end{equation*}} +% Environment for numbered Equation array +\newenvironment{EOAequationarray}[1]{\begin{eqnarray} +\label{#1} +}{\end{eqnarray}} +% Environment for not numbered Equation array +\newenvironment{EOAequationarraynonumber}[1]{\begin{eqnarray*}\label{#1}}{\end{eqnarray*}} +% Makro for Figure: \EOAfigure{File}{Caption}{Label}{Width}{Position} +\newcommand{\EOAfigure}[5]{ +% Redefinition and \makesavenoteenv necessary to enable footnotes in captions +\makesavenoteenv[figure*]{figure} +\begin{figure*}[#5] +\begin{center} +\includegraphics[width=0.#4\textwidth]{#1} +\caption{#2} +\label{#3} +\end{center} +\end{figure*} +} +% Makro for non numbered Figure: \EOAfigurenonumber{File}{Width}{Position} +\newcommand{\EOAfigurenonumber}[3]{ +% Redefinition and \makesavenoteenv necessary to enable footnotes in captions +\makesavenoteenv[figure*]{figure} +\begin{figure*}[#3] +\begin{center} +\includegraphics[width=0.#2\textwidth]{#1} +\end{center} +\end{figure*} +} +% Makro for Landscape-Figure: \EOAfigure{File}{Caption}{Label} +\newcommand{\EOAlsfigure}[3]{ +\begin{landscape} +\begin{figure}[p] +\begin{center} +\includegraphics[width=1.35\textwidth]{#1} +\caption{#2} +\label{#3} +\end{center} +\end{figure} +\end{landscape} +} +% Makro for Facimile: \EOAfacsimile{File}{Label} +\newcommand{\EOAfacsimile}[2]{ +\begin{figure}[H] \begin{center} \label{#2} \includegraphics[width=1.0\textwidth]{#1} \end{center} \end{figure} +} +% Command for bibliographies as sections within a chapter +\newcommand{\EOAprintbibliography}{\printbibliography[heading=none]} +% Command for .bib-Database +\newcommand{\EOAbibliographydatabase}[1]{ +\bibliography{#1} +} +% Command for quotation Name Year, Page +\newcommand{\EOAciteauthoryear}[2][seitenangabe]{% +\ifthenelse% +{\equal{#1}{seitenangabe}}% +{\cite{#2}}% +{\cite[#1]{#2}}% +} +% Command for quotation Year, Page +\newcommand{\EOAciteyear}[2][seitenangabe]{% +\ifthenelse% +{\equal{#1}{seitenangabe}}% +{\cite*{#2}}% +{\cite*[#1]{#2}}% +} +% Command for manual quotation +\newcommand{\EOAcitemanual}[2][kuerzel]{% +\ifthenelse% +{\equal{#1}{kuerzel}}% +{\notecite{#2}}% +{\notecite[#1]{#2}}% +} +% Command for manual quotation +\newcommand{\EOAcitenumeric}[2][seitenangabe]{% +\ifthenelse% +{\equal{#1}{seitenangabe}}% +{\cites{#2}}% +{\cites[#1]{#2}}% +} +% Definition einiger Makros zur Erhöhung des Bedienkomforts - Ende +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%% Tables - Beginning + +\usepackage[table]{xcolor} +\usepackage{tabularx} +\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} % linksbündig mit Breitenangabe +\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % zentriert mit Breitenangabe +\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % rechtsbündig mit Breitenangabe + +\newcommand{\EOAtablehead}[1]{\rowcolor{black!10} +#1\\ +\hline\hline +} +\newenvironment{EOAtable}[4]% +{ +\rowcolors{1}{black!3}{black!7} +\ifthenelse% +{\strcmp{#2}{nonumber}=0}% +{ +% if the caption is equal to 'no number', then omit caption and label +} +{ +% if the caption is not equal to 'no number', then use caption and label +\renewcommand{\tmpEOAtablecaption}{\caption{#2}} +\renewcommand{\tmpEOAtablelable}{\label{#3}} +} +\begin{table}[#4] +\begin{center} +\begin{tabular}{|#1|} +\hline +} +{ +\hline +\end{tabular} +\end{center} +\tmpEOAtablecaption +\tmpEOAtablelable +\renewcommand{\tmpEOAtablecaption}{} +\renewcommand{\tmpEOAtablelable}{} +\end{table} +} +% Definition of temporary commands to enable the caption and the label in the ending part of the EOAtable-environment +\newcommand{\tmpEOAtablecaption}{} +\newcommand{\tmpEOAtablelable}{} + +%%%%%%%%%%%% Tables - End + +%%%%%%%%%%%% Letter - Beginning (Work in Progress) +\newcommand{\EOAletterhead}[4]{% +\definecolor{grau}{rgb}{0.9,0.9,0.9} +\definecolor{schwarz}{rgb}{0,0,0} +\fcolorbox{schwarz}{grau}{#1} +%\framebox[\textwidth][l]{TEST} +#1\\ #2 \\ #3 \\ #4 +} +\newcommand{\kopf}[1]{#1} +\newcommand{\kurz}[1]{#1} +%%%%%%%%%%%% Letter - End + + +% Übergangsweise für verschiedene Tests +\newcommand{\citet}[2][]{\cite[#2]{#1}} +\renewcommand{\citet}[2][]{\cite[#2]{#1}} +\newcommand{\citeyearpar}[1]{\cite{#1}} diff --git a/TeX/pre_xml Kopie.tex b/TeX/pre_xml Kopie.tex new file mode 100644 index 0000000..ee2b3bf --- /dev/null +++ b/TeX/pre_xml Kopie.tex @@ -0,0 +1,266 @@ +\documentclass{book} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Die Anweisung ist notwendig für die korrekte Nummerierung der + + + + + + + + \ No newline at end of file diff --git a/Templates/epubcontainer.xml b/Templates/epubcontainer.xml new file mode 100644 index 0000000..d916805 --- /dev/null +++ b/Templates/epubcontainer.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Templates/epubcontentopf.xml b/Templates/epubcontentopf.xml new file mode 100644 index 0000000..06ddf16 --- /dev/null +++ b/Templates/epubcontentopf.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Templates/epubcover.xhtml b/Templates/epubcover.xhtml new file mode 100644 index 0000000..cf82ebf --- /dev/null +++ b/Templates/epubcover.xhtml @@ -0,0 +1,20 @@ + + + + + Cover + + + + + + + + + + diff --git a/Templates/epubintro.xhtml b/Templates/epubintro.xhtml new file mode 100644 index 0000000..8406925 --- /dev/null +++ b/Templates/epubintro.xhtml @@ -0,0 +1,32 @@ + + + + + TITLE + + +

author

+

TITLE

+ +

Series Editors
+Jürgen Renn, Dagmar Schäfer, Robert Schlögl, Bernard F. Schutz.

+ +

Edition Open Access Development Team
+Lindy Divarci, Nina Ruge, Matthias Schemmel, and Kai Surendorf.

+ +

Scientific Board
Markus Antonietti, Ian Baldwin, Antonio Becchi, Fabio Bevilacqua, William G. Boltz, Jens Braarvik, Horst Bredekamp, Jed Z. Buchwald, Olivier Darrigol, Thomas Duve, Mike Edmunds, Yehuda Elkana†, +Fynn Ole Engler, Robert K. Englund, Mordechai Feingold, Rivka Feldhay, Gideon Freudenthal, Paolo Galluzzi, Kostas Gavroglu,Mark Geller, Domenico Giulini, Günther Görz, Gerd Graßhoff, James Hough, Manfred Laubichler, Glenn Most, Klaus Müllen, Pier Daniele Napolitani, Alessandro Nova, Hermann Parzinger, Dan Potts, Sabine Schmidtke, Circe Silva da Silva, Ana Simões, Dieter Stein, Richard Stephenson, Mark Stitt, Noel M. Swerdlow, Liba Taub, Martin Vingron, Scott Walter, Norton Wise, Gerhard Wolf, Rüdiger Wolfrum, Gereon Wolters, Zhang Baichun.

+ +

First published year
+Edition Open Access
+http://www.edition-open-access.de
+Published under Creative Commons by-nc-sa 3.0 Germany Licence
+http://creativecommons.org/licenses/by-nc-sa/3.0/de/
+The Deutsche Nationalbibliothek lists this publication in the Deutsche Nationalbibliografie; detailed bibliographic data are available on the Internet at http://dnb.d-nb.de.

+ +AdditionalInformation + +

Max Planck Research Library for the History and Development of Knowledge
+series number

+ + \ No newline at end of file diff --git a/Templates/epubmimetype b/Templates/epubmimetype new file mode 100644 index 0000000..57ef03f --- /dev/null +++ b/Templates/epubmimetype @@ -0,0 +1 @@ +application/epub+zip \ No newline at end of file diff --git a/Templates/epubtocncx.xml b/Templates/epubtocncx.xml new file mode 100644 index 0000000..882e3ff --- /dev/null +++ b/Templates/epubtocncx.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + +Frontmatter + + + + + \ No newline at end of file diff --git a/Templates/publication.cfg b/Templates/publication.cfg new file mode 100644 index 0000000..b1f6726 --- /dev/null +++ b/Templates/publication.cfg @@ -0,0 +1,36 @@ +[Technical] +Serie: Essays +Number: 2 +Title: Just a Test Publication +Subtitle: Showing nearly all possible Elements +PublicationDate: 2013-02-13 +PublicationYear: 2013 +ISBN: 978-3-8442-4282-9 +Price: +Shoplink: +Language: en +License: by-nc-sa + +[General] +BriefDescription: This is a brief description of this sample publication. +DetailedDescription: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +Keyword1: Chemistry +Keyword2: +Keyword3: +Keyword4: +Keyword5: +Keyword6: +Submitter: Some One +EditorialCoordination: Captain Nemo +Copyediting: Some One Else +Dedication: +AdditionalInformation: +Translator: + +[Authors] +Author1: John Doe +Author2: +Author3: +Author4: +Author5: +Zusatz: (eds) \ No newline at end of file diff --git a/tralics/tralics.tcf b/tralics/tralics.tcf new file mode 100644 index 0000000..7485338 --- /dev/null +++ b/tralics/tralics.tcf @@ -0,0 +1,21 @@ +## This is an example of a configuration file for tralics +## Copyright 2006 Inria/apics, Jose' Grimm +## $Id: hello.tcf,v 1.1 2006/07/17 09:09:06 grimm Exp $ +## tralics ident rc=hello.tcf $Revision: 1.1 $ + + +xml_footnote_name = "note" +att_place = "place" +att_foot_position = "Inline" +no_footnote_hack="true" + +DocType = Book classes.dtd +DocAttrib =Foo \World +DocAttrib =A \specialyear +DocAttrib =B \tralics +DocAttrib =C \today +xml_theorem_name = "theorem" +BeginCommands + \def\World{world} + \def\today{\the\year/\the\month/\the\day} +End \ No newline at end of file diff --git a/tralics/tralics.tcf Kopie b/tralics/tralics.tcf Kopie new file mode 100644 index 0000000..a055554 --- /dev/null +++ b/tralics/tralics.tcf Kopie @@ -0,0 +1,23 @@ +# This is a configuration file for tralics. +# $xId: tralics_rc,v 2.24 2006/07/24 08:23:17 grimm Exp $ +## tralics ident rc=standard $xRevision: 2.24 $ + +# Copyright Inria. Jos\'e Grimm. Apics. 2004/2005 2006 +# This file is part of Tralics. + +% Some comments: comments start with % or # + +% this means: take the documentclass value as type name +Type = \documentclass + +## First type defined is the default. Since version 2.8, there is only +## one type. + +BeginType std# standard latex classes + DocType = std classes.dtd +End + +BeginAlias + torture torture1 torture2 + std report book article minimal +End diff --git a/tralics/tralics_conf/amsbsy.plt b/tralics/tralics_conf/amsbsy.plt new file mode 100644 index 0000000..34daefb --- /dev/null +++ b/tralics/tralics_conf/amsbsy.plt @@ -0,0 +1,8 @@ +% -*- latex -*- +\ProvidesPackage{amsbsy}[2007/03/24 v1.0 Bold symbol for Tralics] +\RequirePackage{amsgen} +\DeclareRobustCommand{\boldsymbol}[1]{#1} +\DeclareRobustCommand{\pmb}[1]{#1} +\endinput + + diff --git a/tralics/tralics_conf/amscd.plt b/tralics/tralics_conf/amscd.plt new file mode 100644 index 0000000..7ed65bb --- /dev/null +++ b/tralics/tralics_conf/amscd.plt @@ -0,0 +1,61 @@ +% -*- latex -*- +\ProvidesPackage{amscd}[2007/03/24 v1.0 Commutative Diagrams] +\RequirePackage{amsgen} + +%\atdef@ A#1{x} define a command \b@A, where b is a space character +\def\atdef@#1{\expandafter\def\csname\space @\string#1\endcsname} +\def\at@use#1{\csname\space @\string#1\endcsname}% + +%% @))) is the same as @>>> +\begingroup \catcode`\~=\active \lccode`\~=`\@ +\lowercase{% + \global\atdef@)#1)#2){~>#1>#2>} + \global\atdef@(#1(#2({~<#1<#2<} + \gdef\CDat{\let ~=\at@use} +}% end lowercase +\endgroup + + + +%% True in CD environment +\newif\ifCD@ + +\def\internalecdatsignvalue{\at@use} +\begingroup \catcode`\@=\active + +\endgroup + + +\newenvironment{CD}{\catcode`@=13\CDat\begin{matrix}}{\end{matrix}} + +\def\@phantom#1{\mathbox{mphantom}{\scriptstyle #1}} + +\atdef@>#1>#2>{&\xrightarrow[#2]{#1}&} +\atdef@<#1<#2<{&\xleftarrow[#2]{#1}&} + +\atdef@ A#1A#2A{\cd@arrow{#1}{#2}{\uparrow}&&} +\atdef@ V#1V#2V{\cd@arrow{#1}{#2}{\downarrow}&&} + +\def\cd@arrow@none#1{#1} +\def\cd@arrow@right#1#2{\@phantom{#1}#2{\scriptstyle#1}} +\def\cd@arrow@left#1#2{{\scriptstyle#1}#2\@phantom{#1}} +\def\cd@arrow@both#1#2#3{\@phantom{#2}{\scriptstyle#1}#3{\scriptstyle#2}\@phantom{#1}} + +\def\cd@arrow#1#2#3{ + \@ifbempty{#1}{\@ifbempty{#2}{\cd@arrow@none#3}{\cd@arrow@right{#2}#3}} + {\@ifbempty{#2}{\cd@arrow@left{#1}#3}{\cd@arrow@both{#1}{#2}#3}} +} +\atdef@|{\Big\Vert&&} +\atdef@\vert{\Big\Vert&&} +\atdef@.{&&} +\atdef@={&=&} +\endinput +%% +%% End of file `amscd.sty'. + + + + +\endinput + + diff --git a/tralics/tralics_conf/amsfonts.plt b/tralics/tralics_conf/amsfonts.plt new file mode 100644 index 0000000..5513de5 --- /dev/null +++ b/tralics/tralics_conf/amsfonts.plt @@ -0,0 +1,7 @@ +% -*- latex -*- +\ProvidesPackage{amsfonts}[2007/03/24 v1.0 Euler Script font] +\DeclareOption{psamsfonts}{} +\ProcessOptions\relax +\endinput + + diff --git a/tralics/tralics_conf/amsgen.plt b/tralics/tralics_conf/amsgen.plt new file mode 100644 index 0000000..c57c7ff --- /dev/null +++ b/tralics/tralics_conf/amsgen.plt @@ -0,0 +1,10 @@ +% -*- latex -*- +\ProvidesFile{amsgen}[2007/03/24 v1.0 Ams primitives for Tralics] + +\let\@xp=\expandafter +\let\@nx=\noexpand +\long\def\@ifnotempty#1{\@ifbempty{#1}{}} +\def\DN@{\def\next@} +\def\FN@{\futurelet\@let@token} +\endinput + diff --git a/tralics/tralics_conf/amsmath.plt b/tralics/tralics_conf/amsmath.plt new file mode 100644 index 0000000..bf2dcad --- /dev/null +++ b/tralics/tralics_conf/amsmath.plt @@ -0,0 +1,296 @@ +% -*- latex -*- +% $Id: amsmath.plt,v 2.31 2011/05/02 08:52:34 grimm Exp $ +\ProvidesPackage{amsmath}[2011/04/11 v1.5 AMS math features for Tralics] + + +\DeclareOption{leqno}{\XMLaddatt[1]{equation-number}{left}} +\DeclareOption{reqno}{\XMLaddatt[1]{equation-number}{right}} +\DeclareOption{fleqn}{\XMLaddatt[1]{flushed-equation}{true}} + +\DeclareOption{intlimits}{\let\ilimits@\displaylimits} +\DeclareOption{nointlimits}{\let\ilimits@\nolimits} + +\DeclareOption{sumlimits}{\let\slimits@\displaylimits} +\DeclareOption{nosumlimits}{\let\slimits@\nolimits} +\DeclareOption{namelimits}{\PassOptionsToPackage{namelimits}{amsopn}} +\DeclareOption{nonamelimits}{\PassOptionsToPackage{nonamelimits}{amsopn}} +\newif\ifctagsplit@ +\DeclareOption{centertags}{\ctagsplit@true} +\DeclareOption{tbtags}{\ctagsplit@false} +\DeclareOption{cmex10}{} +\DeclareOption{?}{} +\ExecuteOptions{nointlimits,sumlimits,namelimits,centertags} +\ProcessOptions\par + + +\def\choose{\atopwithdelims()} +\def\brack{\atopwithdelims[]} +\def\brace{\atopwithdelims\{\}} +\def\shoveleft{\multicolumn{1}{l}} +\def\shoveright{\multicolumn{1}{r}} +\def\intertext#1{\multicolumn{2}{l}{\mbox{#1}}\\} +\def\mathpalette#1#2{\mathchoice {#1\displaystyle {#2}}% +{#1\textstyle {#2}}{#1\scriptstyle{#2}}{#1\scriptscriptstyle{#2}}} + + +\ifctagsplit@\else \XMLaddatt[1]{split-tags}{tb} \fi + +% \RequirePackage{amstext}[2007/01/01] % not needed +\RequirePackage{amsbsy}[2007/01/01] +\RequirePackage{amsopn}[2007/01/01] +\providecommand{\AmS}{AMS} +\def\Hat{\hat} +\def\Check{\check} +\def\Tilde{\tilde} +\def\Acute{\acute} +\def\Grave{\grave} +\def\Dot{\dot} +\def\Ddot{\ddot} +\def\Breve{\breve} +\def\Bar{\bar} +\def\Vec{\vec} + +\def\UnimplementedOperator#1{\UnimplementedOperatorAux} +\def\ams@unimp#1{\def#1{\UnimplementedOperator #1}} +%\def\ams@unimp{\mathbox{mstyle}[color][red]{X}} + +\def\Bbbk{\mathbb{k}} + +\newlength\mathindent +\newskip\multlinegap +\ifx\c@equation\undefined \newcounter{equation}\fi + +\newcount\c@MaxMatrixCols \c@MaxMatrixCols=10 % + +\def\DeclareMathAlphabet#1#2#3#4#5{\a@define#1} +\def\DeclareMathSymbol#1#2#3#4{\a@define#1} +\def\a@define#1{\ifdefined#1 \else\let#1\relax\fi} + +\newcommand\hdotsfor[2][]{% + \ifcase #2 \or\dots\or\dots&\dots + \or\dots&\dots&\dots\or\dots&\dots&\dots&\dots + \or\dots&\dots&\dots&\dots&\dots\or\dots&\dots&\dots&\dots&\dots&\dots + \or\dots&\dots&\dots&\dots&\dots\or\dots&\dots&\dots&\dots&\dots&\dots + \or\dots&\dots&\dots&\dots&\dots&\dots&\dots\or\dots&\dots&\dots&\dots&\dots&\dots&\dots&\dots\fi +} + + +%% Objects that are not yet defined but described in the Book + + +% Verbatim copy of the AMS math code. +% \numberwithin{equation}{section} is the same as +% \@addtoreset{equation}{section} +% \def\theequation{\thesection.\arabic{equation}} +\providecommand{\numberwithin}[3][\arabic]{% + \@ifundefined{c@#2}{\@nocounterr{#2}}{% + \@ifundefined{c@#3}{\@nocnterr{#3}}{% + \@addtoreset{#2}{#3}% + \@xp\xdef\csname the#2\endcsname{% + \@xp\@nx\csname the#3\endcsname .\@nx#1{#2}}}}% +} + +% Command used by T. Bouche +% \equalenv{foo}{bar} is \let\foo\bar\let\endfoo\endbar +\providecommand\equalenv[2]{% + \@ifundefined{#1}{\@xp\let\csname #1\@xp\endcsname\csname#2\endcsname + \@xp\let\csname end#1\@xp\endcsname\csname end#2\endcsname} + {\message{#1 already defined: I won't redefine it!^^J}}} + +\newcommand\substack[1]{\begin{array}{c}#1\end{array}} +\newenvironment{subarray}[1] +{\bgroup\scriptstyle\begin{matrix}} {\end{matrix}\egroup} +\newenvironment{smallmatrix}{\begin{matrix}}{\end{matrix}} +\def\intertext#1{\text{\let\vspace\@gobble#1}\\} +\def\intertext#1{\multicolumn{2}{l}{\text{\let\vspace\@gobble#1}}\\} +\def\displaybreak{} + +\def\qed{\ensuremath{\Box}} + + +%% Align envs +\newenvironment{align}{\begin{@align}{1}{-1}}{\end{@align}} +\newenvironment{align*}{\begin{@align*}{1}{-1}}{\end{@align*}} +\newenvironment{flalign}{\begin{@align}{2}{-1}}{\end{@align}} +\newenvironment{flalign*}{\begin{@align*}{2}{-1}}{\end{@align*}} +\newenvironment{alignat}{\begin{@align}{3}}{\end{@align}} +\newenvironment{alignat*}{\begin{@align*}{3}}{\end{@align*}} +\newenvironment{xalignat}{\begin{@align}{4}}{\end{@align}} +\newenvironment{xalignat*}{\begin{@align*}{4}}{\end{@align*}} +\newenvironment{xxalignat}{\begin{@align}{5}}{\end{@align}} +\newenvironment{xxalignat*}{\begin{@align*}{5}}{\end{@align*}} + + + +\def\minalignsep{0pt} + +\newenvironment{gathered}[1][c]{\begin{array}{c}}{\end{array}} + + +%% Tags +\newcommand{\raisetag}[1]{} % no-op + +\def\@x@tag#1{\formulaattribute{tag}{(#1)}} +\def\@y@tag#1{\formulaattribute{tag}{#1}} +%\def\x@tag#1{\qquad\mathrm{(#1)}} +%\def\y@tag#1{\qquad\mathrm{#1}} + +\let\o@xtag\@xtag\let\o@ytag\@ytag % make a copy +\let\ox@tag\x@tag\let\oy@tag\y@tag % make a copy + +\def\tagasattribute{% + \let\@xtag\o@xtag\let\@ytag\o@ytag + \let\x@tag\@x@tag \let\y@tag\@y@tag} + +\def\tagatendofformula{ + \let\@xtag\o@xtag\let\@ytag\o@ytag + \let\x@tag\ox@tag \let\y@tag\oy@tag} + +\def\tagatcurpos{% + \let\@xtag\ox@tag\let\@ytag\oy@tag +} +\tagatendofformula + + + +\def\sqrtsign{\sqrt} + +\let\leftroot \@gobble +\let\uproot \@gobble + +\let\bmdefine\def +\let\bm\mathbf +\def\boldmath{\mathversion{bold}} +\def\unboldmath{\mathversion{normal}} +\def\ibinom{\genfrac\lbrace\rbrace{0pt}{}} + +\ams@unimp\bignplus +\ams@unimp\boxbar + +% Table 8.13 +\ams@unimp\bbslash +\ams@unimp\fatbslash +\ams@unimp\fatslash +\ams@unimp\lbag +\ams@unimp\rbag +\ams@unimp\minuso +\ams@unimp\moo +\ams@unimp\nplus +\ams@unimp\Ydown +\ams@unimp\Yup +\ams@unimp\Yleft +\ams@unimp\Yright + +% table 8.15 +\ams@unimp\ovee +\ams@unimp\owedge +\ams@unimp\varovee +\ams@unimp\varowedge + +% Table 8.20 +\ams@unimp\curlyveedownarrow +\ams@unimp\curlyveeuparrow +\ams@unimp\curlywedgeuparrow +\ams@unimp\curlywedgedownarrow +\ams@unimp\nnearrow +\ams@unimp\nnwarrow +\ams@unimp\ssearrow +\ams@unimp\sswarrow + +% Table 8.22 +\ams@unimp\Arrownot +\ams@unimp\Longarrownot +\ams@unimp\Mapsfromchar +\ams@unimp\Mapstochar +\ams@unimp\arrownot +\ams@unimp\longarrownot +\ams@unimp\mapsfromchar +\ams@unimp\mapstochar +\ams@unimp\lhook +%\ams@unimp\not +\ams@unimp\rhook + +% Table 8.23 +\ams@unimp\smallfrown +\ams@unimp\smallsmile +\ams@unimp\varpropto +\ams@unimp\shortmid +\ams@unimp\nshortmid +\ams@unimp\nshortparallel +\ams@unimp\shortparallel + + +% Table 8.27 +\ams@unimp\llceil +\ams@unimp\rrceil +\ams@unimp\Lbag +\ams@unimp\Rbag +\ams@unimp\llfloor +\ams@unimp\rrfloor + +\ams@unimp\nsucceq +\ams@unimp\npreceq +\ams@unimp\Lbag +\ams@unimp\Rbag +\ams@unimp\llceil +\ams@unimp\rrceil +\ams@unimp\leftrightarroweq + +\ams@unimp\nsupseteqq +\ams@unimp\nsubseteqq +\ams@unimp\lvertneqq +\ams@unimp\gvertneqq +\ams@unimp\ntrianglelefteqslant +\ams@unimp\ntrianglerighteqslant +\ams@unimp\trianglelefteqslant +\ams@unimp\trianglerighteqslant +\ams@unimp\subsetplus +\ams@unimp\subsetpluseq +\ams@unimp\supsetplus +\ams@unimp\supsetpluseq +\ams@unimp\varsubsetneqq +\ams@unimp\varsubsetneq +\ams@unimp\varsupsetneqq +\ams@unimp\varsupsetneq +\ams@unimp\vartriangle +\ams@unimp\doublebarwedge + +\let\ngeqq\ngeq +\let\nleqq\nleq +\let\ngeqq\ngeq +\let\nleqq\nleq +\let\ngeqslant\ngeq +\let\nleqslant\nleq + +\DeclareRobustCommand{\tmspace}[3]{% + \ifmmode\mskip#1#2\else\kern#1#3\fi\relax} +\newcommand{\negmedspace}{\tmspace-\medmuskip{.2222em}} +\newcommand{\negthickspace}{\tmspace-\thickmuskip{.2222em}} + +%\def\bordermatrix#1{{% +%\let\cr\\\begin{pmatrix}\tableattribute{bordermatrix}{true}#1\end{pmatrix}}} + + +\endinput + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\def\sideset#1#2#3{\mathop\def\@tempa{#3}% + \@ifbempty{#1}{\@xsideset{#2}} + {\@ifbempty{#2}{\@ysideset{#1}}{\@zsideset{#1}{#2}}}\limits} + +\def\@xsideset#1{\@scanupdown\@xxsideset\mmlnone\mmlnone{#1}} +\def\@xxsideset#1#2{{\mathbox{mmultiscripts}{\@tempa{#1}{#2}}}} + + +\def\@ysideset#1{\@scanupdown\@yysideset\mmlnone\mmlnone{#1}} +\def\@yysideset#1#2{{\mathbox{mmultiscripts}{\@tempa\mmlprescripts{#1}{#2}}}} + +\def\@zsideset#1#2{\@scanupdown\@zzsideset\mmlnone\mmlnone{#1}{#2}} +\def\@zzsideset#1#2#3{\@scanupdown\@wsideset\mmlnone\mmlnone{#3}{#1}{#2}} +\def\@wsideset#1#2#3#4{{\mathbox{mmultiscripts} + {\@tempa{#1}{#2}\mmlprescripts{#3}{#4}}}} + + + diff --git a/tralics/tralics_conf/amsopn.plt b/tralics/tralics_conf/amsopn.plt new file mode 100644 index 0000000..4e6526e --- /dev/null +++ b/tralics/tralics_conf/amsopn.plt @@ -0,0 +1,51 @@ +% -*- latex -*- +\ProvidesPackage{amsopn}[2007/03/24 v1.0 operator names for Tralics] + +% \DeclareRobustCommand{\operatorname}{ ... } Kernel +% \DeclareRobustCommand{\qopname}{ ... } Kernel +%\newcommand{\DeclareMathOperator}{% not yet implemented + +\DeclareOption{namelimits}{\let\nmlimits@\displaylimits} +\DeclareOption{nonamelimits}{\let\nmlimits@\nolimits} +\let\nmlimits@\displaylimits + +\ExecuteOptions{} +\ProcessOptions\relax + +\endinput + +% Commands that follow ignored; +% they are now defined in the kernel + +\newcommand{\DeclareMathOperator}{% + \@ifstar{\@declmathop m}{\@declmathop o}} +\long\def\@declmathop#1#2#3{% + \@ifdefinable{#2}{% + \DeclareRobustCommand{#2}{\qopname\newmcodes@#1{#3}}}} + + +\@onlypreamble\DeclareMathOperator + +\def\operator@font{\mathgroup\symoperators} +\def\operatorfont{\operator@font} +\def\operatornamewithlimits{\operatorname*} +\def\varlim@#1#2{% + \vtop{\m@th\ialign{##\cr + \hfil$#1\operator@font lim$\hfil\cr + \noalign{\nointerlineskip\kern1.5\ex@}#2\cr + \noalign{\nointerlineskip\kern-\ex@}\cr}}% +} +\def\varinjlim{% + \mathop{\mathpalette\varlim@{\rightarrowfill@\textstyle}}\nmlimits@ +} +\def\varprojlim{% + \mathop{\mathpalette\varlim@{\leftarrowfill@\textstyle}}\nmlimits@ +} + +\def\varliminf{\mathop{\mathpalette\varliminf@{}}\nmlimits@} +\def\varliminf@#1{\@@underline{\vrule\@depth.2\ex@\@width\z@ + \hbox{$#1\m@th\operator@font lim$}}} +\def\varlimsup{\mathop{\mathpalette\varlimsup@{}}\nmlimits@} +\def\varlimsup@#1{\@@overline{\hbox{$#1\m@th\operator@font lim$}}} + + diff --git a/tralics/tralics_conf/amssymb.plt b/tralics/tralics_conf/amssymb.plt new file mode 100644 index 0000000..7eb8bbd --- /dev/null +++ b/tralics/tralics_conf/amssymb.plt @@ -0,0 +1,9 @@ +% -*- latex -*- +\ProvidesPackage{amssymb}[2007/03/24 v1.0 Euler Fraktur font] +\DeclareOption{psamsfonts}{\PassOptionsToPackage{psamsfonts}{amsfonts}} +\ProcessOptions\relax +\RequirePackage{amsfonts}[2007/01/01] + +\endinput + + diff --git a/tralics/tralics_conf/amstext.plt b/tralics/tralics_conf/amstext.plt new file mode 100644 index 0000000..155c832 --- /dev/null +++ b/tralics/tralics_conf/amstext.plt @@ -0,0 +1,7 @@ +% -*- latex -*- +\ProvidesPackage{amstext}[2007/03/24 v1.0 Bold symbol for Tralics] +%\def\text ... % defined in the kernel +%\def\mathhexbox#1#2#3{\text{$\m@th\mathchar"#1#2#3$}} +\endinput + + diff --git a/tralics/tralics_conf/amsthm.plt b/tralics/tralics_conf/amsthm.plt new file mode 100644 index 0000000..4ac65df --- /dev/null +++ b/tralics/tralics_conf/amsthm.plt @@ -0,0 +1,5 @@ +% -*- latex -*- +\ProvidesPackage{amsthm}[2007/03/24 v1.0 Theorem] +\endinput + + diff --git a/tralics/tralics_conf/amsxtra.plt b/tralics/tralics_conf/amsxtra.plt new file mode 100644 index 0000000..0bf5108 --- /dev/null +++ b/tralics/tralics_conf/amsxtra.plt @@ -0,0 +1,25 @@ +% -*- latex -*- +\ProvidesPackage{amsxtra}[2007/03/24 v1.0 Extra commands for ams] + +\def\sphat{\hat{}} +\def\spcheck{^\vee} +\def\sptilde{^\sim} +\def\spdot{^{.}} +\def\spddot{^{..}} +\def\spdddot{^{...}} +\def\spbreve{^{^^^^02d8}} +\def\spbreve{\breve{}} + + +\def\accentedsymbol#1#2{% + \errmessage{Accentedsymbol not implemented} +} + +\endinput +%% +%% End of file `amsxtra.sty'. + + +\endinput + + diff --git a/tralics/tralics_conf/cgloss4e.plt b/tralics/tralics_conf/cgloss4e.plt new file mode 100644 index 0000000..2a76a32 --- /dev/null +++ b/tralics/tralics_conf/cgloss4e.plt @@ -0,0 +1,28 @@ +% -*- latex -*- +\ProvidesPackage{cgloss4e}[2006/08/24 v1.0 cgloss4e for Tralics] +%% TRALICS, copyright (C) INRIA/apics (Jose' Grimm) 2006, 2007 +%% Licensed under the CeCILL free software license +%% (See the file COPYING in the main directory for details) +%% $Id: cgloss4e.plt,v 2.3 2007/05/22 09:46:32 grimm Exp $ + + + +%% No options + +%% These commands allow single spacing in \gll or \glll +%% even when the current style says doublespacing +\def\singlegloss{} +\def\nosinglegloss{} + +%% These commands are written in C++, allow use simple name +\let\gll\cgloss@gll +\let\glll\cgloss@glll + + +% omit the \vskip +\def\glt{\par\noindent} +\let\trans\glt +\def\glend{} % obsolete +\providecommand\eachwordone{\rm} +\providecommand\eachwordtwo{\rm} +\providecommand\eachwordthree{\rm} diff --git a/tralics/tralics_conf/etex.plt b/tralics/tralics_conf/etex.plt new file mode 100644 index 0000000..982e379 --- /dev/null +++ b/tralics/tralics_conf/etex.plt @@ -0,0 +1,215 @@ +%%% -*- latex -*- +\ProvidesPackage{etex}[2007/12/22 v1.1 eTeX basic definition package ] + + +%% $Id: etex.plt,v 2.2 2008/01/09 17:13:48 grimm Exp $ +%% TRALICS, copyright (C) INRIA/apics (Jose' Grimm) 2007 +%% Licensed under the CeCILL free software license +%% (See the file COPYING in the main directory for details) + +%% Start of comments from the original style file + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% A basic interface to some etex primitives, closely modeled on +%% etex.src and etexdefs.lib provided by the core etex team. + +%% The etex.src `module' system is not copied here, the standard +%% LaTeX package option mechanism is used instead, +%% however the package options match the module names. +%% (Currently grouptypes, interactionmodes, nodetypes, iftypes.) +%% The individual type names are different too: We use, e.g., +%% +%% `\bottomleveltype' and `\simplegrouptype' instead of +%% `\grouptypes{bottomlevel}' and `\grouptypes{simple}'. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Other Comments... + +%% The names of the `interactionmodes' are not too good. +%% In particular \scroll and \batch are likely to clash with existing +%% uses. These names have been changed into \batchinteractionmode, +%% \scrollinteractionmode etc. +%% Similarly, the names of the `groupetypes' have been changed, in +%% particular \mathgroup would conflict with the LaTeX kernel. + +%% \etex logo could have the same trick as \LaTeXe to pick up a bold +%% epsilon when needed. (Not done here, I hate wasting tokens on logos.) +%% This version does have a \m@th not in the original. + +%% The \globcountvector, \loccountvector, etc. allocation macros are +%% not (yet) implemented. + +%% Currently if run on a standard TeX, the package generates an error. +%% Perhaps it should instead load some code to try to fake +%% the new etex primitives in that case??? +%% Likewise, the package generates an error when used with e-TeX V 1 + +%% The etex.src language mechanism is not copied here. That facility +%% does not use any of the etex features. LaTeX should be customised +%% using the same hyphen.cfg mechanism as for a format built with a +%% standard TeX. + +%% David Carlisle + +%% Upgraded for e-TeX V 2.0 +%% Peter Breitenlohner + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% end of comments from the original syle file + +\DeclareOption{grouptypes}{\catcode`\G=9} +\DeclareOption{interactionmodes}{\catcode`\I=9} +\DeclareOption{nodetypes}{\catcode`\N=9} +\DeclareOption{iftypes}{\catcode`\C=9} +\DeclareOption{localalloclog}{} +\DeclareOption{localallocnolog}{} +\DeclareOption{localallocshow}{} +\newif\if@noalloc +\DeclareOption{noalloc}{\@noalloctrue} + +\def\eTeX{$\varepsilon$-\TeX} + +% \def\tracingall{} no need to redefine in Tralics +%\let\loggingall\tracingall % In the kernel now + +%% This clears only values used by Tralics +\def\tracingnone{% + \tracingmacros\z@ + \tracingoutput\z@ + \tracingcommands\z@ + \tracingrestores\z@ + \tracingassigns\z@ + \tracingmath\z@} + + +\catcode`\G=14 +\catcode`\I=14 +\catcode`\N=14 +\catcode`\C=14 + +\ProcessOptions + +%% Declare names for `grouptypes' + +G \chardef \bottomleveltype = 0 % for the outside world +G \chardef \simplegrouptype = 1 % for local structure only +G \chardef \hboxgrouptype = 2 % for `\hbox{}' +G \chardef \adjustedhboxgrouptype = 3 % for `\hbox{}' in vertical mode +G \chardef \vboxgrouptype = 4 % for `\vbox{}' +G \chardef \vtopgrouptype = 5 % for `\vtop{}' +G \chardef \aligngrouptype = 6 % for `\halign{}', `\valign{}' +G \chardef \noaligngrouptype = 7 % for `\noalign{}' +G \chardef \outputgrouptype = 8 % for output routine +G \chardef \mathgrouptype = 9 % for, e.g, `^{}' +G \chardef \discgrouptype = 10 % for `\discretionary{}{}{}' +G \chardef \insertgrouptype = 11 % for `\insert{}', `\vadjust{}' +G \chardef \vcentergrouptype = 12 % for `\vcenter{}' +G \chardef \mathchoicegrouptype = 13 % for `\mathchoice{}{}{}{}' +G \chardef \semisimplegrouptype = 14 % for `\begingroup...\endgroup' +G \chardef \mathshiftgrouptype = 15 % for `$...$' +G \chardef \mathleftgrouptype = 16 % for `\left...\right' + +%% Declare names for `interactionmodes' + +I \chardef \batchinteractionmode = 0 % omits all stops and omits terminal output +I \chardef \nonstopinteractionmode = 1 % omits all stops +I \chardef \scrollinteractionmode = 2 % omits error stops +I \chardef \errorstopinteractionmode = 3 % stops at every opportunity to interact + +%% Declare names for `nodetypes' + +N \chardef \charnode = 0 % character nodes +N \chardef \hlistnode = 1 % hlist nodes +N \chardef \vlistnode = 2 % vlist nodes +N \chardef \rulenode = 3 % rule nodes +N \chardef \insnode = 4 % insertion nodes +N \chardef \marknode = 5 % a mark node +N \chardef \adjustnode = 6 % an adjust node +N \chardef \ligaturenode = 7 % a ligature node +N \chardef \discnode = 8 % a discretionary node +N \chardef \whatsitnode = 9 % special extension nodes +N \chardef \mathnode = 10 % a math node +N \chardef \gluenode = 11 % node that points to a glue specification +N \chardef \kernnode = 12 % a kern node +N \chardef \penaltynode = 13 % a penalty node +N \chardef \unsetnode = 14 % an unset node +N \chardef \mathsnodes = 15 % nodes that occur only in maths mode + +%% Declare names for `iftypes' + +C \chardef \charif = 1 % \if +C \chardef \catif = 2 % \ifcat +C \chardef \numif = 3 % \ifnum +C \chardef \dimif = 4 % \ifdim +C \chardef \oddif = 5 % \ifodd +C \chardef \vmodeif = 6 % \ifvmode +C \chardef \hmodeif = 7 % \ifhmode +C \chardef \mmodeif = 8 % \ifmmode +C \chardef \innerif = 9 % \ifinner +C \chardef \voidif = 10 % \ifvoid +C \chardef \hboxif = 11 % \ifhbox +C \chardef \vboxif = 12 % \ifvbox +C \chardef \xif = 13 % \ifx +C \chardef \eofif = 14 % \ifeof +C \chardef \trueif = 15 % \iftrue +C \chardef \falseif = 16 % \iffalse +C \chardef \caseif = 17 % \ifcase +C \chardef \definedif = 18 % \ifdefined +C \chardef \csnameif = 19 % \ifcsname +C \chardef \fontcharif = 20 % \iffontchar + +\catcode`\G=11 +\catcode`\I=11 +\catcode`\N=11 +\catcode`\C=11 + + +\if@noalloc\endinput\fi +%% Register allocation +%% The number of registers in Tralics is 1024 and all builtin commands like +%% \newdimen will allocate from 10 to 1023 + +%% The functions below are easy to implement; but they use 20 count registers +\def\et@xglob#1#2#3#4{\error{Commands like \string\globcount\space not yet implemented}} +\def\et@xloc#1#2#3#4{\error{Commands like \string\loccount\space not yet implemented}} +\def\et@xgblk#1#2#3#4{\error{Commands like \string\globcountblk\space not yet implemented}} +\def\et@xlblk#1#2#3#4{\error{Commands like \string\loccountblk\space not yet implemented}} + +% \def \et@xglob #1#2#3#4% , , , +% \def \et@xloc #1#2#3#4% , , , + +\def \globcount {\et@xglob 0\count \countdef} +\def \loccount {\et@xloc 0\count \countdef} +\def \globdimen {\et@xglob 1\dimen \dimendef} +\def \locdimen {\et@xloc 1\dimen \dimendef} +\def \globskip {\et@xglob 2\skip \skipdef} +\def \locskip {\et@xloc 2\skip \skipdef} +\def \globmuskip {\et@xglob 3\muskip \muskipdef} +\def \locmuskip {\et@xloc 3\muskip \muskipdef} +\def \globbox {\et@xglob 4\box \mathchardef} +\def \locbox {\et@xloc 4\box \mathchardef} +\def \globtoks {\et@xglob 5\toks \toksdef} +\def \loctoks {\et@xloc 5\toks \toksdef} +\def \globmarks {\et@xglob 6\marks \mathchardef} +\def \locmarks {\et@xloc 6\marks \mathchardef} + +\def\globcountblk {\et@xgblk 0\count } +\def\loccountblk {\et@xlblk 0\count } +\def\globdimenblk {\et@xgblk 1\dimen } +\def\locdimenblk {\et@xlblk 1\dimen } +\def\globskipblk {\et@xgblk 2\skip } +\def\locskipblk {\et@xlblk 2\skip } +\def\globmuskipblk {\et@xgblk 3\muskip } +\def\locmuskipblk {\et@xlblk 3\muskip } +\def\globboxblk {\et@xgblk 4\box } +\def\locboxblk {\et@xlblk 4\box } +\def\globtoksblk {\et@xgblk 5\toks } +\def\loctoksblk {\et@xlblk 5\toks } +\def\globmarksblk {\et@xgblk 6\marks } +\def\locmarksblk {\et@xlblk 6\marks } + + +\endinput \ No newline at end of file diff --git a/tralics/tralics_conf/fancyvrb.plt b/tralics/tralics_conf/fancyvrb.plt new file mode 100644 index 0000000..9638faa --- /dev/null +++ b/tralics/tralics_conf/fancyvrb.plt @@ -0,0 +1,31 @@ +%% -*- latex -*- +\ProvidesPackage{fancyvrb}[2006/08/26 v1.0 fancyverb for tralics] +%% TRALICS, copyright (C) INRIA/apics (Jose' Grimm) 2006, 2007 +%% Licensed under the CeCILL free software license +%% (See the file COPYING in the main directory for details) +%% $Id: fancyvrb.plt,v 2.5 2007/12/12 17:13:26 grimm Exp $ + +\def\DefineVerbatimEnvironment#1#2#3{% +\expandafter \def\csname#1@hook\endcsname{#3}% +\expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname +\expandafter\let\csname end#1\expandafter\endcsname\csname end#2\endcsname} + +\ifx\define@key\undefined %% provided by the keyval package, builtin in V11.1 +\def\define@key#1#2{% + \@ifnextchar[{\KV@def{#1}{#2}}{\@namedef{KV@#1@#2}##1}} +\def\KV@def#1#2[#3]{% + \@namedef{KV@#1@#2@default\expandafter}\expandafter + {\csname KV@#1@#2\endcsname{#3}}% + \@namedef{KV@#1@#2}##1} +\fi + +\def\FV@pre@pre{\begin{xmlelement*}{pre}} +\def\FV@post@pre{\end{xmlelement*}} +\def\FV@pre@verbatim{\begin{xmlelement*}{verbatim}} +\def\FV@post@verbatim{\end{xmlelement*}} +\def\FV@style@log{\XMLaddatt{class}{log-code}} +\def\FV@style@xml{\XMLaddatt{class}{xml-code}} +\def\FV@style@latex{\XMLaddatt{class}{latex-code}} + +\newlength \topsep + diff --git a/tralics/tralics_conf/html.plt b/tralics/tralics_conf/html.plt new file mode 100644 index 0000000..cd3c3e7 --- /dev/null +++ b/tralics/tralics_conf/html.plt @@ -0,0 +1,190 @@ +%%% -*- latex -*- +\ProvidesPackage{html}[2007/12/05 v1.0 Hypertext commands for latex2html] +% based on the html.sty package v1.38 by nd, hws and rrm + +%% $Id: html.plt,v 2.3 2008/04/01 17:02:06 grimm Exp $ +%% TRALICS, copyright (C) INRIA/apics (Jose' Grimm) 2007 +%% Licensed under the CeCILL free software license +%% (See the file COPYING in the main directory for details) + + +\providecommand\latextohtml{\textup{\LaTeX2\texttt{HTML}}} + +\newcommand\html@nop[]{} +\newcommand\html@nopI[1]{} +\newcommand\html@nopII[2]{} +\newcommand\html@nopIII[3]{} +\newcommand\html@nopBI[1][]{} +\newcommand\html@nopBII[2][]{} +\newcommand\html@nopBIII[3][]{} + + +%\def\htmladdnormallinkfoot#1#2{\footnote{\href{#2}{#1}}} +%\def\htmladdnormallink#1#2{\href{#2}{#1}} + +% +\let\htmladdnormallinkfoot\@@href@foot +\let\htmladdnormallink\@@href + +\newcommand\htmladdimg[2][]{\hyperimage{#2}} +\let\externallabels\html@nopBIII +\let\externalref\html@nopBII +\newcommand\externalcite[1][]{\nocite} +\newcommand\htmladdTOClink[4][]{} + +\newcommand{\htmlrule}{\@ifstar\html@nopBI\html@nopBI} +%\renewcommand{\htmlrulestar}[1][all]{} +\let\htmlclear\html@nopBI +%\renewcommand{\htmlclear}[1][all]{} +\let\bodytext\html@nopI +\let\htmlbody\html@nopBI + +% hyperref etc co +\newcommand\hyperref@hyper[4]{#4} +\newcommand\hyperref[1][]{\hyperref@i[#1]} + +\def\hyperref@i[#1]{{\def\next{#1}% + \def\tmp{}\ifx\next\tmp\aftergroup\hyperref@def + \else\def\tmp{ref}\ifx\next\tmp\aftergroup\hyperref@def + \else\def\tmp{pageref}\ifx\next\tmp\aftergroup\hyperref@pageref + \else\def\tmp{page}\ifx\next\tmp\aftergroup\hyperref@pageref + \else\def\tmp{noref}\ifx\next\tmp\aftergroup\hyperref@noref + \else\def\tmp{no}\ifx\next\tmp\aftergroup\hyperref@noref + \else\def\tmp{hyper}\ifx\next\tmp\aftergroup\hyperref@hyper + \else\def\tmp{html}\ifx\next\tmp\aftergroup\hyperref@hyper + \else\typeout{*** unknown option \next\space to hyperref ***}% + \fi\fi\fi\fi\fi\fi\fi\fi}} + +\newcommand{\hyperref@def}[4]{#2\ref{#4}#3} +\newcommand{\hyperref@pageref}[4]{#2\pageref{#4}#3} +\newcommand{\hyperref@noref}[3]{#2} + +\newcommand\hypercite[1][]{\hypercite@i[#1]} + +\def\hypercite@i[#1]{{\def\next{#1}% + \def\tmp{}\ifx\next\tmp\aftergroup\hypercite@def + \else\def\tmp{int}\ifx\next\tmp\aftergroup\hypercite@def + \else\def\tmp{cite}\ifx\next\tmp\aftergroup\hypercite@def + \else\def\tmp{ext}\ifx\next\tmp\aftergroup\hypercite@nocite + \else\def\tmp{nocite}\ifx\next\tmp\aftergroup\hypercite@nocite + \else\def\tmp{no}\ifx\next\tmp\aftergroup\hypercite@nocite + \else\typeout{*** unknown option \next\space to hypercite ***}% + \fi\fi\fi\fi\fi\fi}} + +\newcommand\hypercite@def[4]{#2{\def\tmp{#3}\def\emptyopt{}% + \ifx\tmp\emptyopt\cite{#4}\else\cite[#3]{#4}\fi}} +\newcommand\hypercite@nocite[2]{#2\hypercite@nocitex} +\newcommand\hypercite@nocitex[2][]{\nocite{#2}} + + +\newcommand\htmlref[2][]{#2{\def\tmp{#1}\ifx\tmp\@empty + \aftergroup\html@nopI\else\aftergroup\html@nopBII\fi}} + +\newcommand{\htmlcite}[2][]{#2{\def\tmp{#1}\ifx\tmp\@empty + \aftergroup\htmlcite@def\else\aftergroup\html@nopBII\fi}} +\newcommand{\htmlcite@def}[1]{ \nocite{#1}} + +\let\htmlimage\html@nopBII +\let\htmlborder\html@nopBII +\newenvironment{makeimage}{}{} +\newenvironment{tex2html_deferred}{}{} +\let\htmladdtonavigation\html@nopI + +% comment + +\def\htmlincludecomment + #1{\expandafter\def\csname#1\endcsname{}% + \expandafter\def\csname end#1\endcsname{}} +\def\htmlexcludecomment#1{% + \expandafter\let\csname#1\endcsname\comment + \expandafter\let\csname end#1\endcsname\endcomment} + +% \htmlexcludecomment{comment} + +\let\includecomment=\htmlincludecomment +\let\excludecomment=\htmlexcludecomment +\let\htmlreexcludecomment=\htmlexcludecomment + +\htmlexcludecomment{rawhtml} +\htmlexcludecomment{htmlonly} +\let\html\html@nopI +\htmlexcludecomment{imagesonly} +% \newenvironment{latexonly}{}{} +\newcommand\latex[1]{#1} +\long\def\latexhtml#1#2{#1} + +\let\htmltracing\html@nopI +\let\htmltracenv\html@nopI +\let\strikeout\html@nopI + +\let\htmlurl=\url +\let\HTMLcode\html@nopBII +\let\HTML\html@nopBII +\let\HTMLset\html@nopBIII +\let\HTMLsetenv\html@nopBIII +\let\internal\html@nopBII +\let\htmlhead\html@nopBIII +\let\htmlnohead\html@nop +\let\htmlbase\html@nopI +\let\htmlsetstyle\html@nopBIII +\let\htmladdtostyle\html@nopBIII +\let\htmllanguagestyle\html@nopBII +\let\startdocument\html@nop +\newcommand\tableofchildlinks{\@ifstar\html@nopBI\html@nopBI} +\newcommand\htmlinfo{\@ifstar\html@nopBI\html@nopBI} + +% This redefines \begin to allow for an optional argument +% which is used by LaTeX2HTML to specify `style-sheet' information + +\let\realLaTeX@begin=\begin +\renewcommand{\begin}[1][]{\realLaTeX@begin} + + +\@ifundefined{c@part}{\newcounter{part}}{}% +\@ifundefined{c@chapter}{\newcounter{chapter}}{} +\newcounter{lpart} +\newcounter{lchapter}[part] +\newcounter{lsection}[part] +\newcounter{lsubsection}[section] +\newcounter{lsubsubsection}[subsection] +\newcounter{lparagraph}[subsubsection] +\newcounter{lsubparagraph}[paragraph] +\newcounter{lsubsubparagraph}[lsubparagraph] + +\let\Hpart=\part +%\let\Hchapter=\chapter +\let\Hsection=\section +\let\Hsubsection=\subsection +\let\Hsubsubsection=\subsubsection +\let\Hparagraph=\paragraph +\let\Hsubparagraph=\subparagraph +\let\Hsubsubparagraph=\subsubparagraph + +\let\resetsections\html@nop +\let\resetsubsections\html@nop +\let\resetsubsubsections\html@nop +\let\resetparagraphs\html@nop +\let\resetsubparagraphs\html@nop +\let\resetsubsubparagraphs\html@nop + + +\let\DumpPtr\html@nopII +%\newwrite\ptrfile +\def\DumpCounters#1#2#3#4{} + + +\let\dumpcitestatus\html@nop +\let\loadcitestatus\html@nop +\let\dumpcurrentcolor\html@nop +\let\loadsegmentcolors\html@nop +\let\segmentpagecolor\html@nopBI +\let\segmentcolor\html@nopBII + + +\newcommand\segment{\@ifstar{\html@nopBI}{\html@nopBI}} +\let\@endsegment\html@nopBI +\let\endsegment\@endsegment + +\def\hyperimage#1{\includegraphics{#1}} + +\endinput diff --git a/tralics/tralics_conf/inputenc.plt b/tralics/tralics_conf/inputenc.plt new file mode 100644 index 0000000..557d053 --- /dev/null +++ b/tralics/tralics_conf/inputenc.plt @@ -0,0 +1,481 @@ +%%% -*- latex -*- +\ProvidesPackage{inputenc}[2008/03/19 v1.2 Input encoding file] +%% $Id: inputenc.plt,v 2.7 2008/03/19 17:54:46 grimm Exp $ +%% TRALICS, copyright (C) INRIA/apics (Jose' Grimm) 2006, 2007 +%% Licensed under the CeCILL free software license +%% (See the file COPYING in the main directory for details) + + +%% Documentation at end of file + +\def\IeC{% + \ifx\protect\@typeset@protect + \expandafter\@firstofone + \else + \noexpand\IeC + \fi +} + +\newtoks\inpenc@prehook +\newtoks\inpenc@posthook +\def\inputencoding#1{% + \the\inpenc@prehook + \edef\inputencodingname{#1}% + \input@encoding=\encoding@value{\inputencodingname}% + \the\inpenc@posthook +} + + + +\let\inputencodingname\relax +\newif\if@ie@needed \@ie@neededfalse +\newif\if@ie@needed@simple \@ie@needed@simplefalse +\def\encoding@value#1{\csname ie@#1\endcsname} +\def\encoding@def#1{\expandafter\def\csname ie@#1\endcsname} + +\def\ie@newencoding#1#2{\encoding@def{#1}{#2}} +\def\ie@use#1{\def\inputencodingname{#1}} +\def\io@enc{2} +\def\DeclareInputText#1#2{\input@encoding@val\io@enc\space #1=#2\relax} + +\ie@newencoding{utf8}{0} +\ie@newencoding{latin1}{1} +\ie@newencoding{ascii}{2} +\ie@newencoding{ansinew}{3} +\ie@newencoding{applemac}{4} +\ie@newencoding{cp1250}{5} +\ie@newencoding{cp1252}{6} +\ie@newencoding{cp1257}{7} +\ie@newencoding{cp437}{8} +\ie@newencoding{cp437de}{9} +\ie@newencoding{cp865}{10} +\ie@newencoding{cp850}{11} +\ie@newencoding{cp852}{12} +\ie@newencoding{cp858}{13} +\ie@newencoding{decmulti}{14} +\ie@newencoding{latin10}{15} +\ie@newencoding{latin2}{16} +\ie@newencoding{latin3}{17} +\ie@newencoding{latin4}{18} +\ie@newencoding{latin5}{19} +\ie@newencoding{latin9}{20} +\ie@newencoding{macce}{21} +\ie@newencoding{next}{22} + + +\DeclareOption{utf8}{\ie@use{utf8}} +\DeclareOption{utf8x}{\ie@use{utf8}} +\DeclareOption{latin1}{\ie@use{latin1}} +\DeclareOption{ascii}{\ie@use{ascii}} +\DeclareOption{ansinew}{\@ie@neededtrue\ie@use{ansinew}} +\DeclareOption{applemac}{\@ie@neededtrue\ie@use{applemac}} +\DeclareOption{cp1250}{\@ie@neededtrue\ie@use{cp1250}} +\DeclareOption{cp1252}{\@ie@neededtrue\ie@use{cp1252}} +\DeclareOption{cp1257}{\@ie@neededtrue\ie@use{cp1257}} +\DeclareOption{cp437}{\@ie@neededtrue\ie@use{cp437}} +\DeclareOption{cp437de}{\@ie@neededtrue\ie@use{cp437de}} +\DeclareOption{cp865}{\@ie@neededtrue\ie@use{cp865}} +\DeclareOption{cp850}{\@ie@neededtrue\ie@use{cp850}} +\DeclareOption{cp852}{\@ie@neededtrue\ie@use{cp852}} +\DeclareOption{cp858}{\@ie@neededtrue\ie@use{cp858}} +\DeclareOption{decmulti}{\@ie@neededtrue\ie@use{decmulti}} +\DeclareOption{latin10}{\@ie@neededtrue\ie@use{latin10}} +\DeclareOption{latin2}{\@ie@neededtrue\ie@use{latin2}} +\DeclareOption{latin3}{\@ie@neededtrue\ie@use{latin3}} +\DeclareOption{latin4}{\@ie@neededtrue\ie@use{latin4}} +\DeclareOption{latin5}{\@ie@neededtrue\ie@use{latin5}} +\DeclareOption{latin9}{\ie@use{latin9}} +\DeclareOption{macce}{\@ie@neededtrue\ie@use{macce}} +\DeclareOption{next}{\@ie@neededtrue\ie@use{next}} + + +\ProcessOptions \relax + +\ifx\inputencodingname\relax\else + \input@encoding@default\encoding@value{\inputencodingname}% + \edef\@tempa{% + \AtBeginDocument{\noexpand\inputencoding{\inputencodingname}}} + \@tempa + \let\inputencodingname\relax +\fi + + +% latin9 iso-8859-15 +\edef\io@enc{\encoding@value{latin9}} +\DeclareInputText{164}{"20AC} +\DeclareInputText{166}{"160} +\DeclareInputText{168}{"161} +\DeclareInputText{180}{"17D} +\DeclareInputText{184}{"17E} +\DeclareInputText{188}{"152} +\DeclareInputText{189}{"153} +\DeclareInputText{190}{"178} + + + +\if@ie@needed\else\endinput\fi + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% ansi new +\input@encoding@val\ie@ansinew -32 128 +"20AC 0 "201A "192 "201E "2026 "2020 "2021 +"2038 "2030 "160 "2039 "152 0 "17D 0 +0 "2018 "2019 "201C "201D "2022 "2013 "2014 +"2F7 "2122 "161 "203A "153 0 "17E "178 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input@encoding@val\ie@applemac -128 128 +196 197 199 201 209 214 220 225 +224 226 228 227 229 231 233 232 +234 235 237 236 238 239 241 243 +242 244 246 245 250 249 251 252 +"2020 176 162 163 167 "2022 182 223 +174 169 "2122 180 168 "2260 198 216 +"221E 177 "2264 "2265 165 181 "2202 "3A3 +"3A0 "3C0 "222B 170 186 "3A9 230 248 +191 161 172 "221A "192 "2248 "394 171 +187 "2026 160 192 195 213 "152 "153 +"2013 "2014 "201C "201D "2018 "2019 247 "22C4 +255 "178 47 164 "2039 "203A "FB01 "FB02 +"2021 183 "201A "201E "2030 194 202 193 +203 200 205 206 207 204 211 212 +"F8FF 210 218 219 217 "131 "2038 "2F7 +175 "306 "307 "30A 184 "30B "328 "30C + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input@encoding@val \encoding@value{cp1250} -128 128 +"20AC 0 "201A 0 "201E "2026 "2020 "2021 +0 "2030 "160 "2039 "15A "164 "17D "179 +0 "2018 "2019 "201C "201D "2022 "2013 "2014 +0 "2122 "161 "203A "15B "165 "17E "17A +160 "30C "30 "141 164 "1CD 166 167 +168 169 "15E 171 172 173 174 "17B +176 177 "328 "142 180 181 182 283 +184 "105 "15F 187 "13D "30B "13E "17C +"154 193 194 "102 196 "139 "106 199 +"10C 201 "118 203 "11A 205 206 "10E +"110 "143 "147 211 212 "150 214 215 +"158 "16E 218 "170 220 221 "162 223 +"155 225 226 "103 228 "13A "107 231 +"10D 233 "119 235 "11B 237 238 "10F +"111 "144 "148 243 244 "151 246 247 +"159 "16F 250 "171 252 253 "163 "307 + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\input@encoding@val \encoding@value{cp1252} -32 128 +"20AC 0 "201A "192 "201E "2026 "2020 "2021 +"2038 "2030 "160 "2039 "152 0 "17D 0 +0 "2018 "2019 "201C "201D "2022 "2013 "2014 +"2F7 "2122 "161 "203A "153 157 "17E "178 + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input@encoding@val \encoding@value{cp1257} -128 128 +"20AC 0 "201A 0 "201E "2026 "2020 "2021 +0 "2030 0 "2039 0 168 "30C 184 +0 "2018 "2019 "201C "201D "2022 "2013 "2014 +0 "2122 0 "203A 0 175 "328 0 +160 161 162 163 164 0 166 167 +216 169 "156 171 172 173 174 198 +176 177 178 179 180 181 182 183 +248 185 "157 187 188 189 190 230 +"104 "12E "100 "106 196 197 "118 "112 +"10C 201 "179 "116 "122 "136 "12A "13B +"160 "143 "145 211 "14C 213 214 215 +"172 "141 "15A "16A 220 "17B "17D 223 +"105 "12F "101 "107 228 229 "119 "113 +"10D 233 "17A "117 "123 "137 "12B "13C +"161 "144 "146 243 "14D 245 246 247 +"173 "142 "15B "16B 252 "17C "17E "307 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\input@encoding@val \encoding@value{cp437} -128 128 +199 252 233 226 228 224 229 231 +234 235 232 239 238 236 196 197 +201 230 198 244 246 242 251 249 +255 214 220 162 163 165 "2A07 "192 +225 237 243 250 241 209 170 186 +191 0 172 189 188 161 171 187 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +"3B1 "3B2 "393 "3C0 "3A3 "3C3 181 "3B3 +"3A6 "3B8 "3A9 "394 "221E "3D5 "3B5 "2229 +"2261 177 "2265 "2264 244 245 247 "2248 +176 183 "2022 "221A "207F 178 "25AA 160 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\input@encoding@val \encoding@value{cp437de} -128 128 +199 252 233 226 228 224 229 231 +234 235 232 239 238 236 196 197 +201 230 198 244 246 242 251 249 +255 214 220 162 163 165 "2A07 "192 +225 237 243 250 241 209 170 186 +191 0 172 189 188 161 171 187 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +"3B1 223 "393 "3C0 "3A3 "3C3 181 "3B3 +"3A6 "3B8 "3A9 "394 "221E "3D5 "3B5 "2229 +"2261 177 "2265 "2264 244 245 247 "2248 +176 183 "2022 "221A "207F 178 "25AA 160 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\input@encoding@val \encoding@value{cp865} -128 128 +199 252 233 226 228 224 229 231 +234 235 232 239 238 236 196 197 +201 230 198 244 246 242 251 249 +255 214 220 248 163 216 "2A07 "192 +225 237 243 250 241 209 170 186 +191 0 172 189 188 161 171 164 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +"3B1 "3B2 "393 "3C0 "3A3 "3C3 181 "3B3 +"3A6 "3B8 "3A9 "394 "221E "3D5 "3B5 "2229 +"2261 177 "2265 "2264 244 245 247 "2248 +176 183 "2022 "221A "207F 178 "25AA 160 + +%\showthe\input@encoding@val \encoding@value{cp865} 175 +%\showthe\input@encoding@val \encoding@value{cp865} 255 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input@encoding@val \encoding@value{cp850} -128 128 +199 252 233 226 228 224 229 231 +234 235 232 239 238 236 196 197 +201 230 198 244 246 242 251 249 +255 214 220 248 163 216 215 "192 +225 237 243 250 241 209 170 186 +191 174 172 189 188 161 171 187 +0 0 0 0 0 193 194 192 +169 0 0 0 0 162 165 0 +0 0 0 0 0 0 227 195 +0 0 0 0 0 0 0 164 +240 208 202 203 200 "131 205 206 +207 0 0 0 0 166 204 0 +211 223 212 210 245 213 181 254 +222 218 219 217 253 221 175 180 +173 177 0 189 182 167 247 184 +176 168 183 185 179 178 "25AA 160 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input@encoding@val \encoding@value{cp858} -128 128 +199 252 233 226 228 224 229 231 +234 235 232 239 238 236 196 197 +201 230 198 244 246 242 251 249 +255 214 220 248 163 216 215 "192 +225 237 243 250 241 209 170 186 +191 174 172 189 188 161 171 187 +0 0 0 0 0 193 194 192 +169 0 0 0 0 162 165 0 +0 0 0 0 0 0 227 195 +0 0 0 0 0 0 0 164 +240 208 202 203 200 "20AC 205 206 +207 0 0 0 0 166 204 0 +211 223 212 210 245 213 181 254 +222 218 219 217 253 221 175 180 +173 177 0 189 182 167 247 184 +176 168 183 185 179 178 "25AA 160 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input@encoding@val \encoding@value{cp858} -128 128 +199 252 233 226 228 "16F "107 231 +"142 235 "150 "151 238 "179 196 106 +201 "139 "13A 244 246 "13D "13E "15A +"15B 214 220 "164 "165 "141 215 "10D +225 237 243 250 "104 "105 "17D "17E +"118 "119 172 "17A "10C "15F 171 187 +0 0 0 0 0 193 194 "11A +"15E 0 0 0 0 "17B "17C 0 +0 0 0 0 0 0 "102 "103 +0 0 0 0 0 0 0 164 +"111 "110 "10E 203 "10F "147 205 206 +"11B 0 0 0 0 "162 "16E 0 +211 223 212 "143 "144 "148 "160 "161 +"154 218 "155 "170 253 221 "163 180 +173 "30B "328 "30C "306 167 247 184 +176 168 "307 "171 "158 "159 "25AA 160 + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input@encoding@val \encoding@value{latin10} -96 160 +160 "104 "105 "141 "20AC "201E "160 167 +"161 169 "218 171 "179 173 "17A "17B +176 177 "10C "142 "17D "201D 182 183 +"17E "10D "219 187 "152 "153 "178 "17C +192 193 194 "102 196 "106 198 199 +200 201 202 203 204 205 206 207 +"110 "143 210 211 212 "150 214 "15A +"170 217 218 219 220 "118 "21A 223 +224 225 226 "103 228 "107 230 231 +232 233 234 235 236 237 238 239 +"111 "144 242 243 244 "151 246 "15B +"171 249 250 251 252 "119 "21B 255 + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% latin2 +\input@encoding@val \encoding@value{latin2} -96 160 +160 "104 "306 "141 164 "13D "15A 167 +168 "160 "15E "164 "179 173 "17D "17B +176 "105 "328 "142 180 "13E "15B "30C +184 "161 "15F "165 "17A "30B "17E "17C +"154 193 194 "102 196 "139 "106 199 +"10C 201 "118 203 "11A 205 206 "10E +"110 "143 "147 211 212 "150 214 215 +"158 "16E 218 "170 220 221 "162 223 +"155 225 226 "103 228 "13A "107 231 +"10D 233 "119 235 "11B 237 238 "10F +"111 "144 "148 243 244 "151 246 247 +"159 "16F 250 "171 252 253 "163 "307 + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input@encoding@val \encoding@value{latin3} -96 160 +160 "126 "306 163 164 165 "124 167 +168 "130 "15E "11E "134 173 174 "17B +176 "127 178 179 180 181 "125 183 +184 "131 "15F "11F "135 189 190 "17C +192 193 194 195 196 "10A "108 199 +200 201 202 203 204 205 206 207 +208 209 210 211 212 "120 214 215 +"11C 217 218 219 220 "16C "15C 223 +224 225 226 227 228 "10B "109 231 +232 233 234 235 236 237 238 239 +240 241 242 243 244 "121 246 247 +"11D 249 250 251 252 "16D "15D "307 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% encoding table for latin4 + +\input@encoding@val \encoding@value{latin4} -96 160 +160 "104 "312 "156 164 "128 "13B 167 +168 "160 "112 "122 "166 173 "17D 175 +176 "105 "328 "157 180 "129 "13C "30C +184 "161 "113 "123 "167 "14A "17E "14B +"100 193 194 195 196 197 198 "12E +"10C 201 "118 203 "116 205 206 "12A +"110 "145 "14C "136 212 213 214 215 +216 "172 218 219 220 "168 "16A 223 +"101 225 226 227 228 229 230 "12F +"10D 233 "119 235 "117 237 238 "12B +"111 "146 "14D "137 244 245 246 247 +248 "173 250 251 252 "169 "16B "307 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%latin5 ISO-8859-9 +% like latin1 with some exceptions +\edef\io@enc{\encoding@value{latin5}} +\DeclareInputText{208}{"11E} +\DeclareInputText{221}{"130} +\DeclareInputText{222}{"15E} +\DeclareInputText{253}{"131} +\DeclareInputText{254}{"15F} + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% encoding table for macce + +\input@encoding@val\ie@macce -128 128 +196 0 0 201 "104 214 220 0 +"105 "10C 228 "10D "106 "107 0 "179 +"17A 0 0 0 0 0 0 243 +0 244 246 0 0 0 0 252 +"2020 176 "118 163 167 "2022 182 223 +174 169 0 "119 0 0 0 0 +0 0 0 0 0 0 0 0 +"142 0 0 0 0 0 0 0 +0 "143 0 0 "144 0 0 171 +187 "2026 160 0 0 0 0 0 +"2013 "2014 "201C "201D "2018 "2019 247 0 +0 0 0 0 0 "2039 "203A "159 0 +0 0 "201A "201E 0 "15A "15B 0 +0 0 0 0 0 0 211 211 212 +0 0 0 0 0 0 0 0 +0 0 0 "17B "141 "17C 0 0 + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Econding table for next + +\input@encoding@val\ie@next -128 128 +160 192 193 194 195 196 197 199 +200 201 202 203 204 205 206 207 +208 209 210 211 212 213 214 217 +218 219 252 221 222 181 215 247 +169 161 162 163 47 165 "192 167 +164 "2019 "201C 171 "2039 "203A "FB01 "FB02 +174 "2013 "2020 "2021 183 166 182 "2022 +"201A "201E "201D 187 "2026 "2030 172 191 +185 "300 180 "2038 "2F7 175 "306 "307 +168 178 "30A 184 179 "30B "328 "30C +"2014 177 188 189 189 224 225 226 +227 228 229 231 232 233 234 235 +236 198 237 170 238 239 240 241 +"141 216 "152 186 242 243 244 245 +246 230 249 250 251 "131 252 253 +"142 248 "153 223 254 255 0 0 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\edef\io@enc{\encoding@value{decmulti}} +\DeclareInputText{215}{"152} +\DeclareInputText{221}{"178} +\DeclareInputText{247}{"153} +\DeclareInputText{253}{255} + +\endinput + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% This file uses features defined in Tralics 2.10.8 +%% It provides \IeC (same code as in LaTeX) +%% It provides \inpenc@prehook and \inpenc@posthook, two hooks +%% It provides \inputencoding a command that changes the encoding +%% of the current file. Argument is a known encoding name +%% If you say \usepackage[foo,bar]{inputenc} +%% this defines foo and bar, uses bar. +%% If you chose an encoding other than : utf8, latin1, ascii, then all +%% encodings are loaded> + +%% Declaration \input@encoding@default=17 +%% sets default encoding to 17 +%% Declaration \input@encoding=16 +%% sets current encoding to 16 +%% Declaration \input@encoding@val 15 32 48 +%% defines for encoding 15 the character 32 to be Unicode U+30 +%% Declaration \input@encoding@val 15 -3 48 100 110 120 +%% changes characters 48 49 and 50 to 100 110 and 120 +%% All modifications are global. +%% Use \the\foo in order to get the value of \foo +%% Encoding 0 is UTF8, encoding 1 is latin1; these are fixed + diff --git a/tralics/tralics_conf/minimal.clt b/tralics/tralics_conf/minimal.clt new file mode 100644 index 0000000..0933867 --- /dev/null +++ b/tralics/tralics_conf/minimal.clt @@ -0,0 +1,9 @@ +%% -*- latex -*- + +% This file is part of Tralics +%% copyright (C) INRIA/apics (Jose' Grimm) 2006, 2007 +%% $Id: article.clt,v 2.2 2007/02/19 07:49:57 grimm Exp $ + +\ProvidesClass{minimal}[2007/12/29 v1.0 minimal document class for Tralics] +\endinput + diff --git a/tralics/tralics_conf/natbib.plt b/tralics/tralics_conf/natbib.plt new file mode 100644 index 0000000..12a7178 --- /dev/null +++ b/tralics/tralics_conf/natbib.plt @@ -0,0 +1,279 @@ +%% -*- latex -*- +%% This is file `natbib.plt', a simplified version of natbib.sty for tralics +%% Copyright 2006 INRIA Jose Grimm + +%% Copyright 1993-2003 Patrick W Daly, for the natbib.sty file +\ProvidesPackage{natbib}[2008/05/18 v1.3 ] +% $Id: natbib.plt,v 2.3 2008/05/19 06:42:15 grimm Exp $ + +\let\@tralics@cite\cite + +\ifx\natcite\undefined + +\def\cite@type#1{\@ifnextchar[{\cite@typex{#1}}{\cite@typey{#1}}} +\def\cite@typey#1#2{{\def\cite@@type{#1}\@tralics@cite{#2}}} +\def\cite@typex#1[#2]{\@ifnextchar[{\cite@typexx{#1}{#2}}{\cite@typeyy{#1}{#2}}} +\def\cite@typeyy#1#2#3{{\def\cite@@type{#1}\@tralics@cite[#2]{#3}}} +\def\cite@typexx#1#2[#3]#4{{\def\cite@@type{#1}\@tralics@cite[#2 and #3]{#4}}} + +\else +\def\cite@type#1{\natcite[#1]} +\fi + + +% Defining the citation style of a given bib style: + % Use \bibpunct (in the preamble only) with 6 mandatory arguments: + % 1. opening bracket for citation + % 2. closing bracket + % 3. citation separator (for multiple citations in one \cite) + % 4. the letter n for numerical styles, s for superscripts + % else anything for author-year + % 5. punctuation between authors and date + % 6. punctuation between years (or numbers) when common authors missing + % One optional argument is the character coming before post-notes. It + % appears in square braces before all other arguments. May be left off. + % Example (and default) \bibpunct[, ]{(}{)}{;}{a}{,}{,} + +% These are the variables needed +\newif\ifNAT@numbers \NAT@numbersfalse +\newif\ifNAT@super \NAT@superfalse + +%% These 4 commands are define in the Tralics kernel +\providecommand\NAT@open{(} +\providecommand\NAT@close{)} +\providecommand\NAT@cmt{, } +\providecommand\NAT@sep{;} +\newcommand\NAT@aysep{,} +\newcommand\NAT@yrsep{,} + + +%% Tralics action in case a style is given +\def\NAT@insertstyle{ + \XMLaddatt[3]{natopen}{\NAT@open} + \XMLaddatt[3]{natclose}{\NAT@close} + \XMLaddatt[3]{natsep}{\NAT@sep} + \XMLaddatt[3]{nataysep}{\NAT@aysep} + \XMLaddatt[3]{natyrsep}{\NAT@yrsep} + \XMLaddatt[3]{natcmt}{\NAT@cmt} + \XMLaddatt[3]{natpos}{\ifNAT@numbers n\else\ifNAT@super s\else a\fi\fi} +} + +%% The user command +\newcommand\bibpunct[7][, ]{% + \gdef\NAT@open{#2}% + \gdef\NAT@close{#3}% + \gdef\NAT@sep{#4}% + \global\NAT@numbersfalse + \ifx #5n\global\NAT@numberstrue + \else + \ifx #5s\global\NAT@numberstrue\global\NAT@supertrue + \fi\fi + \gdef\NAT@aysep{#6}% + \gdef\NAT@yrsep{#7}% + \gdef\NAT@cmt{#1}% + \global\let\bibstyle\@gobble +} + + % Define citation punctuation for some author-year styles + % One may add and delete at this point + % Or put additions into local configuration file natbib.cfg +\newcommand\bibstyle@chicago{\bibpunct{(}{)}{;}{a}{,}{,}} +\newcommand\bibstyle@named{\bibpunct{[}{]}{;}{a}{,}{,}} +\newcommand\bibstyle@agu{\bibpunct{[}{]}{;}{a}{,}{,~}}%Amer. Geophys. Union +\newcommand\bibstyle@egs{\bibpunct{(}{)}{;}{a}{,}{,}}%Eur. Geophys. Soc. +\newcommand\bibstyle@agsm{\bibpunct{(}{)}{,}{a}{}{,}\gdef\harvardand{\&}} +\newcommand\bibstyle@kluwer{\bibpunct{(}{)}{,}{a}{}{,}\gdef\harvardand{\&}} +\newcommand\bibstyle@dcu{\bibpunct{(}{)}{;}{a}{;}{,}\gdef\harvardand{and}} +\newcommand\bibstyle@aa{\bibpunct{(}{)}{;}{a}{}{,}} %Astronomy & Astrophysics +\newcommand\bibstyle@pass{\bibpunct{(}{)}{;}{a}{,}{,}}%Planet. & Space Sci +\newcommand\bibstyle@anngeo{\bibpunct{(}{)}{;}{a}{,}{,}}%Annales Geophysicae +\newcommand\bibstyle@nlinproc{\bibpunct{(}{)}{;}{a}{,}{,}}%Nonlin.Proc.Geophys. + % Define citation punctuation for some numerical styles +\newcommand\bibstyle@cospar{\bibpunct{/}{/}{,}{n}{}{}% + \gdef\NAT@biblabelnum##1{##1.}} +\newcommand\bibstyle@esa{\bibpunct{(Ref.~}{)}{,}{n}{}{}% + \gdef\NAT@biblabelnum##1{##1.\hspace{1em}}} +\newcommand\bibstyle@nature{\bibpunct{}{}{,}{s}{}{\textsuperscript{,}}% + \gdef\NAT@biblabelnum##1{##1.}} + % The standard LaTeX styles +\newcommand\bibstyle@plain{\bibpunct{[}{]}{,}{n}{}{,}} +\let\bibstyle@alpha=\bibstyle@plain +\let\bibstyle@abbrv=\bibstyle@plain +\let\bibstyle@unsrt=\bibstyle@plain +% The author-year modifications of the standard styles +\newcommand\bibstyle@plainnat{\bibpunct{[}{]}{,}{a}{,}{,}} +\let\bibstyle@abbrvnat=\bibstyle@plainnat +\let\bibstyle@unsrtnat=\bibstyle@plainnat + + +%%% ------------------------------------------------------------- + +\let\bibstyle=\@gobble %% standard latex + +\newif\ifNAT@openbib \NAT@openbibfalse +\newif\ifNAT@longnames\NAT@longnamesfalse + +\DeclareOption{numbers}{\NAT@numberstrue + \ExecuteOptions{square,comma,nobibstyle}} +\DeclareOption{super}{\NAT@supertrue\NAT@numberstrue + \renewcommand\NAT@open{}\renewcommand\NAT@close{} + \ExecuteOptions{nobibstyle}} +\DeclareOption{authoryear}{\NAT@numbersfalse + \ExecuteOptions{round,colon,bibstyle}} +\DeclareOption{round}{% + \renewcommand\NAT@open{(} \renewcommand\NAT@close{)} + \ExecuteOptions{nobibstyle}} +\DeclareOption{square}{% + \renewcommand\NAT@open{[} \renewcommand\NAT@close{]} + \ExecuteOptions{nobibstyle}} +\DeclareOption{angle}{% + \renewcommand\NAT@open{$<$} \renewcommand\NAT@close{$>$} + \ExecuteOptions{nobibstyle}} +\DeclareOption{curly}{% + \renewcommand\NAT@open{\{} \renewcommand\NAT@close{\}} + \ExecuteOptions{nobibstyle}} +\DeclareOption{comma}{\renewcommand\NAT@sep{,} + \ExecuteOptions{nobibstyle}} +\DeclareOption{colon}{\renewcommand\NAT@sep{;} + \ExecuteOptions{nobibstyle}} +\DeclareOption{nobibstyle}{\let\bibstyle=\@gobble} +\DeclareOption{bibstyle}{\let\bibstyle=\@citestyle} +\DeclareOption{openbib}{\NAT@openbibtrue} +\DeclareOption{sectionbib}{\def\NAT@sectionbib{on}} +\DeclareOption{sort}{\def\NAT@sort{1}} +\DeclareOption{sort&compress}{\def\NAT@sort{2}} +\DeclareOption{longnamesfirst}{\NAT@longnamestrue} +\DeclareOption{nonamebreak}{\def\NAT@nmfmt#1{\mbox{\NAT@up#1}}} + +\def\NAT@sort{0} +\newcommand\citetext[1]{\NAT@open#1\NAT@close} + +\def\NAT@nmfmt#1{{\NAT@up#1}} +\renewcommand\bibstyle[1]{\@ifundefined{bibstyle@#1}{\relax} + {\csname bibstyle@#1\endcsname}} +\AtBeginDocument{\global\let\bibstyle=\@gobble} +\let\@citestyle\bibstyle +\newcommand\citestyle[1]{\@citestyle{#1}\let\bibstyle\@gobble} +\@onlypreamble{\citestyle}\@onlypreamble{\@citestyle} +\@onlypreamble{\bibpunct} +\ProcessOptions + + +\def\citeyear{\cite@type{year}} +\def\citeyearpar{\cite@type{yearpar}} +\def\citeauthor{\@ifstar{\cite@type{fullauthor}}{\cite@type{author}}} +\def\citefullauthor{\cite@type{fullauthor}} + +\def\citep{\@ifstar{\cite@type{citepstar}}{\cite@type{citep}}} +\def\citealt{\@ifstar{\cite@type{citealtstar}}{\cite@type{citealt}}} +\def\citealp{\@ifstar{\cite@type{citealpstar}}{\cite@type{citealp}}} + +\def\Citet{\@ifstar{\cite@type{Citetstar}}{\cite@type{Citet}}} +\def\Citep{\@ifstar{\cite@type{Citepstar}}{\cite@type{Citep}}} +\def\Citealt{\@ifstar{\cite@type{Citealtstar}}{\cite@type{Citealt}}} +\def\Citealp{\@ifstar{\cite@type{Citealpstar}}{\cite@type{Citealp}}} +\def\Citeauthor{\@ifstar{\cite@type{Fullauthor}}{\cite@type{Author}}} + +\InputIfFileExists{natbib.cfg} + {\typeout{Local config file natbib.cfg used}}{} + +\NAT@insertstyle +\endinput + + +%% + % This is either to be made up manually, or to be generated by an + % appropriate .bst file with BibTeX. + % Author-year mode || Numerical mode + % Then, \citet{key} ==>> Jones et al. (1990) || Jones et al. [21] + % \citep{key} ==>> (Jones et al., 1990) || [21] + % Multiple citations as normal: + % \citep{key1,key2} ==>> (Jones et al., 1990; Smith, 1989) || [21,24] + % or (Jones et al., 1990, 1991) || [21,24] + % or (Jones et al., 1990a,b) || [21,24] + % \cite{key} is the equivalent of \citet{key} in author-year mode + % and of \citep{key} in numerical mode + % Full author lists may be forced with \citet* or \citep*, e.g. + % \citep*{key} ==>> (Jones, Baker, and Williams, 1990) + % Optional notes as: + % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) + % \citep[e.g.,][]{key} ==>> (e.g., Jones et al., 1990) + % \citep[see][pg. 34]{key}==>> (see Jones et al., 1990, pg. 34) + % (Note: in standard LaTeX, only one note is allowed, after the ref. + % Here, one note is like the standard, two make pre- and post-notes.) + % \citealt{key} ==>> Jones et al. 1990 + % \citealt*{key} ==>> Jones, Baker, and Williams 1990 + % \citealp{key} ==>> Jones et al., 1990 + % \citealp*{key} ==>> Jones, Baker, and Williams, 1990 + % Additional citation possibilities (both author-year and numerical modes) + % \citeauthor{key} ==>> Jones et al. + % \citeauthor*{key} ==>> Jones, Baker, and Williams + % \citeyear{key} ==>> 1990 + % \citeyearpar{key} ==>> (1990) + % \citetext{priv. comm.} ==>> (priv. comm.) + % Note: full author lists depends on whether the bib style supports them; + % if not, the abbreviated list is printed even when full requested. + % + % For names like della Robbia at the start of a sentence, use + % \Citet{dRob98} ==>> Della Robbia (1998) + % \Citep{dRob98} ==>> (Della Robbia, 1998) + % \Citeauthor{dRob98} ==>> Della Robbia + % + % + % Citation aliasing is achieved with + % \defcitealias{key}{text} + % \citetalias{key} ==>> text + % \citepalias{key} ==>> (text) + % + + % + % To make this automatic for a given bib style, named newbib, say, make + % a local configuration file, natbib.cfg, with the definition + % \newcommand{\bibstyle@newbib}{\bibpunct...} + % Then the \bibliographystyle{newbib} will cause \bibstyle@newbib to + % be called on THE NEXT LATEX RUN (via the aux file). + % + % Such preprogrammed definitions may be invoked in the text (preamble only) + % by calling \citestyle{newbib}. This is only useful if the style specified + % differs from that in \bibliographystyle. + % + % With \citeindextrue and \citeindexfalse, one can control whether the + % \cite commands make an automatic entry of the citation in the .idx + % indexing file. For this, \makeindex must also be given in the preamble. + % + % LaTeX2e Options: (for selecting punctuation) + % round - round parentheses are used (default) + % square - square brackets are used [option] + % curly - curly braces are used {option} + % angle - angle brackets are used