diff --git a/README.md b/README.md index cc186bd..7d79c17 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,8 @@ Before you can make use of the template you need to move the LaTeX template file into Pandocs template directory: ``` -mkdir ~/.pandoc -mv your-repo-path/letter.latex ~/.pandoc/templates +mkdir -p ~/.pandoc/templates +mv your-repo-path/letter.latex ~/.pandoc/templates/ ``` After creating a letter written in Markdown you can compile it into PDF with the @@ -83,3 +83,6 @@ The following yaml variables are supported: - `subject` - `return-address` - `address` + +If you want to add some options to the `scrlttr2` document class, you can list +them via the `letteroption` yaml variable. diff --git a/letter.latex b/letter.latex index 6d92c88..2372f3d 100644 --- a/letter.latex +++ b/letter.latex @@ -2,10 +2,13 @@ foldmarks=true, % print foldmarks foldmarks=BTm, % show foldmarks top, middle, bottom fromalign=right, % letter head on the right - fromphone, % show phone number - fromemail, % show email - fromlogo, % show logo in letter head - version=last % latest version of KOMA letter +$if(phone)$ fromphone,$endif$ % show phone number +$if(email)$ fromemail,$endif$ % show email +$if(fromlogo)$ fromlogo,$endif$ % show logo in letter head + version=last, % latest version of KOMA letter +$for(letteroption)$ + $letteroption$$sep$, +$endfor$ ]{scrlttr2} \usepackage[ngerman]{babel} @@ -14,6 +17,8 @@ \usepackage{parskip} +\usepackage{csquotes} % German quotation marks + \usepackage{graphics} \usepackage{booktabs} @@ -21,6 +26,9 @@ \usepackage[right]{eurosym} +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} + \makeatletter \setlength{\@tempskipa}{-1.2cm}% \@addtoplength{toaddrheight}{\@tempskipa} @@ -42,16 +50,15 @@ \setkomavar{fromemail}{$email$} \setkomavar{signature}{$author$} - \setkomavar{date}{$date$} + $if(date)$\setkomavar{date}{$date$}$endif$ \setkomavar{place}{$place$} - \setkomavar{subject}{$subject$} + $if(subject)$\setkomavar{subject}{$subject$}$endif$ \begin{letter}{% $for(address)$ $address$$sep$\\ - $endfor$ - } + $endfor$} \opening{$opening$} @@ -59,7 +66,7 @@ \closing{$closing$} - \ps $ps$ + $if(ps)$\ps $ps$$endif$ $if(encludes)$ \setkomavar*{enclseparator}{Anlage}