Skip to content

Commit

Permalink
Merge branch 'master' into enclosure
Browse files Browse the repository at this point in the history
  • Loading branch information
benedictdudel authored Dec 19, 2022
2 parents fea0fa5 + 8868b95 commit 31f2668
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ address:
opening: Sehr geehrte Damen und Herren,
closing: Mit freundlichen Grüßen
enclosed: Muster, Muster, Muster
ps: |
\textbf{Postskriptum \today}

Noch ein Gedanke zum Schluss.
...
```

Expand All @@ -54,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
Expand All @@ -71,10 +75,14 @@ The following yaml variables are supported:
- `opening`
- `closing`
- `enclosed`
- `ps`
- `author`
- `phone`
- `email`
- `place`
- `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.
4 changes: 4 additions & 0 deletions example/letter.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ address:
opening: Sehr geehrte Damen und Herren,
closing: Mit freundlichen Grüßen
enclosed: Muster, Muster, Muster
ps: |
\textbf{Postskriptum \today}
Noch ein Gedanke zum Schluss.
...
Far far away, behind the word mountains, far from the countries
Vokalia and Consonantia, there live the blind texts. Separated
Expand Down
25 changes: 15 additions & 10 deletions letter.latex
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@
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}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{parskip}
\usepackage{csquotes} % German quotation marks

\usepackage{graphics}

Expand All @@ -21,6 +24,9 @@

\usepackage[right]{eurosym}

\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

\makeatletter
\setlength{\@tempskipa}{-1.2cm}%
\@addtoplength{toaddrheight}{\@tempskipa}
Expand All @@ -42,24 +48,23 @@
\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$}

$body$

\closing{$closing$}

\ps $postskriptum$
$if(ps)$\ps $ps$$endif$

$if(enclosed)$
\setkomavar*{enclseparator}{Anlage}
Expand Down

0 comments on commit 31f2668

Please sign in to comment.