Skip to content

Commit df4f5b1

Browse files
authored
support both cover images (#26)
This adds a new "template" parameter that can go into the front matter YAML. It can be either "greentop" or "bluetop"
1 parent 7bbf7f6 commit df4f5b1

File tree

4 files changed

+12
-28
lines changed

4 files changed

+12
-28
lines changed

img/bluetop.png

48 KB
Loading
File renamed without changes.

sample2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ date: 8/11/2022
77
year: 2022
88
type: SPECIFICATION
99
status: PUBLISHED
10+
template: bluetop
1011
...
1112

1213
\newpage

template/eisvogel.latex

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -590,9 +590,7 @@ $endif$
590590
$if(titlepage)$
591591
\usepackage{pagecolor}
592592
\usepackage{afterpage}
593-
$if(titlepage-background)$
594593
\usepackage{tikz}
595-
$endif$
596594
$if(geometry)$
597595
$else$
598596
\usepackage[margin=0.5in]{geometry}
@@ -996,6 +994,16 @@ $endif$
996994
beforeskip=.5\baselineskip,
997995
afterskip=0em]{subparagraph}
998996

997+
\newcommand{\coverbg}{/resources/img/greentop.png}
998+
999+
$if(template)$
1000+
\ifthenelse{\equal{\detokenize{$template$}}{\detokenize{bluetop}}}
1001+
{
1002+
\renewcommand{\coverbg}{/resources/img/bluetop.png}
1003+
}
1004+
{}
1005+
$endif$
1006+
9991007
\begin{document}
10001008

10011009
%%
@@ -1005,18 +1013,12 @@ $if(beamer)$
10051013
$else$
10061014
$if(titlepage)$
10071015
\begin{titlepage}
1008-
$if(titlepage-background)$
10091016
\newgeometry{top=2cm, right=4cm, bottom=3cm, left=4cm}
1010-
$else$
1011-
\newgeometry{left=6cm}
1012-
$endif$
10131017
$if(titlepage-color)$
10141018
\definecolor{titlepage-color}{HTML}{$titlepage-color$}
10151019
\newpagecolor{titlepage-color}\afterpage{\restorepagecolor}
10161020
$endif$
1017-
$if(titlepage-background)$
1018-
\tikz[remember picture,overlay] \node[inner sep=0pt] at (current page.center){\includegraphics[width=8.8in,height=11in]{$titlepage-background$}};
1019-
$endif$
1021+
\tikz[remember picture,overlay] \node[inner sep=0pt] at (current page.center){\includegraphics[width=8.8in,height=11in]{\coverbg}};
10201022
\newcommand{\colorRule}[3][black]{\textcolor[HTML]{#1}{\rule{#2}{#3}}}
10211023
\begin{flushleft}
10221024
\noindent
@@ -1035,7 +1037,6 @@ $if(logo)$
10351037
}
10361038
$endif$
10371039

1038-
$if(titlepage-background)$
10391040
% The titlepage with a background image has other text spacing and text size
10401041
{
10411042
\begin{textblock*}{10.5cm}(7cm,11cm)
@@ -1073,25 +1074,7 @@ $if(titlepage-background)$
10731074
\end{textblock*}
10741075

10751076
}
1076-
$else$
1077-
{
1078-
\setstretch{1.4}
1079-
\vfill
1080-
\noindent {\huge \textbf{\textsf{$title$}}}
1081-
$if(subtitle)$
1082-
\vskip 1em
1083-
{\Large \textsf{$subtitle$}}
1084-
$endif$
1085-
\vskip 2em
1086-
\noindent {\Large \textsf{$for(author)$$author$$sep$, $endfor$}}
1087-
\vfill
1088-
}
1089-
$endif$
10901077

1091-
$if(titlepage-background)$
1092-
$else$
1093-
\textsf{$date$}
1094-
$endif$
10951078
\end{flushleft}
10961079
\end{titlepage}
10971080
\restoregeometry

0 commit comments

Comments
 (0)