Skip to content

Commit

Permalink
Merge pull request benedictdudel#8 from ascherer/optionalize-variables
Browse files Browse the repository at this point in the history
Optionalize some variables and class options
  • Loading branch information
benedictdudel authored Dec 19, 2022
2 parents 9a5ad25 + de881bd commit 7b4b61e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,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.
20 changes: 11 additions & 9 deletions letter.latex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -47,24 +50,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(postskriptum)$\ps $postskriptum$$endif$

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

0 comments on commit 7b4b61e

Please sign in to comment.