Work on pandoc templates

This commit is contained in:
Jonathan Hodgson 2017-07-26 23:35:53 +01:00
parent e71f82b1b1
commit d3a2fb983b
2 changed files with 354 additions and 30 deletions

View file

@ -1,5 +1,4 @@
\documentclass[$if(fontsize)$$fontsize$$else$12pt$endif$,stdletter,orderfromtodate,sigleft,$if(papersize)$$papersize$$else$a4$endif$paper,dateleft,addrfromemail,addrfromphone]{newlfm}
\documentclass[$if(fontsize)$$fontsize$$else$12pt$endif$,$if(papersize)$$papersize$$else$a4$endif$paper,$for(classoption)$$classoption$$sep$,$endfor$]{letter}
$if(fontfamily)$
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$else$
@ -11,6 +10,7 @@ $if(linestretch)$
$endif$
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
\usepackage[utf8]{inputenc}
@ -54,9 +54,15 @@ $endif$
\usepackage{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
$if(geometry)$
\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
$endif$
\usepackage{geometry}
\geometry{
paper=$if(papersize)$$papersize$$else$a4$endif$paper, % Change to letterpaper for US letter
top=2cm, % Top margin
bottom=1.5cm, % Bottom margin
left=2.5cm, % Left margin
right=2.5cm, % Right margin
%showframe, % Uncomment to show how the type block is set on the page
}
\usepackage[unicode=true]{hyperref}
$if(colorlinks)$
\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
@ -182,40 +188,44 @@ $endif$
\def\fps@figure{htbp}
\makeatother
$if(signature)$
\usepackage{graphicx,grffile}
\signature{$if(signature-before)$\vspace*{$signature-before$}$endif$\includegraphics{$signature$}$if(author)$\\$if(signature-after)$\vspace*{$signature-after$}$endif$$for(author)$$author$$sep$\\$endfor$$endif$}
$else$
$if(author)$
\signature{$for(author)$$author$$sep$\\$endfor$}
$else$
\signature{Jonathan Hodgson}
$endif$
$endif$
$if(date)$
\date{$date$}
$else$
\date{\today}
$endif$
\newlfmP{dateskipbefore=20pt}
\newlfmP{sigsize=20pt}
\newlfmP{sigskipbefore=50pt}
\newlfmP{Headlinewd=0pt,Footlinewd=0pt}
\namefrom{$if(from-name)$$from-name$$else$Jonathan Hodgson$endif$}
\addrfrom{$if(return-address)$$for(return-address)$$return-address$$sep$\\$endfor$$else$***REMOVED***$endif$}
\phonefrom{$if(phone-from)$$phone-from$$else$***REMOVED***$endif$}
\emailfrom{$if(email-from)$$email-from$$else$jonathan@lunarweb.co.uk$endif$}
\nameto{$if(to-name)$$to-name$$else$Please enter a name for the top line of the to address in the variable to-name$endif$}
\addrto{$if(to-address)$$for(to-address)$$to-address$$sep$\\$endfor$$else$Add a to address in variable to-address$endif$ }
$if(email)$
$if(subject)$
\regarding{$subject$}
\newcommand{\email}{\href{mailto:$email$?subject=Re: $subject$}{$email$}}
$else$
\newcommand{\email}{\href{mailto:$email$}{$email$}}
$endif$
$else$
$if(subject)$
\newcommand{\email}{\href{mailto:jonathan@lunarweb.co.uk?subject=Re: $subject$}{jonathan@lunarweb.co.uk}}
$else$
\newcommand{\email}{\href{mailto:jonathan@lunarweb.co.uk}{jonathan@lunarweb.co.uk}}
$endif$
$endif$
\greetto{$if(greeting)$$greeting$$else$Dear Sir or Madam$endif$}
\closeline{$if(closeline)$$closeline$$else$Yours Faithfully$endif$}
$for(header-includes)$
$header-includes$
$endfor$
$if(return-address)$
\address{$for(return-address)$$return-address$$sep$\\$endfor$}
$else$
\address{***REMOVED***, ***REMOVED***,\\***REMOVED***,\\***REMOVED***,\\***REMOVED***,\\ ***REMOVED*** \\ Tel: \href{tel:***REMOVED***}{***REMOVED***} \\ Email: \email}
$endif$
$if(blockquote)$
\usepackage{mdframed} % color is loaded by mdframed
@ -231,6 +241,7 @@ $if(letterhead)$
\usepackage{wallpaper}
\ThisULCornerWallPaper{1}{$letterhead$}
$endif$
\usepackage{blindtext}
\begin{document}
@ -247,13 +258,47 @@ $endif$
\tableofcontents
}
$endif$
$if(address)$
\begin{letter}{$for(address)$$address$$sep$\\$endfor$}
$else$
\begin{letter}{You need to specify address}
$endif$
\begin{newlfm}
$if(opening)$
\opening{$opening$}
$else$
\opening{Dear Sir or Madam}
$endif$
$if(subject)$
\vspace{0.5cm}
{\large\bf Re: $subject$}
\vspace{0.5cm}
$endif$
$body$
$if(closing-indentation)$
\longindentation=$closing-indentation$
$else$
\longindentation=1cm
$endif$
$if(closing)$
\closing{$closing$}
$else$
\closing{Yours faithfully,}
$endif$
$if(encl)$
\encl{$for(encl)$$encl$$sep$\\$endfor$}
$endif$
$if(cc)$
\cc{$for(cc)$$cc$$sep$\\$endfor$}
$endif$
$if(ps)$
\ps{$ps$}
$endif$
\end{newlfm}
\end{letter}
$if(natbib)$
$if(bibliography)$