Ein Projekt zur Konversion eines Dokuments, geschrieben in einem simplen Markup-Format, zu HTML- und LaTeX-Dokumenten -- optimiert für Lesbarkeit, mit besten typographischen Absichten.
Document conversion from a simple markup format to HTML and LaTeX documents -- optimised for readability with best typographical intentions.
- Python
- TeX Live
- LaTeX / LuaTeX
- KOMA-Script
- Microtype
- Libertine
- csquotes
- Tufte CSS
- normalize.css
- HTML5 Boilerplate
- Bembo
- Markdown
- TOML
English version below
Natürlich muss Python installiert sein.
filt0r.py
hat zudem folgende Voraussetzungen
Vor der ersten Ausführung sind diese zu installieren:
pip install -r requirements.txt
Die Konversion zu HTML & LaTeX wird mit filt0r.py
durchgeführt. filt0r.py
wurde mit Python 2.7 und 3.4 getestet. Erwartet wird ein Argument: der Pfad zur Dokumentenquelle.
Beispiel:
$ python filt0r.py doc.txt
[...]
15:13:17:977.0 INFO: Wrote UTF-8-encoded LaTeX source file: latex/latex-body.tex.
[...]
15:13:17:987.0 INFO: Wrote UTF-8-encoded HTML document: html/index.html.
Optionales Argument: der Pfad zur Setupdatei (s.u.), falls abweichend von setup.toml
. Beispiel:
python filt0r.py doc.txt toml.toml
filt0r.py
sollte im Stammverzeichnis dieses Projekts ausgeführt werden. Es schreibt die Dateien latex/latex-document.tex
, latex/latex-body.tex
und html/index.html
relativ zum current working directory.
In einer Setupdatei in TOML-Notation (default: setup.toml
) werden allgemeine Einstellungen und Angaben zum zu generierenden Dokument gemacht. Dies sind Angaben wie Titel, Autor und verschiedene PDF- und HTML-Metadaten.
[general]
title = "Titel des Textes"
author = "Autor des Textes"
language = "Sprachkürzel" #de, en, ... (https://wiki.selfhtml.org/wiki/Sprachk%C3%BCrzel)
[latex]
pdfsubject = "Kurzbeschreibung für PDF Metadaten"
pdfkeywords = "Eine Reihe Schlüsselwörter für PDF Metadaten getrennt durch Kommata"
[html]
locale = "Regionalangabe" #de_DE, en_GB, ... #meta property og:locale
metadescription = "Kurzbeschreibung für HTML Metadaten" #meta description und meta property og:description
url = "URL des Textes" #meta property og:url
sitename = "Name der Seite, auf der der Text zu finden ist" #meta property og:site_name
[general]
subtitle = "Untertitel des Textes"
outputMode = "Typ des auszugebenden Dokuments" #draft, final, manuscript #default: final
#draft:
# Kommentare werden angezeigt
# Seitenformat: A4
# Schriftart: TeX Gyre Cursor (~Courier)
# Hinweis: Dieser Modus ist noch in Arbeit
#final:
# Keine Kommentare
# Dokument entsprechend der Konfiguration
#manuscript
# Keine Kommentare
# Seitenformat: A4
# Schriftart: TeX Gyre Cursor (~Courier)
# Hinweis: Dieser Modus ist noch in Arbeit
[latex]
pageFormat = "Seitenformat" #a0 - a6, b0 - b6 #default: a5 #Falls angegeben, werden pageWidth und pageHeight ignoriert
pageWidth = "Seitenbreite" #z.B. "210mm", "21.5cm"
pageHeight = "Seitenhöhe" #z.B. "210mm", "21.5cm"
bindingOffset = "Bundzugabe"
font = "Name der Schrift (siehe Abschnitt zu Schriften)"
fontSize = "Schriftgröße in pt" #z.B. 12.5 #default: 11
title = "Titel des Textes" #default: general.title
subtitle = "Untertitel des Textes" #default: general.title
printAuthorOnTitle = "Im Anfangstitel wird Autor mit angegeben" #nicht relevant, wenn bookPrint = "true" #default: false
halfTitle = "Schmutztitel" #Textkommando \\storyhalftitle #default: latex.title
isbn = "ISBN dieses Buches" #Textkommando \\isbn
bookPrint = "Textlayout für Buchdruck" #true, false #default: false
#true:
#document type = "scrbook"
#Seiten aus latex/bookPreliminaries werden dem Text in alphanumerischer Reihenfolge vorangestellt
#Seiten aus latex/bookAppendix werden dem Text in alphanumerischer Reihenfolge angehängt
#false:
#document type = "scrreprt"
#zu Textbeginn werden Titel und Untertitel gezeigt
headerLeft = "Kopfzeile links" #Es können Textkommandos verwendet werden (s.u.) #default: "\\storytitle"
headerRight = "Kopfzeile rechts" #Es können Textkommandos verwendet werden (s.u.) #default: "\\storychapter"
tableOfContents = "Inhaltsverzeichnis wird angezeigt" #true, false #default: false
contentsTitle = "Titel des Inhaltsverzeichnis"
tableOfContentsPagebreak = "Seitenumbruch nach Inhaltsverzeichnis" #true, false #default: false
chapterPagebreak = "Neue Seite bei Kapitelanfang" #true, false #default: false
hideChapterHeader = "Keine Kopfzeile bei Kapitelanfang" #true, false #default: self.chapterPagebreak
hascolorlinks = "Farbige Links" #default: "false"
urlcolor = "URL-Farbe" #default: "blue"
linkcolor = "Linkfarbe" #default: "black"
[html]
title = "Titel des Textes" #falls abweichend von general.title
subtitle = "Untertitel des Textes" #falls abweichend von general.subtitle
headertitle = "Text für den HTML Titel" #default: "title | author"
previewimage = "Link für Vorschaubild (Metadaten)" #meta property og:image
[general]
title = "Kommt und holt sie"
#subtitle = ""
author = "Josa Wode"
language = "de" #de, en, ...
outputMode = "final"
[latex]
bookPrint = true #true, false #Dokument wird für den Druck als Buch erstellt, es können Seiten zu Titelei und Anhang hinzugefügt werden (Verzeichnisse: latex/bookPreliminaries und latex/bookAppendix)
#headerLeft = "" #Text für Kopfzeile links festlegen; verfügbare Befehle \\storytitle, \\storysubtitle, \\storyhalftitle, \\storyauthor, \\storychapter; default: \\storytitle
#headerRight = "" #Text für Kopfzeile rechts festlegen; verfügbare Befehle \\storytitle, \\storysubtitle, \\storyhalftitle, \\storyauthor, \\storychapter; default: \\storychapter
#hideChapterHeader = true #true, false #default: chapterPagebreak #keine Kopfzeile zum Kapitelanfang
chapterPagebreak = true #true, false #true: neues Kapitel beginnt auf neuer Seite
tableOfContents = true #true, false #Inhaltsverzeichnis
#tableOfContentsPagebreak = true #true, false #default: false #true: neue Seite nach Inhaltsverzeichnis
contentsTitle = "Inhalt" #Falls angegeben, wird dies als Titel des Inhaltsverzeichnisses verwendet
isbn = "978-3-7460-9728-2"
pageFormat = "a5" # a0 - a6, b0 - b6 # Seitenformat festlegen
#pageWidth = "210" # in mm # Seitenbreite, nur wenn nicht durch 'pageFormat' festgelegt
#pageHeight = "297" # in mm # Seitenhöhe, nur wenn nicht durch 'pageFormat' festgelegt
bindingOffset = "15mm" #Seitenanteil der in der Bindung verschwindet
font = "gentium"
fontSize = "11" # e.g. 11 12.5 # Schriftgröße in pt
printAuthorOnTitle = false #true, false #Legt fest, ob die Titelseite mit dem Namen des Autors bzw. der Autorin beginnt
#title = "" #Auskommentieren, falls identisch mit 'general.title'
subtitle = "Eine Geschichte von Josa Wode" #Auskommentieren, falls identisch mit 'general.subtitle'
#halfTitle = "" #Schmutztitel für Buchdruck #Auskommentieren, falls identisch mit 'title'
pdfsubject = "Geschichte"
pdfkeywords = "geschichte, alte, josa, wode"
hascolorlinks = "true"
urlcolor = "blue"
linkcolor = "black"
[html]
#title = "" #Auskommentieren, falls identisch mit 'general.title'
#subtitle = "" #Auskommentieren, falls identisch mit 'general.subtitle'
headertitle = "Kommt und holt sie | eine Geschichte von Josa Wode"
url = "http://writing.fotoelectrics.de/documents/come-get-her/de/html/" #meta property og:url
metadescription = "Eine kurze Geschichte von Josa Wode - Es könnte ein Märchen sein, wenn es sich benehmen würde. (Lizenz: Creative Commons BY-NC-SA 3.0)" #meta description und meta property og:description
locale = "de_DE" #de_DE, en_GB, ... #meta property og:locale
sitename = "writing.fotoelectrics" #meta property og:site_name
#previewimage = "" #meta property og:image #Auskommentieren, falls kein image tag erwünscht ist
Für die Verwendung in (zusätzlichen) LaTeX-Dokumenten (s.u.) und bestimmten Setup-Einträgen (s.o.) stehen folgende Befehle (über den gewöhnlichen LaTeX-Befehlsumfang hinaus) zur Verfügung:
\storytitle
gibt den Titel aus\storysubtitle
gibt den Untertitel aus\storyhalftitle
gibt den Schmutztitel aus\storyauthor
gibt den Autor aus\storychapter
gibt das aktuelle Kapitel aus\isbn
gibt die ISBN aus\printtitle
gibt formatiert Titel, ggf. Untertitel und bei Setup-OptionprintAuthorOnTitle
zusätzlich den Autor aus
Für die Verwendung in der Setup-TOML ist \
als Escape-Charakter voranzustellen (z.B. \\storytitle
).
Es wird eine ganze Reihe von LaTeX-Schriften unterstützt. Das heißt nicht, dass diese Schriften eine gute Wahl für deine Textstory sind.
Es ist sehr zu empfehlen, für Fließtext eine Schrift mit Serifen zu wählen, da diese die Lesbarkeit verbessern. Standardmäßig ist als Textstory-Schrift Gentium ausgewählt -- sie sieht gut aus, ist typografisch hochwertig und im Zusammenhang mit Textstorys gründlich erprobt.
Bisher kann nur diese Hauptschrift konfiguriert werden.
Für Draft und Manuskript ist TeX Gyre Cursor, eine Art Courier, eingestellt, um dem Standard zu entsprechen.
Die Schrift für den Lizenztext ist Cabin.
- Alegreya
- Artemisia: siehe GFS Artemisia
- Baskerville: siehe Libre Baskerville
- Bonum, Bookman: siehe TeX Gyre Bonum
- Caladea
- Cochineal
- Computer Modern: siehe Latin Modern Roman
- DejaVu Serif
- DejaVu Serif Condensed
- Droid Serif
- fbb
- Free Serif, Freefont Serif: siehe GNU Freefont Serif
- Gentium: siehe Gentium Plus
- Gentium Plus (als Fettschrift wird Gentium Basic verwendet, da Gentium Plus hier nicht vollständig ist)
- GFS Artemisia
- GFS Bodoni
- GNU Freefont Serif
- Gyre Bonum: siehe TeX Gyre Bonum
- Gyre Pagella: siehe TeX Gyre Pagella
- Gyre Schola: siehe TeX Gyre Schola
- Gyre Termes: siehe TeX Gyre Termes
- Heuristica
- IM Fell English
- Junicode
- Kerkis: siehe TeX Gyre Bonum
- Latin Modern Roman
- Libre Baskerville
- Libre Bodoni
- Merriweather
- Merriweather Light
- New PX: siehe TeX Gyre Pagella
- New TX, Nimbus Roman: siehe TeX Gyre Termes
- Old Standard
- Pagella, Palladio: siehe TeX Gyre Pagella
- Playfair Display
- PX Fonts: siehe TeX Gyre Pagella
- Quattrocento
- Roboto Slab
- Roboto Slab Light
- Source Serif Pro Extra Light
- Source Serif Pro Light
- Source Serif Pro: siehe Source Serif Pro Regular
- Source Serif Pro Regular
- TeX Gyre Bonum
- TeX Gyre Pagella
- TeX Gyre Schola
- Termes: siehe TeX Gyre Termes
- TeX Gyre Termes
- TX Fonts: siehe TeX Gyre Termes
- Schola, Schoolbook, Schoolbook L: siehe TeX Gyre Schola
- URW Bookman, URW Bookman L: siehe TeX Gyre Bonum
- URW Nimbus Roman: siehe TeX Gyre Termes
- URW Palladio: siehe TeX Gyre Pagella
- URW Schoolbook, URW Schoolbook L: siehe TeX Gyre Schola
- XCharter
- XITS
- Courier: siehe TeX Gyre Cursor
- Deja Vu Sans Mono
- Fira Mono
- Latin Modern Mono
- Latin Modern Mono Light
- Source Code Pro
- TeX Gyre Cursor
- Adventor: siehe TeX Gyre Adventor
- Cabin
- Cabin Condensed
- Carlito
- Clear Sans
- Computer Modern Sans Serif: siehe Latin Modern Sans
- Cyklop
- DejaVu Sans
- DejaVu Sans Condensed
- Droid Sans
- Fira Sans Book
- Fira Sans Extra Light
- Fira Sans Light
- Fira Sans: siehe Fira Sans Regular
- Fira Sans Regular
- Fira Sans Thin
- Fira Sans Ultra Light
- Freefont Sans, Free Sans: siehe GNU Freefont Sans
- GFS Neohellenic
- GNU Freefont Sans
- Gyre Adventor: siehe TeX Gyre Adventor
- Gyre Heros: siehe TeX Gyre Heros
- Heros: siehe TeX Gyre Heros
- Iwona
- Iwona Light
- Kurier
- Kurier Light
- Latin Modern Sans
- Lato
- Merriweather Sans
- Merriweather Sans Light
- Mintspirit
- Neohellenic: siehe GFS Neohellenic
- Open Sans
- Overlock
- Quattrocento Sans
- Raleway
- Roboto
- Roboto Condensed
- Roboto Light
- Source Sans Pro
- TeX Gyre Adventor
- TeX Gyre Heros
- URW Nimbus Sans: siehe TeX Gyre Heros
- URW Gothic: siehe TeX Gyre Adventor
Unter dem Dateipfad latex/license.tex
kann eine Lizenz (als gültiges LaTeX-Dokument) bereitgestellt werden. Fehlt diese Datei, wird keine Lizenz an das Dokument angefügt.
Für die Lizenzen existieren Vorlagen im Verzeichnis latex/templates/licenses
.
Wurde die Setup-Option bookPrint
gewählt, können LaTeX-Dokumente für die Titelei und den Anhang des Buches in dafür vorgesehene Verzeichnisse eingefügt werden.
Die Dateien im jeweiligen Verzeichnis werden in alphanumerischer Reihenfolge in das Dokument eingefügt.
Verzeichnis für die Titelei: latex/bookPreliminaries
Verzeichnis für den Anhang: latex/bookAppendix
Vorlagen finden sich unter latex/templates
.
Im latex
-Verzeichnis dieses Projekts muss latex-document.tex
per lualatex
kompiliert werden (für das Erstellen des Inhaltsverzeichnisses ist dies zweimal durchzuführen). build.bat
dient als Helferlein für Windows (unter Linux kann ./build.bash
ausgeführt werden).
$ build.bat
[...]
Output written on latex-document.pdf (35 pages, 115586 bytes).
Transcript written on latex-document.log.
Der Kompiliervorgang wurde mit TeX Live 2015's lualatex
getestet.
Unter dem Dateipfad html/license.tpl.html
kann eine Lizenz (als gültiges HTML ohne header und body) eingefügt werden. Das dafür vorgesehene CSS-Stylesheet findet sich unter html/css/license-styles.css
.
Für Lizenz und zugehöriges CSS finden sich Templates im Verzeichnis html/templates/licenses
.
Erwartet wird eine Text-Datei in UTF-8-Kodierung.
Markup: Zeilenumbruch
Beispiel:
Dies ist der erste Absatz.
Hier beginnt der zweite Absatz.
Markup: Doppelter Zeilenumbruch bzw. Leerzeile
Beispiel: `Hier steht der Text des ersten Abschnitts.
Hier beginnt eine neue Sektion.`
Markup: Doppelraute am Zeilenanfang
Beispiel: ## Kapitel 1
Eine derart markierte Zeile wird als Überschrift (und Kapitelanfang) interpretiert.
Markup: Einfache Double-Quote-Paare.
Beispiel: Er sagte: "Oh, Kacke!"
In der Ausgabe werden französische Anführungszeichen gesetzt.
Refs:
Markup: Einfaches Minus.
Beispiel: Damen- und Herrentoilette
Wird unverändert in den HTML- und LaTeX-Code übertragen.
Refs:
Markup: Doppelminus.
Beispiel: Glitzer, Filz, Garn und Knöpfe -- seine Küche sah aus als wäre ein Clown in ihr explodiert.
HTML: wird übersetzt zu en-dash (–
).
LaTeX: wird übersetzt zu --
.
Refs:
Markup: Dreifaches Minus.
Beispiel: Glitter, felt, yarn, and buttons---his kitchen looked as if a clown had exploded.
HTML: wird übersetzt zu em-dash (—
).
LaTeX: wird übersetzt zu ---
.
Refs:
Markup: Mit Unterstrichen (_) oder Asterisken (*) umgeben.
Beispiel: Hier ist _etwas_ kursiv geschrieben. Hier *noch etwas*.
Der markierte Textabschnitt wird kursiv dargestellt.
Refs:
Markup: Mit doppelten Unterstrichen (__) oder doppelten Asterisken (**) umgeben.
Beispiel: Hier ist __etwas__ fett gedruckt. Hier **noch etwas**.
Der markierte Textabschnitt wird fett dargestellt.
Refs:
Markup: Drei normale Punkte.
Beispiel: Das ist... ähm... doof.
HTML: wird übersetzt zu …
.
LaTeX: wird übersetzt zu \dots
.
Refs:
Markup: Eckige Klammern.
Beispiel: Das ist das WortNachDemDieFußNoteKommt[Die Fußnote].
Markup: Doppelte runde Klammern
Derart markierter Text wird im Entwurfsmodus (outputMode = "draft"
) mit geschlängelter Linie unterstrichen.
Beispiel: ((Dieser Text ist überarbeitungswürdig))
Markup: Doppelte geschweifte Klammern
Derart markierter Text wird im Entwurfsmodus (outputMode = "draft"
) als Kommentarzeile eingefügt.
Beispiel: {{Hier könnte ihre Werbung stehen.}}
Markup: Doppelte eckige Klammern
Derart markierter Text wird im Entwurfsmodus (outputMode = "draft"
) als Randnotiz dargestellt und sonst ausgeblendet.
Beispiel: Ihr Name war Thorsten[[Überlegen, ob Thorsten wirklich ein geeigneter Name ist.]]
Es kann nützlich sein, die verschiedene Kommentare zu kombinieren.
Beispiel: ((Dieser Text ist sehr sehr ultra mega schlecht))[[Leicht übertrieben? Überflüssige Adverben streichen.]].
Markup: ![altText](Bildpfad "optionaler Titel")
Auf diese Weise können Bilder integriert werden, die am angegebenen Pfad liegen. Der optionale Titel wird zu einer Bildunterschrift. Der altText dient im HTML als Alternative, falls das Bild nicht dargestellt wird, und für Screen Reader. Im LaTeX wird diese Angabe ignoriert.
Beispiel: ![Alternativtext](/path/to/img.jpg "optional title")
Markup: Backslash gefolgt vom Sonderzeichen ('\Sonderzeichen
')
In HTML, LaTeX und dem hier verwendeten Markup sind bestimmte Symbole als Teil der Syntax reserviert. Sie müssen maskiert werden, um als das bloße Symbol interpretiert zu werden und als solches im generierten Text aufzutauchen.
Folgende Zeichen sind zu maskieren ('\
' voranstellen):
\
Backslash – das Maskierungszeichen selbst
*
Asterisk
_
Unterstrich
{}
Geschweifte Klammern
()
Klammern (nur bei doppelten, also '((' bzw. '))', da dies Kommentar-Unterstreichungen markiert)
[]
Eckige Klammern
#
Raute
"
Anführungszeichen / Double-Quote
!
Ausrufezeichen (nur nötig, wenn '[' folgt)
--
Doppel-Minus
$
Dollar
Folgende Zeichen können normal verwendet werden und werden automatisch in HTML- bzw. LaTeX-Schreibweise übertragen:
&
wird in HTML zu '&
', in LaTeX zu '\&
'
<
wird in HTML zu <
>
wird in HTML zu >
%
wird in LaTeX zu \%
~
wird in LaTeX zu \textasciitilde
^
wird in LaTeX zu \textasciicircum
Beispiel: Spitze <voll spitze> und eckige Klammern \[weil es so schön ist\].
Refs:
- https://www.w3.org/International/questions/qa-escapes.de#use
- https://www.namsu.de/Extra/strukturen/Sonderzeichen.html
Of course Python has to be installed.
filt0r.py
has the following additional requirements:
Install requirements before first usage:
pip install -r requirements.txt
The Conversion to HTML & LaTeX is done with filt0r.py
. filt0r.py
was tested with Python 2.7 and 3.4. One argument is expected: the path to the source document.
Example:
$ python filt0r.py doc.txt
[...]
15:13:17:977.0 INFO: Wrote UTF-8-encoded LaTeX source file: latex/latex-body.tex.
[...]
15:13:17:987.0 INFO: Wrote UTF-8-encoded HTML document: html/index.html.
Optional argument: the path to setup file (see below) if different from setup.toml
. Example:
python filt0r.py doc.txt toml.toml
filt0r.py
should be executed in the projects root directory. It writes the files latex/latex-document.tex
, latex/latex-body.tex
and html/index.html
relative to the current working directory.
In a setup file in TOML notation (default: setup.toml
) general settings and details for the target document can be specified.
[general]
title = "Title of text"
author = "Author of text"
language = "Language shortcode" #de, en, ... (https://en.wikipedia.org/wiki/ISO_639-1)
[latex]
pdfsubject = "Short description for PDF metadata"
pdfkeywords = "A sequence of keywords for PDF metadata separated by commas"
[html]
locale = "Locale" #de_DE, en_GB, ... #meta property og:locale
metadescription = "Description for HTML metadata" #meta description und meta property og:description
url = "URL of text" #meta property og:url
sitename = "Name of Site that hosts text" #meta property og:site_name
[general]
subtitle = "Subtitle of text"
outputMode = "Type of generated document" #draft, final, manuscript #default: final
#draft:
# comments are shown
# page format: A4
# font: TeX Gyre Cursor (~Courier)
# please note: this mode is still work in progress
#final:
# no comments
# output document as configured
#manuscript
# no comments
# page format: A4
# font: TeX Gyre Cursor (~Courier)
# please note: this mode is still work in progress
[latex]
pageFormat = "Page format" #a0 - a6, b0 - b6 #default: a5 #if set, pageWidth and pageHeight will be ignored
pageWidth = "Page width" #e.g. "210mm", "21.5cm"
pageHeight = "Page height" #e.g. "210mm", "21.5cm"
bindingOffset = "Binding offset"
font = "Name of the font (see section about fonts)"
fontSize = "Font size in pt" #e.g. 12.5 #default: 11
title = "Title of text" #default: general.title
subtitle = "Subtitle of text" #default: general.title
printAuthorOnTitle = "Author will be printed on title at document begin" #not relevant for bookPrint = "true" #default: false
halfTitle = "Half title" #Textcommand \\storyhalftitle #default: latex.title
isbn = "ISBN for this book" #Textcommand \\isbn
bookPrint = "Textlayout for book printing" #true, false #default: false
#true:
#document type = "scrbook"
#pages from latex/bookPreliminaries will be prepended to the text in alphanumerical order
#pages from latex/bookAppendix will be appended to the text in alphanumerical order
#false:
#document type = "scrreprt"
#at beginning of text title and subtitle will be printed
headerLeft = "Header left" #Textcommands can be used (see below) #default: "\\storytitle"
headerRight = "Header right" #Textcommands can be used (see below) #default: "\\storychapter"
tableOfContents = "Table of contents will be printed" #true, false #default: false
contentsTitle = "Title for table of contents"
tableOfContentsPagebreak = "Pagebreak after table of contents" #true, false #default: false
chapterPagebreak = "New Page at new chapter" #true, false #default: false
hideChapterHeader = "No header at new chapter" #true, false #default: self.chapterPagebreak
hascolorlinks = "Colored links" #default: "false"
urlcolor = "URL color" #default: "blue"
linkcolor = "Link color" #default: "black"
[html]
title = "Title of text" #if different from general.title
subtitle = "Subtitle of text" #if different from general.subtitle
headertitle = "Text for HTML Title" #default: "title | author"
previewimage = "Link for preview image (metadata)" #meta property og:image
[general]
title = "Kommt und holt sie"
#subtitle = ""
author = "Josa Wode"
language = "de" #de, en, ...
outputMode = "final"
[latex]
bookPrint = true #true, false #create document for book printing, allow preliminaries and appendix (directories: latex/bookPreliminaries and latex/bookAppendix)
#headerLeft = "" #define text for left header, you may use commands \\storytitle, \\storysubtitle, \\storyhalftitle, \\storyauthor, \\storychapter; default: \\storytitle
#headerRight = "" #define text for right header, you may use commands \\storytitle, \\storysubtitle, \\storyhalftitle, \\storyauthor, \\storychapter; default: \\storychapter
#hideChapterHeader = true #true, false #default: chapterPagebreak
chapterPagebreak = true #true, false #true: new chapter starts on new page
tableOfContents = true #true, false
#tableOfContentsPagebreak = true #true, false #true: after tableOfContents a new page is started
contentsTitle = "Inhalt" #if specified this is used as title for the table of contents
isbn = "978-3-7460-9728-2"
pageFormat = "a5" # a0 - a6, b0 - b6 # define page size
#pageWidth = "210" # in mm # only when not using pageFormat
#pageHeight = "297" # in mm # only when not using pageFormat
bindingOffset = "15mm" #part of the page that is lost in binding
font = "gentium"
fontSize = "11" # e.g. 11 12.5 # in pt
printAuthorOnTitle = false #true, false #determines if title page begins with author name
#title = "" #comment out if same as general.title
subtitle = "Eine Geschichte von Josa Wode" #comment out if same as general.subtitle
#halfTitle = "" #half title for book printing #comment out if same as title
pdfsubject = "Geschichte"
pdfkeywords = "geschichte, alte, josa, wode"
hascolorlinks = "true"
urlcolor = "blue"
linkcolor = "black"
[html]
#title = "" #comment out if same as general.title
#subtitle = "" #comment out if same as general.subtitle
headertitle = "Kommt und holt sie | eine Geschichte von Josa Wode"
url = "http://writing.fotoelectrics.de/documents/come-get-her/de/html/" #meta property og:url
metadescription = "Eine kurze Geschichte von Josa Wode - Es könnte ein Märchen sein, wenn es sich benehmen würde. (Lizenz: Creative Commons BY-NC-SA 3.0)" #meta description and meta property og:description
locale = "de_DE" #de_DE, en_GB, ... #meta property og:locale
sitename = "writing.fotoelectrics" #meta property og:site_name
#previewimage = "" #meta property og:image #comment out for no image tag
For usage in (aditional) LaTeX documents (see below) and some setup entries (see above) the following commands can be used (additional to the usual LaTeX commands):
\storytitle
print title\storysubtitle
print subtitle\storyhalftitle
print half title\storyauthor
print author\storychapter
print current chapter\isbn
print ISBN\printtitle
print formated title, with subtitle (if any) and when setup optionprintAuthorOnTitle
is set also the author
For usage in setup TOML \
has to be prepended to the command as escape character (e.g. \\storytitle
).
A whole lot of LaTeX fonts is supported. That doesn't mean they are a good choice for your textstory.
For running text you should choose a font with serifs to improve readability. By default Gentium is selected as textstory font -- it looks good, is typographically high-end and thorougly tested in the field of textstories.
Up to now only the main font can be configured.
For draft and manuscript mode TeX Gyre Cursor, kind of Courier, is set to conform to the standard.
The font for license text is Cabin.
- Alegreya
- Artemisia: see GFS Artemisia
- Baskerville: see Libre Baskerville
- Bonum, Bookman: see TeX Gyre Bonum
- Caladea
- Cochineal
- Computer Modern: see Latin Modern Roman
- DejaVu Serif
- DejaVu Serif Condensed
- Droid Serif
- fbb
- Free Serif, Freefont Serif: see GNU Freefont Serif
- Gentium: see Gentium Plus
- Gentium Plus (as bold font Gentium Basic is used, because Gentium Plus bold is not complete)
- GFS Artemisia
- GFS Bodoni
- GNU Freefont Serif
- Gyre Bonum: see TeX Gyre Bonum
- Gyre Pagella: see TeX Gyre Pagella
- Gyre Schola: see TeX Gyre Schola
- Gyre Termes: see TeX Gyre Termes
- Heuristica
- IM Fell English
- Junicode
- Kerkis: see TeX Gyre Bonum
- Latin Modern Roman
- Libre Baskerville
- Libre Bodoni
- Merriweather
- Merriweather Light
- New PX: see TeX Gyre Pagella
- New TX, Nimbus Roman: see TeX Gyre Termes
- Old Standard
- Pagella, Palladio: see TeX Gyre Pagella
- Playfair Display
- PX Fonts: see TeX Gyre Pagella
- Quattrocento
- Roboto Slab
- Roboto Slab Light
- Source Serif Pro Extra Light
- Source Serif Pro Light
- Source Serif Pro: see Source Serif Pro Regular
- Source Serif Pro Regular
- TeX Gyre Bonum
- TeX Gyre Pagella
- TeX Gyre Schola
- Termes: see TeX Gyre Termes
- TeX Gyre Termes
- TX Fonts: see TeX Gyre Termes
- Schola, Schoolbook, Schoolbook L: see TeX Gyre Schola
- URW Bookman, URW Bookman L: see TeX Gyre Bonum
- URW Nimbus Roman: see TeX Gyre Termes
- URW Palladio: see TeX Gyre Pagella
- URW Schoolbook, URW Schoolbook L: see TeX Gyre Schola
- XCharter
- XITS
- Courier: see TeX Gyre Cursor
- Deja Vu Sans Mono
- Fira Mono
- Latin Modern Mono
- Latin Modern Mono Light
- Source Code Pro
- TeX Gyre Cursor
- Adventor: see TeX Gyre Adventor
- Cabin
- Cabin Condensed
- Carlito
- Clear Sans
- Computer Modern Sans Serif: see Latin Modern Sans
- Cyklop
- DejaVu Sans
- DejaVu Sans Condensed
- Droid Sans
- Fira Sans Book
- Fira Sans Extra Light
- Fira Sans Light
- Fira Sans: see Fira Sans Regular
- Fira Sans Regular
- Fira Sans Thin
- Fira Sans Ultra Light
- Freefont Sans, Free Sans: see GNU Freefont Sans
- GFS Neohellenic
- GNU Freefont Sans
- Gyre Adventor: see TeX Gyre Adventor
- Gyre Heros: see TeX Gyre Heros
- Heros: see TeX Gyre Heros
- Iwona
- Iwona Light
- Kurier
- Kurier Light
- Latin Modern Sans
- Lato
- Merriweather Sans
- Merriweather Sans Light
- Mintspirit
- Neohellenic: see GFS Neohellenic
- Open Sans
- Overlock
- Quattrocento Sans
- Raleway
- Roboto
- Roboto Condensed
- Roboto Light
- Source Sans Pro
- TeX Gyre Adventor
- TeX Gyre Heros
- URW Nimbus Sans: see TeX Gyre Heros
- URW Gothic: see TeX Gyre Adventor
At file path latex/license.tex
a license can be provided (as valid LaTeX document). If this file is missing, no license will be appended to the document.
Directory for license templates: latex/templates/licenses
With setup option bookPrint
set to true
LaTeX documents for preliminary pages and appendix pages can be put in designated directories.
Files in those directories will be added to the document in alphanumerical order.
Directory for preliminaries: latex/bookPreliminaries
Directory for appendix: latex/bookAppendix
Templates can be found in latex/templates
.
In the projects latex
directory latex-document.tex
has to be compiled with lualatex
(for correct creation of table of contents this has to be done twice). build.bat
is a helper for Windows, ./build.bash
can be used on Linux systems.
$ build.bat
[...]
Output written on latex-document.pdf (35 pages, 115586 bytes).
Transcript written on latex-document.log.
Compilation was tested with TeX Live 2015's lualatex
.
At file path html/license.tpl.html
a license can be provided (as valid HTML without header and body). The corresponding CSS stylesheet can be found at html/css/license-styles.css
.
For license and license CSS templates can be found in html/templates/licenses
.
An UTF-8 encoded document is expected.
Markup: newline
Example:
This is the first paragraph.
Here the second one begins.
Markup: two newlines resp. blank line
Example: `Here is the text of first section.
Here a new section begins.`
Markup: double hash at line beginning
Example: ## Chapter 1
A line marked this way will be formated as a headline (and interpreted as beginning of a chapter).
Markup: Simple double quote pairs.
Example: She said: "Oh shit!"
In output French quotes will be printed.
Refs:
Markup: Simple minus.
Example: man-eating shark
Copied to HTML and LaTeX code as is.
Refs:
Markup: Double minus.
Example: Glitzer, Filz, Garn und Knöpfe -- seine Küche sah aus als wäre ein Clown in ihr explodiert.
HTML: will be translated to en-dash (–
).
LaTeX: still --
.
Refs:
Markup: Triple minus.
Example: Glitter, felt, yarn, and buttons---his kitchen looked as if a clown had exploded.
HTML: translated to em-dash (—
).
LaTeX: still ---
.
Refs:
Markup: Surround with underscores (_) or asterisks (*).
Example: _This_ is *italic*.
The marked text will be printed in italics.
Refs:
Markup: Surround with double underscores (__) or double asterisks (**).
Example: __This__ is **bold**.
The marked text will be printed in bold font.
Refs:
Markup: Three normal dots.
Example: That is... ahem... crap.
HTML: …
.
LaTeX: \dots
.
Refs:
Markup: Square brackets.
Example: This is the word-after-which-the-footnote-appears[The footnote].
Markup: Double round brackets.
Text marked like this will be underlined with a wiggly line in draft.
Example: ((This text may need rework))
Markup: Double curly brackets.
Text marked like this will be shown as inline comment in draft and is hidden otherwise.
Example: {{Has anyone left an umbrella here?}}
Markup: Double square bracktes.
Text marked like this will be shown as a sidenote in draft and is hidden otherwise.
Example: Her name was Thorsten[[Think about it. Is this really a good name for her?]]
You may want to combine both comment types.
Example: ((This text is very very ultra mega bad))[[Too much? Remove some adverbs.]].
Markup: ![altText](Image path "optional title")
This way images at the given image path can be added. The optional title is used as an image caption. altText is shown in HTML when image cannot be displayed and used by screen readers. In LaTeX altText will be ignored.
Example: ![Alternative text](/path/to/img.jpg "optional title")
Markup: Backslash followed by special character ('\specialchar
')
In HTML, LaTeX and our markup certain symbols are reserved as parts of the syntax. They have to be masked to be interpreted as the simple symbol and to be shown as such in the generated output text.
The following characters have to be escaped (prepend '\
'):
\
backslash – the escape character itself
*
asterisk
_
underscore
{}
curly brackets
()
normal brackets (only if used in double, like '((' or '))', because this marks commentary underlining)
[]
square brackets
#
hash
"
double quote
!
exclamation mark (only when followed by '[')
--
double minus
$
dollar
The following characters can be used as normal and will automatically be translated in HTML and LaTeX representation:
&
in HTML becomes '&
', in LaTeX '\&
'
<
in HTML becomes <
>
in HTML becomes >
%
in LaTeX becomes \%
~
in LaTeX becomes \textasciitilde
^
in LaTeX becomes \textasciicircum
Example: Angle brackets <very angular> and square brackets \[because it's square\].
Refs: