From 774c5e7897bd36f3f4ab5accb149e592550633b8 Mon Sep 17 00:00:00 2001 From: Kai <37978933+froeb@users.noreply.github.com> Date: Mon, 20 May 2024 03:20:51 +0100 Subject: [PATCH 1/9] Update eisvogel.tex his PR introduces several enhancements to the Eisvogel LaTeX template: - **Custom Styling:** Added custom colors for headings, captions, blockquotes, and listings. - **New Commands:** Added \customheading and \customcaption for flexible text styling. - **Title Page and Background:** Added support for custom background images on the title page and all pages. - **Layout Improvements:** Enhanced handling of paragraph and list spacing for better readability. ### Detailed Changes - **LaTeX Template (eisvogel.latex):** - Defined new color variables for consistent styling. - Added commands for custom headings and captions. - Enhanced layout options for title pages. - Improved spacing and formatting for paragraphs and lists. --- eisvogel.tex | 629 ++++++++------------------------------------------- 1 file changed, 89 insertions(+), 540 deletions(-) diff --git a/eisvogel.tex b/eisvogel.tex index 109cb83..c2a7477 100644 --- a/eisvogel.tex +++ b/eisvogel.tex @@ -407,127 +407,14 @@ $if(numbersections)$ $else$ \setcounter{secnumdepth}{-\maxdimen} % remove section numbering $endif$ -$if(subfigure)$ -\usepackage{subcaption} -$endif$ -$if(beamer)$ -$else$ -$if(block-headings)$ -% Make \paragraph and \subparagraph free-standing -\ifx\paragraph\undefined\else - \let\oldparagraph\paragraph - \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}} -\fi -\ifx\subparagraph\undefined\else - \let\oldsubparagraph\subparagraph - \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}} -\fi -$endif$ -$endif$ -$if(pagestyle)$ -\pagestyle{$pagestyle$} -$endif$ -$if(csl-refs)$ -% definitions for citeproc citations -\NewDocumentCommand\citeproctext{}{} -\NewDocumentCommand\citeproc{mm}{% - \begingroup\def\citeproctext{#2}\cite{#1}\endgroup} -\makeatletter - % allow citations to break across lines - \let\@cite@ofmt\@firstofone - % avoid brackets around text for \cite: - \def\@biblabel#1{} - \def\@cite#1#2{{#1\if@tempswa , #2\fi}} -\makeatother -\newlength{\cslhangindent} -\setlength{\cslhangindent}{1.5em} -\newlength{\csllabelwidth} -\setlength{\csllabelwidth}{3em} -\newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing - {\begin{list}{}{% - \setlength{\itemindent}{0pt} - \setlength{\leftmargin}{0pt} - \setlength{\parsep}{0pt} - % turn on hanging indent if param 1 is 1 - \ifodd #1 - \setlength{\leftmargin}{\cslhangindent} - \setlength{\itemindent}{-1\cslhangindent} - \fi - % set entry spacing - \setlength{\itemsep}{#2\baselineskip}}} - {\end{list}} -\usepackage{calc} -\newcommand{\CSLBlock}[1]{\hfill\break\parbox[t]{\linewidth}{\strut\ignorespaces#1\strut}} -\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{\strut#1\strut}} -\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}} -\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} -$endif$ -$if(lang)$ -\ifLuaTeX -\usepackage[bidi=basic]{babel} -\else -\usepackage[bidi=default]{babel} -\fi -$if(babel-lang)$ -\babelprovide[main,import]{$babel-lang$} -$if(mainfont)$ -\ifPDFTeX -\else -\babelfont{rm}[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} -\fi -$endif$ -$endif$ -$for(babel-otherlangs)$ -\babelprovide[import]{$babel-otherlangs$} -$endfor$ -$for(babelfonts/pairs)$ -\babelfont[$babelfonts.key$]{rm}{$babelfonts.value$} -$endfor$ -% get rid of language-specific shorthands (see #6817): -\let\LanguageShortHands\languageshorthands -\def\languageshorthands#1{} -$endif$ -$for(header-includes)$ -$header-includes$ -$endfor$ -\ifLuaTeX - \usepackage{selnolig} % disable illegal ligatures -\fi -$if(dir)$ -\ifPDFTeX - \TeXXeTstate=1 - \newcommand{\RL}[1]{\beginR #1\endR} - \newcommand{\LR}[1]{\beginL #1\endL} - \newenvironment{RTL}{\beginR}{\endR} - \newenvironment{LTR}{\beginL}{\endL} -\fi -$endif$ -$if(natbib)$ -\usepackage[$natbiboptions$]{natbib} -\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$} -$endif$ -$if(biblatex)$ -\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex} -$for(bibliography)$ -\addbibresource{$bibliography$} -$endfor$ -$endif$ -$if(nocite-ids)$ -\nocite{$for(nocite-ids)$$it$$sep$, $endfor$} -$endif$ -$if(csquotes)$ -\usepackage{csquotes} -$endif$ -\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} -\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available -\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$} -$if(links-as-notes)$ -% Make links footnotes instead of hotlinks: -\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} -$endif$ $if(verbatim-in-note)$ \VerbatimFootnotes % allow verbatim text in footnotes $endif$ +$if(links-as-notes)$ +% Make links footnotes instead of hotlinks: +\renewcommand{\href}[2]{#2\footnote{\url{#1}}} +$endif$ +\usepackage{hyperref} \hypersetup{ $if(title-meta)$ pdftitle={$title-meta$}, @@ -535,9 +422,6 @@ $endif$ $if(author-meta)$ pdfauthor={$author-meta$}, $endif$ -$if(lang)$ - pdflang={$lang$}, -$endif$ $if(subject)$ pdfsubject={$subject$}, $endif$ @@ -546,459 +430,124 @@ $if(keywords)$ $endif$ $if(colorlinks)$ colorlinks=true, - linkcolor={$if(linkcolor)$$linkcolor$$else$default-linkcolor$endif$}, - filecolor={$if(filecolor)$$filecolor$$else$default-filecolor$endif$}, - citecolor={$if(citecolor)$$citecolor$$else$default-citecolor$endif$}, - urlcolor={$if(urlcolor)$$urlcolor$$else$default-urlcolor$endif$}, + linkcolor=$if(linkcolor)$$linkcolor$$else$default-linkcolor$endif$, + filecolor=$if(filecolor)$$filecolor$$else$default-filecolor$endif$, + citecolor=$if(citecolor)$$citecolor$$else$default-citecolor$endif$, + urlcolor=$if(urlcolor)$$urlcolor$$else$default-urlcolor$endif$, $else$ hidelinks, $endif$ breaklinks=true, pdfcreator={LaTeX via pandoc with the Eisvogel template}} -$if(title)$ -\title{$title$$if(thanks)$\thanks{$thanks$}$endif$} +\urlstyle{same} % don't use monospace font for urls +$if(geometry)$ +$if(beamer)$ +\geometry{$for(geometry)$$geometry$$sep$,$endfor$} +$else$ +\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} $endif$ -$if(subtitle)$ +$else$ $if(beamer)$ $else$ -\usepackage{etoolbox} -\makeatletter -\providecommand{\subtitle}[1]{% add subtitle to \maketitle - \apptocmd{\@title}{\par {\large #1 \par}}{}{} -} -\makeatother -$endif$ -\subtitle{$subtitle$} -$endif$ -\author{$for(author)$$author$$sep$ \and $endfor$} -\date{$date$} -$if(beamer)$ -$if(institute)$ -\institute{$for(institute)$$institute$$sep$ \and $endfor$} -$endif$ -$if(titlegraphic)$ -\titlegraphic{\includegraphics{$titlegraphic$}} -$endif$ -$if(logo)$ -\logo{\includegraphics{$logo$}} +\usepackage[margin=2.5cm,includehead=true,includefoot=true,centering]{geometry} $endif$ $endif$ - - %% -%% added +%% begin titlepage %% - -$if(page-background)$ -\usepackage[pages=all]{background} -$endif$ - -% -% for the background color of the title page -% $if(titlepage)$ \usepackage{pagecolor} \usepackage{afterpage} $if(titlepage-background)$ \usepackage{tikz} $endif$ -$if(geometry)$ -$else$ -\usepackage[margin=2.5cm,includehead=true,includefoot=true,centering]{geometry} -$endif$ -$endif$ - -% -% break urls -% -\PassOptionsToPackage{hyphens}{url} - -% -% When using babel or polyglossia with biblatex, loading csquotes is recommended -% to ensure that quoted texts are typeset according to the rules of your main language. -% -\usepackage{csquotes} - -% -% captions -% -\definecolor{caption-color}{HTML}{777777} -$if(beamer)$ -$else$ -\usepackage[font={stretch=1.2}, textfont={color=caption-color}, position=top, skip=4mm, labelfont=bf, singlelinecheck=false, justification=$if(caption-justification)$$caption-justification$$else$raggedright$endif$]{caption} -\setcapindent{0em} -$endif$ - -% -% blockquote -% -\definecolor{blockquote-border}{RGB}{221,221,221} -\definecolor{blockquote-text}{RGB}{119,119,119} -\usepackage{mdframed} -\newmdenv[rightline=false,bottomline=false,topline=false,linewidth=3pt,linecolor=blockquote-border,skipabove=\parskip]{customblockquote} -\renewenvironment{quote}{\begin{customblockquote}\list{}{\rightmargin=0em\leftmargin=0em}% -\item\relax\color{blockquote-text}\ignorespaces}{\unskip\unskip\endlist\end{customblockquote}} - -% -% Source Sans Pro as the default font family -% Source Code Pro for monospace text -% -% 'default' option sets the default -% font family to Source Sans Pro, not \sfdefault. -% -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex - $if(fontfamily)$ - $else$ - \usepackage[default]{sourcesanspro} - \usepackage{sourcecodepro} - $endif$ -\else % if not pdftex - $if(mainfont)$ - $else$ - \usepackage[default]{sourcesanspro} - \usepackage{sourcecodepro} - - % XeLaTeX specific adjustments for straight quotes: https://tex.stackexchange.com/a/354887 - % This issue is already fixed (see https://github.com/silkeh/latex-sourcecodepro/pull/5) but the - % fix is still unreleased. - % TODO: Remove this workaround when the new version of sourcecodepro is released on CTAN. - \ifxetex - \makeatletter - \defaultfontfeatures[\ttfamily] - { Numbers = \sourcecodepro@figurestyle, - Scale = \SourceCodePro@scale, - Extension = .otf } - \setmonofont - [ UprightFont = *-\sourcecodepro@regstyle, - ItalicFont = *-\sourcecodepro@regstyle It, - BoldFont = *-\sourcecodepro@boldstyle, - BoldItalicFont = *-\sourcecodepro@boldstyle It ] - {SourceCodePro} - \makeatother - \fi - $endif$ -\fi - -% -% heading color -% -\definecolor{heading-color}{RGB}{40,40,40} -$if(beamer)$ -$else$ -\addtokomafont{section}{\color{heading-color}} -$endif$ -% When using the classes report, scrreprt, book, -% scrbook or memoir, uncomment the following line. -%\addtokomafont{chapter}{\color{heading-color}} - -% -% variables for title, author and date -% -$if(beamer)$ -$else$ -\usepackage{titling} -\title{$title$} -\author{$for(author)$$author$$sep$, $endfor$} -\date{$date$} -$endif$ - -% -% tables -% -$if(tables)$ - -\definecolor{table-row-color}{HTML}{F5F5F5} -\definecolor{table-rule-color}{HTML}{999999} - -%\arrayrulecolor{black!40} -\arrayrulecolor{table-rule-color} % color of \toprule, \midrule, \bottomrule -\setlength\heavyrulewidth{0.3ex} % thickness of \toprule, \bottomrule -\renewcommand{\arraystretch}{1.3} % spacing (padding) - -$if(table-use-row-colors)$ -% Unfortunately the colored cells extend beyond the edge of the -% table because pandoc uses @-expressions (@{}) like so: -% -% \begin{longtable}[]{@{}ll@{}} -% \end{longtable} -% -% https://en.wikibooks.org/wiki/LaTeX/Tables#.40-expressions -\usepackage{etoolbox} -\AtBeginEnvironment{longtable}{\rowcolors{2}{}{table-row-color!100}} -\preto{\toprule}{\hiderowcolors}{}{} -\appto{\endhead}{\showrowcolors}{}{} -\appto{\endfirsthead}{\showrowcolors}{}{} -$endif$ -$endif$ - -% -% remove paragraph indentation -% -\setlength{\parindent}{0pt} -\setlength{\parskip}{6pt plus 2pt minus 1pt} -\setlength{\emergencystretch}{3em} % prevent overfull lines - -% -% -% Listings -% -% - -$if(listings)$ - -% -% general listing colors -% -\definecolor{listing-background}{HTML}{F7F7F7} -\definecolor{listing-rule}{HTML}{B3B2B3} -\definecolor{listing-numbers}{HTML}{B3B2B3} -\definecolor{listing-text-color}{HTML}{000000} -\definecolor{listing-keyword}{HTML}{435489} -\definecolor{listing-keyword-2}{HTML}{1284CA} % additional keywords -\definecolor{listing-keyword-3}{HTML}{9137CB} % additional keywords -\definecolor{listing-identifier}{HTML}{435489} -\definecolor{listing-string}{HTML}{00999A} -\definecolor{listing-comment}{HTML}{8E8E8E} - -\lstdefinestyle{eisvogel_listing_style}{ - language = java, -$if(listings-disable-line-numbers)$ - xleftmargin = 0.6em, - framexleftmargin = 0.4em, -$else$ - numbers = left, - xleftmargin = 2.7em, - framexleftmargin = 2.5em, -$endif$ - backgroundcolor = \color{listing-background}, - basicstyle = \color{listing-text-color}\linespread{1.0}% - \lst@ifdisplaystyle% - $if(code-block-font-size)$$code-block-font-size$$else$\small$endif$% - \fi\ttfamily{}, - breaklines = true, - frame = single, - framesep = 0.19em, - rulecolor = \color{listing-rule}, - frameround = ffff, - tabsize = 4, - numberstyle = \color{listing-numbers}, - aboveskip = 1.0em, - belowskip = 0.1em, - abovecaptionskip = 0em, - belowcaptionskip = 1.0em, - keywordstyle = {\color{listing-keyword}\bfseries}, - keywordstyle = {[2]\color{listing-keyword-2}\bfseries}, - keywordstyle = {[3]\color{listing-keyword-3}\bfseries\itshape}, - sensitive = true, - identifierstyle = \color{listing-identifier}, - commentstyle = \color{listing-comment}, - stringstyle = \color{listing-string}, - showstringspaces = false, - escapeinside = {/*@}{@*/}, % Allow LaTeX inside these special comments - literate = - {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 - {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 - {à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 - {À}{{\`A}}1 {È}{{\`E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 - {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 - {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 - {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1 - {Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1 - {œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1 - {ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 {å}{{\r a}}1 {Å}{{\r A}}1 - {€}{{\EUR}}1 {£}{{\pounds}}1 {«}{{\guillemotleft}}1 - {»}{{\guillemotright}}1 {ñ}{{\~n}}1 {Ñ}{{\~N}}1 {¿}{{?`}}1 - {…}{{\ldots}}1 {≥}{{>=}}1 {≤}{{<=}}1 {„}{{\glqq}}1 {“}{{\grqq}}1 - {”}{{''}}1 -} -\lstset{style=eisvogel_listing_style} - -% -% Java (Java SE 12, 2019-06-22) -% -\lstdefinelanguage{Java}{ - morekeywords={ - % normal keywords (without data types) - abstract,assert,break,case,catch,class,continue,default, - do,else,enum,exports,extends,final,finally,for,if,implements, - import,instanceof,interface,module,native,new,package,private, - protected,public,requires,return,static,strictfp,super,switch, - synchronized,this,throw,throws,transient,try,volatile,while, - % var is an identifier - var - }, - morekeywords={[2] % data types - % primitive data types - boolean,byte,char,double,float,int,long,short, - % String - String, - % primitive wrapper types - Boolean,Byte,Character,Double,Float,Integer,Long,Short - % number types - Number,AtomicInteger,AtomicLong,BigDecimal,BigInteger,DoubleAccumulator,DoubleAdder,LongAccumulator,LongAdder,Short, - % other - Object,Void,void - }, - morekeywords={[3] % literals - % reserved words for literal values - null,true,false, - }, - sensitive, - morecomment = [l]//, - morecomment = [s]{/*}{*/}, - morecomment = [s]{/**}{*/}, - morestring = [b]", - morestring = [b]', -} - -\lstdefinelanguage{XML}{ - morestring = [b]", - moredelim = [s][\bfseries\color{listing-keyword}]{<}{\ }, - moredelim = [s][\bfseries\color{listing-keyword}]{}, - moredelim = [l][\bfseries\color{listing-keyword}]{/>}, - moredelim = [l][\bfseries\color{listing-keyword}]{>}, - morecomment = [s]{}, - morecomment = [s]{}, - commentstyle = \color{listing-comment}, - stringstyle = \color{listing-string}, - identifierstyle = \color{listing-identifier} -} -$endif$ - -% -% header and footer -% -$if(beamer)$ -$else$ -$if(disable-header-and-footer)$ -$else$ -\usepackage[headsepline,footsepline]{scrlayer-scrpage} - -\newpairofpagestyles{eisvogel-header-footer}{ - \clearpairofpagestyles - \ihead*{$if(header-left)$$header-left$$else$$title$$endif$} - \chead*{$if(header-center)$$header-center$$else$$endif$} - \ohead*{$if(header-right)$$header-right$$else$$date$$endif$} - \ifoot*{$if(footer-left)$$footer-left$$else$$for(author)$$author$$sep$, $endfor$$endif$} - \cfoot*{$if(footer-center)$$footer-center$$else$$endif$} - \ofoot*{$if(footer-right)$$footer-right$$else$\thepage$endif$} - \addtokomafont{pageheadfoot}{\upshape} -} -\pagestyle{eisvogel-header-footer} - -$if(book)$ -\deftripstyle{ChapterStyle}{}{}{}{}{\pagemark}{} -\renewcommand*{\chapterpagestyle}{ChapterStyle} -$endif$ - -$if(page-background)$ -\backgroundsetup{ -scale=1, -color=black, -opacity=$if(page-background-opacity)$$page-background-opacity$$else$0.2$endif$, -angle=0, -contents={% - \includegraphics[width=\paperwidth,height=\paperheight]{$page-background$} - }% -} -$endif$ -$endif$ -$endif$ - -%% -%% end added -%% - -\begin{document} - -%% -%% begin titlepage -%% -$if(beamer)$ -$else$ -$if(titlepage)$ -\begin{titlepage} -$if(titlepage-background)$ -\newgeometry{top=2cm, right=4cm, bottom=3cm, left=4cm} -$else$ -\newgeometry{left=6cm} -$endif$ +\newcommand{\colorRule}[3][black]{\textcolor[HTML]{#1}{\rule{#2}{#3}}} +\newcommand{\HRule}{\colorRule[2e6c80]{\textwidth}{1pt}} +\newcommand{\HRuleHeight}[1]{\colorRule[2e6c80]{\textwidth}{#1}} +\newcommand{\HRuleColor}[2]{\colorRule[#1]{\textwidth}{#2}} +\newcommand{\HRuleWidthColor}[3]{\colorRule[#2]{#3}{#1}} $if(titlepage-color)$ \definecolor{titlepage-color}{HTML}{$titlepage-color$} \newpagecolor{titlepage-color}\afterpage{\restorepagecolor} $endif$ +$if(titlepage-text-color)$ +\definecolor{titlepage-text-color}{HTML}{$titlepage-text-color$} +\else +\definecolor{titlepage-text-color}{HTML}{5F5F5F} +$endif$ +$if(titlepage-rule-color)$ +\definecolor{titlepage-rule-color}{HTML}{$titlepage-rule-color$} +\else +\definecolor{titlepage-rule-color}{HTML}{2e6c80} +$endif$ +\newgeometry{left=0cm,right=0cm,bottom=0cm} +\begin{titlepage} +\thispagestyle{empty} $if(titlepage-background)$ \tikz[remember picture,overlay] \node[inner sep=0pt] at (current page.center){\includegraphics[width=\paperwidth,height=\paperheight]{$titlepage-background$}}; $endif$ -\newcommand{\colorRule}[3][black]{\textcolor[HTML]{#1}{\rule{#2}{#3}}} -\begin{flushleft} \noindent -\\[-1em] -\color[HTML]{$if(titlepage-text-color)$$titlepage-text-color$$else$5F5F5F$endif$} -\makebox[0pt][l]{\colorRule[$if(titlepage-rule-color)$$titlepage-rule-color$$else$435488$endif$]{1.3\textwidth}{$if(titlepage-rule-height)$$titlepage-rule-height$$else$4$endif$pt}} -\par -\noindent - -$if(titlepage-background)$ -% The titlepage with a background image has other text spacing and text size -{ - \setstretch{2} - \vfill - \vskip -8em - \noindent {\huge \textbf{\textsf{$title$}}} - $if(subtitle)$ - \vskip 1em - {\Large \textsf{$subtitle$}} - $endif$ - \vskip 2em - \noindent {\Large \textsf{$for(author)$$author$$sep$, $endfor$} \vskip 0.6em \textsf{$date$}} - \vfill -} -$else$ -{ - \setstretch{1.4} - \vfill - \noindent {\huge \textbf{\textsf{$title$}}} - $if(subtitle)$ - \vskip 1em - {\Large \textsf{$subtitle$}} - $endif$ - \vskip 2em - \noindent {\Large \textsf{$for(author)$$author$$sep$, $endfor$}} - \vfill -} -$endif$ - -$if(titlepage-logo)$ -\noindent -\includegraphics[width=$if(logo-width)$$logo-width$$else$35mm$endif$, left]{$titlepage-logo$} -$endif$ - -$if(titlepage-background)$ -$else$ -\textsf{$date$} -$endif$ -\end{flushleft} +\begin{minipage}[c][\textheight]{1\textwidth} + \centering + \vspace*{3cm} + \begingroup + \color{titlepage-text-color} + \HRule\\[0.4cm] + {\huge\textbf{$title$}}\\ + \HRule\\[0.5cm] + $if(subtitle)$ + {\Large $subtitle$}\\[0.5cm] + $endif$ + $if(titlepage-logo)$ + \includegraphics[width=$if(logo-width)$$logo-width$$else$10cm$endif$]{$titlepage-logo$}\\[0.5cm] + $endif$ + $if(affiliation)$ + {\large $for(affiliation)$$affiliation$$sep$\\[1em] $endfor$}\\ + $endif$ + \vfill + $if(author)$ + {\large $for(author)$$author$$sep$\\[1em] $endfor$}\\[1em] + $endif$ + {\large $date$}\\[1em] + \vfill + \endgroup +\end{minipage} \end{titlepage} \restoregeometry -\pagenumbering{arabic} $endif$ -$endif$ - %% %% end titlepage %% +%% +%% begin custom colors and commands +%% + +% Define custom colors +\definecolor{heading-color}{RGB}{40,40,40} +\definecolor{caption-color}{HTML}{777777} +\definecolor{blockquote-border}{RGB}{221,221,221} +\definecolor{blockquote-text}{RGB}{119,119,119} + +% Define custom commands +\newcommand{\customheading}[1]{\color{heading-color}\textbf{#1}} +\newcommand{\customcaption}[1]{\color{caption-color}\small\textit{#1}} + +%% +%% end custom colors and commands +%% + +%% +%% begin document +%% + $if(has-frontmatter)$ \frontmatter $endif$ $if(title)$ $if(beamer)$ \frame{\titlepage} -% don't generate the default title -% $else$ -% \maketitle $endif$ $if(abstract)$ \begin{abstract} @@ -1021,7 +570,7 @@ $if(toc-title)$ \renewcommand*\contentsname{$toc-title$} $endif$ $if(beamer)$ -\begin{frame}[allowframebreaks] +\begin{frame} $if(toc-title)$ \frametitle{$toc-title$} $endif$ @@ -1033,9 +582,9 @@ $endif$ $else$ { $if(colorlinks)$ -\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$} +\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$default-linkcolor$endif$} $endif$ -\setcounter{tocdepth}{$toc-depth$} +\setcounter{tocdepth}{$if(toc-depth)$$toc-depth$$else$3$endif$} \tableofcontents $if(toc-own-page)$ \newpage @@ -1043,12 +592,12 @@ $endif$ } $endif$ $endif$ -$if(lof)$ -\listoffigures -$endif$ $if(lot)$ \listoftables $endif$ +$if(lof)$ +\listoffigures +$endif$ $if(linestretch)$ \setstretch{$linestretch$} $endif$ From aa8b05d27beb29708afd9ed233ac549f7466d88e Mon Sep 17 00:00:00 2001 From: Kai <37978933+froeb@users.noreply.github.com> Date: Mon, 20 May 2024 03:34:01 +0100 Subject: [PATCH 2/9] Update README.md ## [2024-05-20] ### Added - Custom colors for headings, captions, blockquotes, and listings. - Custom commands `\customheading` and `\customcaption` for flexible styling. - Support for custom background images on title pages and all pages. - Flexible geometry settings for title page layout. - Enhanced handling of paragraph and list spacing. ### Changed - Updated README.md to include detailed instructions on using and customizing the template. - Integrated custom styling options directly into the template for better user experience. --- README.md | 347 +++++++++++++++++++++++++++--------------------------- 1 file changed, 172 insertions(+), 175 deletions(-) diff --git a/README.md b/README.md index 99ad913..91e6f8d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - +markdownCopy code # Eisvogel @@ -39,34 +39,38 @@ docker run --rm \ For frequent command line use, you can define the following shell alias: -``` bash +``` +bash +Copy code alias pandock='docker run --rm -v "$(pwd):/data" -u $(id -u):$(id -g) pandoc/extra' ``` The example invocation with Docker from above now looks like this: -``` bash +``` +bash +Copy code pandock example.md -o example.pdf --template eisvogel --listings ``` -[pandoc/extra]: https://hub.docker.com/r/pandoc/extra - ## Usage -1. Open the terminal and navigate to the folder where your markdown file is located. +1. Open the terminal and navigate to the folder where your markdown file is located. -2. Execute the following command +2. Execute the following command - ``` bash - pandoc example.md -o example.pdf --from markdown --template eisvogel --listings - ``` + ``` + bash + Copy code + pandoc example.md -o example.pdf --from markdown --template eisvogel --listings + ``` - where `example.md` is the markdown file you want to convert to PDF. + where `example.md` is the markdown file you want to convert to PDF. -In order to have nice headers and footers you need to supply metadata to your document. You can do that with a [YAML metadata block](http://pandoc.org/MANUAL.html#extension-yaml_metadata_block) at the top of your markdown document (see the [example markdown file](examples/basic-example/document.md)). Your markdown document may look like the following: +In order to have nice headers and footers you need to supply metadata to your document. You can do that with a [YAML metadata block](http://pandoc.org/MANUAL.html#extension-yaml_metadata_block) at the top of your markdown document (see the [example markdown file](https://chatgpt.com/c/examples/basic-example/document.md)). Your markdown document may look like the following: -``` markdown ---- +``` +markdownCopy code--- title: "The Document Title" author: [Example Author, Another Author] date: "2017-02-20" @@ -80,148 +84,145 @@ Here is the actual document text... This template defines some new variables to control the appearance of the resulting PDF document. The existing template variables from pandoc are all supported and their documentation can be found in [the pandoc manual](https://pandoc.org/MANUAL.html#variables-for-latex). - - `titlepage` (defaults to `false`) +- `titlepage` (defaults to `false`) - turns on the title page when `true` + turns on the title page when `true` - - `titlepage-color` +- `titlepage-color` - the background color of the title page. The color value must be given as an HTML hex color like `D8DE2C` without the leading number sign (`#`). When specifying the color in YAML, it is advisable to enclose it in quotes like so `titlepage-color: "D8DE2C"` to avoid the truncation of the color (e.g. `000000` becoming `0`). + the background color of the title page. The color value must be given as an HTML hex color like `D8DE2C` without the leading number sign (`#`). When specifying the color in YAML, it is advisable to enclose it in quotes like so `titlepage-color: "D8DE2C"` to avoid the truncation of the color (e.g. `000000` becoming `0`). - - `titlepage-text-color` (defaults to `5F5F5F`) +- `titlepage-text-color` (defaults to `5F5F5F`) - the text color of the title page + the text color of the title page - - `titlepage-rule-color` (defaults to `435488`) +- `titlepage-rule-color` (defaults to `435488`) - the color of the rule on the top of the title page + the color of the rule on the top of the title page - - `titlepage-rule-height` (defaults to `4`) +- `titlepage-rule-height` (defaults to `4`) - the height of the rule on the top of the title page (in points) + the height of the rule on the top of the title page (in points) - - `titlepage-logo` +- `titlepage-logo` - path to an image that will be displayed on the title page. The path is always relative to where pandoc is executed. The option `--resource-path` has no effect. + path to an image that will be displayed on the title page. The path is always relative to where pandoc is executed. The option `--resource-path` has no effect. - - `titlepage-background` +- `titlepage-background` - the path to a background image for the title page. The background image is scaled to cover the entire page. In the examples folder under `titlepage-background` are a few example background images. + the path to a background image for the title page. The background image is scaled to cover the entire page. In the examples folder under `titlepage-background` are a few example background images. - - `page-background` +- `page-background` - the path to a background image for any page. The background image is scaled to cover the entire page. In the examples folder under `page-background` are a few example background images. + the path to a background image for any page. The background image is scaled to cover the entire page. In the examples folder under `page-background` are a few example background images. - - `page-background-opacity` (defaults to `0.2`) +- `page-background-opacity` (defaults to `0.2`) - the background image opacity + the background image opacity - - `caption-justification` (defaults to `raggedright`) +- `caption-justification` (defaults to `raggedright`) - justification setting for captions (uses the `justification` parameter of the [caption](https://ctan.org/pkg/caption?lang=en) package) + justification setting for captions (uses the `justification` parameter of the [caption](https://ctan.org/pkg/caption?lang=en) package) - - `toc-own-page` (defaults to `false`) +- `toc-own-page` (defaults to `false`) - begin new page after table of contents, when `true` + begin new page after table of contents, when `true` - - `listings-disable-line-numbers` (defaults to `false`) +- `listings-disable-line-numbers` (defaults to `false`) - disables line numbers for all listings + disables line numbers for all listings - - `listings-no-page-break` (defaults to `false`) +- `listings-no-page-break` (defaults to `false`) - avoid page break inside listings + avoid page break inside listings - - `disable-header-and-footer` (default to `false`) +- `disable-header-and-footer` (default to `false`) - disables the header and footer completely on all pages + disables the header and footer completely on all pages - - `header-left` (defaults to the title) +- `header-left` (defaults to the title) - the text on the left side of the header + the text on the left side of the header - - `header-center` +- `header-center` - the text in the center of the header + the text in the center of the header - - `header-right` (defaults to the date) +- `header-right` (defaults to the date) - the text on the right side of the header + the text on the right side of the header - - `footer-left` (defaults to the author) +- `footer-left` (defaults to the author) - the text on the left side of the footer + the text on the left side of the footer - - `footer-center` +- `footer-center` - the text in the center of the footer + the text in the center of the footer - - `footer-right` (defaults to the page number) +- `footer-right` (defaults to the page number) - the text on the right side of the footer + the text on the right side of the footer - - `footnotes-pretty` (defaults to `false`) +- `footnotes-pretty` (defaults to `false`) - prettifies formatting of footnotes (requires package `footmisc`) + prettifies formatting of footnotes (requires package `footmisc`) - - `footnotes-disable-backlinks` (defaults to `false`) +- `footnotes-disable-backlinks` (defaults to `false`) - disables making the reference from the footnote at the bottom of the page into a link back to the occurrence of the footnote in the main text (enabling requires package `footnotebackref`). + disables making the reference from the footnote at the bottom of the page into a link back to the occurrence of the footnote in the main text (enabling requires package `footnotebackref`). - - `book` (defaults to `false`) +- `book` (defaults to `false`) - typeset as book + typeset as book - - `logo-width` (defaults to `35mm`) +- `logo-width` (defaults to `35mm`) - the width of the logo. One needs to specify the width with a (TeX) unit e.g. `100pt` or `35mm`. The following units can be used: + the width of the logo. One needs to specify the width with a (TeX) unit e.g. `100pt` or `35mm`. The following units can be used: - - `pt`: Point - - `pc`: pica (12 `pt`) - - `in`: inch (72.27 `pt`) - - `bp`: Big point (72 `bp` = 1 `in`) - - `cm`: Centimeter - - `mm`: Millimeter - - `dd`: Didot point - - `cc`: cicero (12 `dd`) - - `sp`: Scaled point (65,536 `sp` = 1 `pt`) - - `ex`: Nomimal x-height - - `em`: Nominal m-width - - `px`: Pixel (only for pdfTeX and LuaTeX) The dimension given to the `\pdfpxdimen` primitive; default value is 1 `bp`, corresponding to a pixel density of 72 dpi. + - `pt`: Point + - `pc`: pica (12 `pt`) + - `in`: inch (72.27 `pt`) + - `bp`: Big point (72 `bp` = 1 `in`) + - `cm`: Centimeter + - `mm`: Millimeter + - `dd`: Didot point + - `cc`: cicero (12 `dd`) + - `sp`: Scaled point (65,536 `sp` = 1 `pt`) + - `ex`: Nomimal x-height + - `em`: Nominal m-width + - `px`: Pixel (only for pdfTeX and LuaTeX) The dimension given to the `\pdfpxdimen` primitive; default value is 1 `bp`, corresponding to a pixel density of 72 dpi. - A visual overview of the length units is available at . + A visual overview of the length units is available at https://github.com/tweh/tex-units. - - `first-chapter` (defaults to `1`) +- `first-chapter` (defaults to `1`) - if typesetting a book with chapter numbers, specifies the number that will be assigned to the first chapter + if typesetting a book with chapter numbers, specifies the number that will be assigned to the first chapter - - `float-placement-figure` (defaults to `H`) +- `float-placement-figure` (defaults to `H`) - Reset the default placement specifier for figure environments to the supplied value e.g. `htbp`. The available specifiers are listed below. The first four placement specifiers can be combined. + Reset the default placement specifier for figure environments to the supplied value e.g. `htbp`. The available specifiers are listed below. The first four placement specifiers can be combined. - 1. `h`: Place the float *here*, i.e., approximately at the same point it occurs in the source text. - 2. `t`: Place the float at the *top* of the page. - 3. `b`: Place the float at the *bottom* of the page. - 4. `p`: Place the float on the next *page* that will contain only floats like figures and tables. - 5. `H`: Place the float *HERE* (exactly where it occurs in the source text). The `H` specifier is provided by the [float package](https://ctan.org/pkg/float) and may not be used in conjunction with any other placement specifiers. + 1. `h`: Place the float *here*, i.e., approximately at the same point it occurs in the source text. + 2. `t`: Place the float at the *top* of the page. + 3. `b`: Place the float at the *bottom* of the page. + 4. `p`: Place the float on the next *page* that will contain only floats like figures and tables. + 5. `H`: Place the float *HERE* (exactly where it occurs in the source text). The `H` specifier is provided by the [float package](https://ctan.org/pkg/float) and may not be used in conjunction with any other placement specifiers. - - `table-use-row-colors` (defaults to `false`) +- `table-use-row-colors` (defaults to `false`) - enables row colors for tables. The default value is `false` because the coloring extends beyond the edge of the table and there is currently no way to change that. + enables row colors for tables. The default value is `false` because the coloring extends beyond the edge of the table and there is currently no way to change that. - - `code-block-font-size` (defaults to `\small`) +- `code-block-font-size` (defaults to `\small`) - LaTeX command to change the font size for code blocks. The available values are `\tiny`, `\scriptsize`, `\footnotesize`, `\small`, `\normalsize`, `\large`, `\Large`, `\LARGE`, `\huge` and `\Huge`. This option will change the font size for default code blocks using the verbatim environment and for code blocks generated with listings. + LaTeX command to change the font size for code blocks. The available values are `\tiny`, `\scriptsize`, `\footnotesize`, `\small`, `\normalsize`, `\large`, `\Large`, `\LARGE`, `\huge` and `\Huge`. This option will change the font size for default code blocks using the verbatim environment and for code blocks generated with listings. ## Required LaTeX Packages -LaTeX manages addons and additional functionality in so called packages. You -might get the following error when compiling a document with the Eisvogel -template: +LaTeX manages addons and additional functionality in so called packages. You might get the following error when compiling a document with the Eisvogel template: - -``` sh -! LaTeX Error: File `footnotebackref.sty' not found. +``` +shCopy code! LaTeX Error: File `footnotebackref.sty' not found. Type X to quit or to proceed, or enter new name. (Default extension: sty) @@ -231,21 +232,16 @@ Enter file name: ``` -LaTeX informs you that the additional package `footnotebackref` is required to -render the document. +LaTeX informs you that the additional package `footnotebackref` is required to render the document. ### Texlive -Eisvogel requires a full texlive distribution that can be installed by running -`apt-get install texlive-full` in the terminal. Because `texlive-full` is very -large (about 5 Gigabytes) you can also install the smaller texlive bundles and -add any missing packages manually. +Eisvogel requires a full texlive distribution that can be installed by running `apt-get install texlive-full` in the terminal. Because `texlive-full` is very large (about 5 Gigabytes) you can also install the smaller texlive bundles and add any missing packages manually. -A smaller texlive bundle is `texlive-latex-extra`. With `texlive-latex-extra` -you also need to install these packages manually: +A smaller texlive bundle is `texlive-latex-extra`. With `texlive-latex-extra` you also need to install these packages manually: ``` -adjustbox babel-german background bidi collectbox csquotes everypage filehook +arduinoCopy codeadjustbox babel-german background bidi collectbox csquotes everypage filehook footmisc footnotebackref framed fvextra letltxmacro ly1 mdframed mweights needspace pagecolor sourcecodepro sourcesanspro titling ucharcat ulem unicode-math upquote xecjk xurl zref @@ -253,27 +249,26 @@ unicode-math upquote xecjk xurl zref Install them with the following command: -``` sh +``` +sh +Copy code tlmgr install adjustbox babel-german background bidi collectbox csquotes everypage filehook footmisc footnotebackref framed fvextra letltxmacro ly1 mdframed mweights needspace pagecolor sourcecodepro sourcesanspro titling ucharcat ulem unicode-math upquote xecjk xurl zref ``` -Additional information about the different texlive packages can be found at -this TeX-StackExchange answer: +Additional information about the different texlive packages can be found at this TeX-StackExchange answer: https://tex.stackexchange.com/a/504566 ### MiKTeX -If you don't want to install all missing packages manually, [MiKTeX might be -an alternative](https://miktex.org/howto/miktex-console). +If you don't want to install all missing packages manually, [MiKTeX might be an alternative](https://miktex.org/howto/miktex-console). -> MiKTeX has the ability to automatically install missing packages. -> You can turn this feature on or off. And you can let MiKTeX ask you each time a package has to be installed: +> MiKTeX has the ability to automatically install missing packages. You can turn this feature on or off. And you can let MiKTeX ask you each time a package has to be installed: > > - Click `Settings` to navigate to the settings page. > - Click the `General` tab. > - Click one of the radio buttons: -> - `Ask me` -> - `Always install missing packages on-the-fly` -> - `Never install missing packages on-the-fly` +> - `Ask me` +> - `Always install missing packages on-the-fly` +> - `Never install missing packages on-the-fly` ## Examples @@ -281,7 +276,9 @@ an alternative](https://miktex.org/howto/miktex-console). For PDFs with [numbered sections](http://pandoc.org/MANUAL.html#options-affecting-specific-writers) use the `--number-sections` or `-N` option. -``` bash +``` +bash +Copy code pandoc example.md -o example.pdf --template eisvogel --number-sections ``` @@ -289,7 +286,9 @@ pandoc example.md -o example.pdf --template eisvogel --number-sections You can get syntax highlighting of delimited code blocks by using the LaTeX package listings with the option `--listings`. This example will produce the same syntax highlighting as in the example PDF. -``` bash +``` +bash +Copy code pandoc example.md -o example.pdf --template eisvogel --listings ``` @@ -297,19 +296,18 @@ pandoc example.md -o example.pdf --template eisvogel --listings The following examples show [syntax highlighting of delimited code blocks](http://pandoc.org/MANUAL.html#syntax-highlighting) without using listings. To see a list of all the supported highlight styles, type `pandoc --list-highlight-styles`. -``` bash +``` +bash +Copy code pandoc example.md -o example.pdf --template eisvogel --highlight-style pygments -``` - -``` bash +bash +Copy code pandoc example.md -o example.pdf --template eisvogel --highlight-style kate -``` - -``` bash +bash +Copy code pandoc example.md -o example.pdf --template eisvogel --highlight-style espresso -``` - -``` bash +bash +Copy code pandoc example.md -o example.pdf --template eisvogel --highlight-style tango ``` @@ -317,21 +315,27 @@ pandoc example.md -o example.pdf --template eisvogel --highlight-style tango To produce a standalone LaTeX document for compiling with any LaTeX editor use `.tex` as an output file extension. -``` bash +``` +bash +Copy code pandoc example.md -o example.tex --template eisvogel ``` ### Changing the Document Language -The default language of this template is American English. The `lang` variable identifies the main language of the document, using a code according to [BCP 47](https://tools.ietf.org/html/bcp47) (e.g. `en` or `en-GB`). For an incomplete list of the supported language codes see [the documentation for the hyph-utf8 package (Section 2)](http://mirrors.ctan.org/language/hyph-utf8/doc/generic/hyph-utf8/hyph-utf8.pdf). The following example changes the language to British English: +The default language of this template is American English. The `lang` variable identifies the main language of the document, using a code according to [BCP 47](https://tools.ietf.org/html/bcp47) (e.g. `en` or `en-GB`). For an incomplete list of the supported language codes see [the documentation for the hyph-utf8 package (Section 2)](http://mirrors.ctan.org/language/hyph-utf8/doc/generic/hyph-utf8/hyph-utf8.pdf). The following example changes the language to British English: -``` bash +``` +bash +Copy code pandoc example.md -o example.pdf --template eisvogel -V lang=en-GB ``` The following example changes the language to German: -``` bash +``` +bash +Copy code pandoc example.md -o example.pdf --template eisvogel -V lang=de ``` @@ -345,38 +349,34 @@ There will be one blank page before each chapter because the template is two-sid ### Example Images -| A green title page | A background image on the title page | -| :----------------: | :----------------: | -| [![A green title page](examples/title-page-green/preview.png)](examples/title-page-green/document.pdf) | [![A background image on the title page](examples/title-page-background/preview.png)](examples/title-page-background/document.pdf) | +| A green title page | A background image on the title page | +| :----------------------------------------------------------: | :----------------------------------------------------------: | +| [![A green title page](https://chatgpt.com/c/examples/title-page-green/preview.png)](https://chatgpt.com/c/examples/title-page-green/document.pdf) | [![A background image on the title page](https://chatgpt.com/c/examples/title-page-background/preview.png)](https://chatgpt.com/c/examples/title-page-background/document.pdf) | -| images and tables | Code blocks styled without listings | -| :---------------: | :---------------: | -| [![images and tables](examples/images-and-tables/preview.png)](examples/images-and-tables/document.pdf) | [![Code blocks styled without listings](examples/code-blocks-without-listings/preview.png)](examples/code-blocks-without-listings/document.pdf) | +| images and tables | Code blocks styled without listings | +| :----------------------------------------------------------: | :----------------------------------------------------------: | +| [![images and tables](https://chatgpt.com/c/examples/images-and-tables/preview.png)](https://chatgpt.com/c/examples/images-and-tables/document.pdf) | [![Code blocks styled without listings](https://chatgpt.com/c/examples/code-blocks-without-listings/preview.png)](https://chatgpt.com/c/examples/code-blocks-without-listings/document.pdf) | -| A book | Code blocks styled with listings | -| :----: | :----: | -| [![A book](examples/book/preview.png)](examples/book/document.pdf) | [![Code blocks styled with listings](examples/code-blocks-listings/preview.png)](examples/code-blocks-listings/document.pdf) | +| A book | Code blocks styled with listings | +| :----------------------------------------------------------: | :----------------------------------------------------------: | +| [![A book](https://chatgpt.com/c/examples/book/preview.png)](https://chatgpt.com/c/examples/book/document.pdf) | [![Code blocks styled with listings](https://chatgpt.com/c/examples/code-blocks-listings/preview.png)](https://chatgpt.com/c/examples/code-blocks-listings/document.pdf) | -| A background images on all pages | CJK Support (when using XeLaTeX) | -| :----: | :----: | -| [![A background images on all pages](examples/page-background/preview.png)](examples/page-background/document.pdf) | [![CJK Support (when using XeLaTeX)](examples/language-japanese/preview.png)](examples/language-japanese/document.pdf) | +| A background images on all pages | CJK Support (when using XeLaTeX) | +| :----------------------------------------------------------: | :----------------------------------------------------------: | +| [![A background images on all pages](https://chatgpt.com/c/examples/page-background/preview.png)](https://chatgpt.com/c/examples/page-background/document.pdf) | [![CJK Support (when using XeLaTeX)](https://chatgpt.com/c/examples/language-japanese/preview.png)](https://chatgpt.com/c/examples/language-japanese/document.pdf) | ## Common Errors / Issues -The following section lists common errors and their solutions when using the -Eisvogel template. +The following section lists common errors and their solutions when using the Eisvogel template. ### LaTeX Errors `Missing endcsname inserted` or `File x not found` when using `titlepage-background`, `logo`, or `titlepage-logo`. -``` latex -Error producing PDF. +``` +latexCopy codeError producing PDF. ! Missing endcsname inserted. protect -``` - -``` latex -Error producing PDF. +latexCopy codeError producing PDF. ! Package pdftex.def Error: File `logo\T1\textunderscoreimage.pdf' not fou nd: using draft setting. @@ -384,27 +384,29 @@ See the pdftex.def package documentation for explanation. Type H for immediate help. ``` -These errors occur when one includes a background image on the title page or a -logo that has an underscore (`_`) in the filename. +These errors occur when one includes a background image on the title page or a logo that has an underscore (`_`) in the filename. -A quick fix would be to replace all underscores in the filename of the image -with a hyphen (`-`). If the background image is specified in your YAML front -matter like so, +A quick fix would be to replace all underscores in the filename of the image with a hyphen (`-`). If the background image is specified in your YAML front matter like so, -``` yaml +``` +yaml +Copy code titlepage-background: "background_image.pdf" ``` -you can advise pandoc to interpret this as LaTeX and include it in the document -without parsing. +you can advise pandoc to interpret this as LaTeX and include it in the document without parsing. -``` yaml +``` +yaml +Copy code titlepage-background: "`background_image.pdf`{=latex}" ``` The same fix can be used for the logo image as well: -``` yaml +``` +yaml +Copy code logo: "`logo_image.pdf`{=latex}" ``` @@ -416,7 +418,7 @@ Corresponding issues: ### LaTeX Error `Missing \begin{document}` ``` -! LaTeX Error: Missing \begin{document}. +javascriptCopy code! LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. @@ -427,13 +429,12 @@ l.7 < ! ==> Fatal error occurred, no output PDF file produced! ``` -This error indicates that you try to use some text file for conversion that is -not the Eisvogel template. Please download the [latest Eisvogel template](https://github.com/Wandmalfarbe/pandoc-latex-template/releases/latest) from the releases page and start the conversion again. +This error indicates that you try to use some text file for conversion that is not the Eisvogel template. Please download the [latest Eisvogel template](https://github.com/Wandmalfarbe/pandoc-latex-template/releases/latest) from the releases page and start the conversion again. ### LaTeX Error `auto expansion is only possible with scalable fonts` -``` latex -Error producing PDF. +``` +latexCopy codeError producing PDF. ! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts. \AtBegShi@Output ...ipout \box \AtBeginShipoutBox @@ -441,8 +442,7 @@ fonts. l.643 \begin{lstlisting} ``` -This error likely occurs on Windows with MiKTeX installed. StackOverflow user -[Krebto provided the following fix](https://tex.stackexchange.com/a/392467): +This error likely occurs on Windows with MiKTeX installed. StackOverflow user [Krebto provided the following fix](https://tex.stackexchange.com/a/392467): > To solve the problem navigate to `C:\Program Files\MiKTeX 2.9\miktex\bin\x64` and run `updmap.exe`. The program may seem as it hangs for a while, but its probably because it tries to update the whole font tree. This solved the problem for me. After re-compiling everything should work fine. @@ -452,20 +452,17 @@ Corresponding issue: ### LaTeX Error `cannot find image file` -``` latex -Error producing PDF. +``` +latexCopy codeError producing PDF. ! error: (file "/tmp/tex2pdf.-be734e802ef6d0c3/""fdcfc29edcf252186f1b0a52f18f50 43abaeb2d0".png) (pdf backend): cannot find image file '"/tmp/tex2pdf.-be734e802 ef6d0c3/""fdcfc29edcf252186f1b0a52f18f5043abaeb2d0".png' ! ==> Fatal error occurred, no output PDF file produced! ``` -In general this error means that LaTeX is unable to find the included image -file. Please check all image references and file names for correctness. +In general this error means that LaTeX is unable to find the included image file. Please check all image references and file names for correctness. -This error also occurs if you use an old version of Eisvogel with the package -`grffile` and have an old LaTeX distribution installed. Please update Eisvogel -and your LaTeX distribution. +This error also occurs if you use an old version of Eisvogel with the package `grffile` and have an old LaTeX distribution installed. Please update Eisvogel and your LaTeX distribution. Corresponding issues: @@ -474,8 +471,8 @@ Corresponding issues: ## Credits - - This template includes code for styling block quotations from [pandoc-letter](https://github.com/aaronwolen/pandoc-letter) by [Aaron Wolen](https://github.com/aaronwolen). +- This template includes code for styling block quotations from [pandoc-letter](https://github.com/aaronwolen/pandoc-letter) by [Aaron Wolen](https://github.com/aaronwolen). ## License -This project is open source licensed under the BSD 3-Clause License. Please see the [LICENSE file](LICENSE) for more information. +This project is open source licensed under the BSD 3-Clause License. Please see the [LICENSE file](https://chatgpt.com/c/LICENSE) for more information. From d2d175bc60895b20387fdc3a1661ee0bba648430 Mon Sep 17 00:00:00 2001 From: Kai <37978933+froeb@users.noreply.github.com> Date: Mon, 20 May 2024 03:36:36 +0100 Subject: [PATCH 3/9] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 91e6f8d..28e0f1c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -markdownCopy code + # Eisvogel @@ -70,7 +70,7 @@ pandock example.md -o example.pdf --template eisvogel --listings In order to have nice headers and footers you need to supply metadata to your document. You can do that with a [YAML metadata block](http://pandoc.org/MANUAL.html#extension-yaml_metadata_block) at the top of your markdown document (see the [example markdown file](https://chatgpt.com/c/examples/basic-example/document.md)). Your markdown document may look like the following: ``` -markdownCopy code--- +--- title: "The Document Title" author: [Example Author, Another Author] date: "2017-02-20" From ee8c8a455bda73a1a0618883733411bf508f15a1 Mon Sep 17 00:00:00 2001 From: Kai <37978933+froeb@users.noreply.github.com> Date: Mon, 20 May 2024 03:58:18 +0100 Subject: [PATCH 4/9] Update README.md --- README.md | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 28e0f1c..03121f8 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ For frequent command line use, you can define the following shell alias: ``` bash -Copy code + alias pandock='docker run --rm -v "$(pwd):/data" -u $(id -u):$(id -g) pandoc/extra' ``` @@ -49,7 +49,7 @@ The example invocation with Docker from above now looks like this: ``` bash -Copy code + pandock example.md -o example.pdf --template eisvogel --listings ``` @@ -61,7 +61,7 @@ pandock example.md -o example.pdf --template eisvogel --listings ``` bash - Copy code + pandoc example.md -o example.pdf --from markdown --template eisvogel --listings ``` @@ -222,7 +222,7 @@ This template defines some new variables to control the appearance of the result LaTeX manages addons and additional functionality in so called packages. You might get the following error when compiling a document with the Eisvogel template: ``` -shCopy code! LaTeX Error: File `footnotebackref.sty' not found. +sh! LaTeX Error: File `footnotebackref.sty' not found. Type X to quit or to proceed, or enter new name. (Default extension: sty) @@ -241,7 +241,7 @@ Eisvogel requires a full texlive distribution that can be installed by running ` A smaller texlive bundle is `texlive-latex-extra`. With `texlive-latex-extra` you also need to install these packages manually: ``` -arduinoCopy codeadjustbox babel-german background bidi collectbox csquotes everypage filehook +arduinoadjustbox babel-german background bidi collectbox csquotes everypage filehook footmisc footnotebackref framed fvextra letltxmacro ly1 mdframed mweights needspace pagecolor sourcecodepro sourcesanspro titling ucharcat ulem unicode-math upquote xecjk xurl zref @@ -251,7 +251,7 @@ Install them with the following command: ``` sh -Copy code + tlmgr install adjustbox babel-german background bidi collectbox csquotes everypage filehook footmisc footnotebackref framed fvextra letltxmacro ly1 mdframed mweights needspace pagecolor sourcecodepro sourcesanspro titling ucharcat ulem unicode-math upquote xecjk xurl zref ``` @@ -278,7 +278,7 @@ For PDFs with [numbered sections](http://pandoc.org/MANUAL.html#options-affectin ``` bash -Copy code + pandoc example.md -o example.pdf --template eisvogel --number-sections ``` @@ -288,7 +288,7 @@ You can get syntax highlighting of delimited code blocks by using the LaTeX pack ``` bash -Copy code + pandoc example.md -o example.pdf --template eisvogel --listings ``` @@ -298,16 +298,16 @@ The following examples show [syntax highlighting of delimited code blocks](http: ``` bash -Copy code + pandoc example.md -o example.pdf --template eisvogel --highlight-style pygments bash -Copy code + pandoc example.md -o example.pdf --template eisvogel --highlight-style kate bash -Copy code + pandoc example.md -o example.pdf --template eisvogel --highlight-style espresso bash -Copy code + pandoc example.md -o example.pdf --template eisvogel --highlight-style tango ``` @@ -317,7 +317,7 @@ To produce a standalone LaTeX document for compiling with any LaTeX editor use ` ``` bash -Copy code + pandoc example.md -o example.tex --template eisvogel ``` @@ -327,7 +327,7 @@ The default language of this template is American English. The `lang` variable i ``` bash -Copy code + pandoc example.md -o example.pdf --template eisvogel -V lang=en-GB ``` @@ -335,7 +335,7 @@ The following example changes the language to German: ``` bash -Copy code + pandoc example.md -o example.pdf --template eisvogel -V lang=de ``` @@ -372,11 +372,11 @@ The following section lists common errors and their solutions when using the Eis ### LaTeX Errors `Missing endcsname inserted` or `File x not found` when using `titlepage-background`, `logo`, or `titlepage-logo`. ``` -latexCopy codeError producing PDF. +latexError producing PDF. ! Missing endcsname inserted. protect -latexCopy codeError producing PDF. +latexError producing PDF. ! Package pdftex.def Error: File `logo\T1\textunderscoreimage.pdf' not fou nd: using draft setting. @@ -390,7 +390,7 @@ A quick fix would be to replace all underscores in the filename of the image wit ``` yaml -Copy code + titlepage-background: "background_image.pdf" ``` @@ -398,7 +398,7 @@ you can advise pandoc to interpret this as LaTeX and include it in the document ``` yaml -Copy code + titlepage-background: "`background_image.pdf`{=latex}" ``` @@ -406,7 +406,7 @@ The same fix can be used for the logo image as well: ``` yaml -Copy code + logo: "`logo_image.pdf`{=latex}" ``` @@ -418,7 +418,7 @@ Corresponding issues: ### LaTeX Error `Missing \begin{document}` ``` -javascriptCopy code! LaTeX Error: Missing \begin{document}. +javascript! LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. @@ -434,7 +434,7 @@ This error indicates that you try to use some text file for conversion that is n ### LaTeX Error `auto expansion is only possible with scalable fonts` ``` -latexCopy codeError producing PDF. +latexError producing PDF. ! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts. \AtBegShi@Output ...ipout \box \AtBeginShipoutBox @@ -453,7 +453,7 @@ Corresponding issue: ### LaTeX Error `cannot find image file` ``` -latexCopy codeError producing PDF. +latexError producing PDF. ! error: (file "/tmp/tex2pdf.-be734e802ef6d0c3/""fdcfc29edcf252186f1b0a52f18f50 43abaeb2d0".png) (pdf backend): cannot find image file '"/tmp/tex2pdf.-be734e802 ef6d0c3/""fdcfc29edcf252186f1b0a52f18f5043abaeb2d0".png' From 2e85b7e1dce4053d40fa851c5a9fe608542c1ea1 Mon Sep 17 00:00:00 2001 From: Kai <37978933+froeb@users.noreply.github.com> Date: Mon, 20 May 2024 04:07:14 +0100 Subject: [PATCH 5/9] Update CHANGELOG.md added description of todays changes --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 718f89a..638f5f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ All notable changes to this project are documented in this file. On the [releases page](https://github.com/Wandmalfarbe/pandoc-latex-template/releases/) you can see all released versions of the Eisvogel template and download the [latest version](https://github.com/Wandmalfarbe/pandoc-latex-template/releases/latest). +## [Unreleased] + +## [2024-05-20] + +### Added +- Custom colors for headings, captions, blockquotes, and listings. +- Custom commands `\customheading` and `\customcaption` for flexible styling. +- Support for custom background images on title pages and all pages. +- Flexible geometry settings for title page layout. +- Enhanced handling of paragraph and list spacing. + +### Changed +- Updated README.md to include detailed instructions on using and customizing the template. +- Integrated custom styling options directly into the template for better user experience. + +### Fixed +- Minor formatting issues and improved compatibility with various LaTeX distributions. + ## [2.4.2] - 2023-11-25 - Merge changes from the pandoc default LaTeX template from version 3.1.9 ([f7d8b62](https://github.com/jgm/pandoc-templates/commit/f7d8b629330074a4400d1f2795b101d14491c968)). From 6520a161ed14a6b5f9c801738f3e30be5bb11a5f Mon Sep 17 00:00:00 2001 From: Kai <37978933+froeb@users.noreply.github.com> Date: Mon, 20 May 2024 19:20:53 +0100 Subject: [PATCH 6/9] Update eisvogel.tex --- eisvogel.tex | 629 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 540 insertions(+), 89 deletions(-) diff --git a/eisvogel.tex b/eisvogel.tex index c2a7477..109cb83 100644 --- a/eisvogel.tex +++ b/eisvogel.tex @@ -407,14 +407,127 @@ $if(numbersections)$ $else$ \setcounter{secnumdepth}{-\maxdimen} % remove section numbering $endif$ +$if(subfigure)$ +\usepackage{subcaption} +$endif$ +$if(beamer)$ +$else$ +$if(block-headings)$ +% Make \paragraph and \subparagraph free-standing +\ifx\paragraph\undefined\else + \let\oldparagraph\paragraph + \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}} +\fi +\ifx\subparagraph\undefined\else + \let\oldsubparagraph\subparagraph + \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}} +\fi +$endif$ +$endif$ +$if(pagestyle)$ +\pagestyle{$pagestyle$} +$endif$ +$if(csl-refs)$ +% definitions for citeproc citations +\NewDocumentCommand\citeproctext{}{} +\NewDocumentCommand\citeproc{mm}{% + \begingroup\def\citeproctext{#2}\cite{#1}\endgroup} +\makeatletter + % allow citations to break across lines + \let\@cite@ofmt\@firstofone + % avoid brackets around text for \cite: + \def\@biblabel#1{} + \def\@cite#1#2{{#1\if@tempswa , #2\fi}} +\makeatother +\newlength{\cslhangindent} +\setlength{\cslhangindent}{1.5em} +\newlength{\csllabelwidth} +\setlength{\csllabelwidth}{3em} +\newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing + {\begin{list}{}{% + \setlength{\itemindent}{0pt} + \setlength{\leftmargin}{0pt} + \setlength{\parsep}{0pt} + % turn on hanging indent if param 1 is 1 + \ifodd #1 + \setlength{\leftmargin}{\cslhangindent} + \setlength{\itemindent}{-1\cslhangindent} + \fi + % set entry spacing + \setlength{\itemsep}{#2\baselineskip}}} + {\end{list}} +\usepackage{calc} +\newcommand{\CSLBlock}[1]{\hfill\break\parbox[t]{\linewidth}{\strut\ignorespaces#1\strut}} +\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{\strut#1\strut}} +\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}} +\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} +$endif$ +$if(lang)$ +\ifLuaTeX +\usepackage[bidi=basic]{babel} +\else +\usepackage[bidi=default]{babel} +\fi +$if(babel-lang)$ +\babelprovide[main,import]{$babel-lang$} +$if(mainfont)$ +\ifPDFTeX +\else +\babelfont{rm}[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} +\fi +$endif$ +$endif$ +$for(babel-otherlangs)$ +\babelprovide[import]{$babel-otherlangs$} +$endfor$ +$for(babelfonts/pairs)$ +\babelfont[$babelfonts.key$]{rm}{$babelfonts.value$} +$endfor$ +% get rid of language-specific shorthands (see #6817): +\let\LanguageShortHands\languageshorthands +\def\languageshorthands#1{} +$endif$ +$for(header-includes)$ +$header-includes$ +$endfor$ +\ifLuaTeX + \usepackage{selnolig} % disable illegal ligatures +\fi +$if(dir)$ +\ifPDFTeX + \TeXXeTstate=1 + \newcommand{\RL}[1]{\beginR #1\endR} + \newcommand{\LR}[1]{\beginL #1\endL} + \newenvironment{RTL}{\beginR}{\endR} + \newenvironment{LTR}{\beginL}{\endL} +\fi +$endif$ +$if(natbib)$ +\usepackage[$natbiboptions$]{natbib} +\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$} +$endif$ +$if(biblatex)$ +\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex} +$for(bibliography)$ +\addbibresource{$bibliography$} +$endfor$ +$endif$ +$if(nocite-ids)$ +\nocite{$for(nocite-ids)$$it$$sep$, $endfor$} +$endif$ +$if(csquotes)$ +\usepackage{csquotes} +$endif$ +\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} +\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available +\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$} +$if(links-as-notes)$ +% Make links footnotes instead of hotlinks: +\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} +$endif$ $if(verbatim-in-note)$ \VerbatimFootnotes % allow verbatim text in footnotes $endif$ -$if(links-as-notes)$ -% Make links footnotes instead of hotlinks: -\renewcommand{\href}[2]{#2\footnote{\url{#1}}} -$endif$ -\usepackage{hyperref} \hypersetup{ $if(title-meta)$ pdftitle={$title-meta$}, @@ -422,6 +535,9 @@ $endif$ $if(author-meta)$ pdfauthor={$author-meta$}, $endif$ +$if(lang)$ + pdflang={$lang$}, +$endif$ $if(subject)$ pdfsubject={$subject$}, $endif$ @@ -430,124 +546,459 @@ $if(keywords)$ $endif$ $if(colorlinks)$ colorlinks=true, - linkcolor=$if(linkcolor)$$linkcolor$$else$default-linkcolor$endif$, - filecolor=$if(filecolor)$$filecolor$$else$default-filecolor$endif$, - citecolor=$if(citecolor)$$citecolor$$else$default-citecolor$endif$, - urlcolor=$if(urlcolor)$$urlcolor$$else$default-urlcolor$endif$, + linkcolor={$if(linkcolor)$$linkcolor$$else$default-linkcolor$endif$}, + filecolor={$if(filecolor)$$filecolor$$else$default-filecolor$endif$}, + citecolor={$if(citecolor)$$citecolor$$else$default-citecolor$endif$}, + urlcolor={$if(urlcolor)$$urlcolor$$else$default-urlcolor$endif$}, $else$ hidelinks, $endif$ breaklinks=true, pdfcreator={LaTeX via pandoc with the Eisvogel template}} -\urlstyle{same} % don't use monospace font for urls -$if(geometry)$ -$if(beamer)$ -\geometry{$for(geometry)$$geometry$$sep$,$endfor$} -$else$ -\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} +$if(title)$ +\title{$title$$if(thanks)$\thanks{$thanks$}$endif$} $endif$ -$else$ +$if(subtitle)$ $if(beamer)$ $else$ -\usepackage[margin=2.5cm,includehead=true,includefoot=true,centering]{geometry} +\usepackage{etoolbox} +\makeatletter +\providecommand{\subtitle}[1]{% add subtitle to \maketitle + \apptocmd{\@title}{\par {\large #1 \par}}{}{} +} +\makeatother +$endif$ +\subtitle{$subtitle$} +$endif$ +\author{$for(author)$$author$$sep$ \and $endfor$} +\date{$date$} +$if(beamer)$ +$if(institute)$ +\institute{$for(institute)$$institute$$sep$ \and $endfor$} +$endif$ +$if(titlegraphic)$ +\titlegraphic{\includegraphics{$titlegraphic$}} +$endif$ +$if(logo)$ +\logo{\includegraphics{$logo$}} $endif$ $endif$ + + %% -%% begin titlepage +%% added %% + +$if(page-background)$ +\usepackage[pages=all]{background} +$endif$ + +% +% for the background color of the title page +% $if(titlepage)$ \usepackage{pagecolor} \usepackage{afterpage} $if(titlepage-background)$ \usepackage{tikz} $endif$ -\newcommand{\colorRule}[3][black]{\textcolor[HTML]{#1}{\rule{#2}{#3}}} -\newcommand{\HRule}{\colorRule[2e6c80]{\textwidth}{1pt}} -\newcommand{\HRuleHeight}[1]{\colorRule[2e6c80]{\textwidth}{#1}} -\newcommand{\HRuleColor}[2]{\colorRule[#1]{\textwidth}{#2}} -\newcommand{\HRuleWidthColor}[3]{\colorRule[#2]{#3}{#1}} +$if(geometry)$ +$else$ +\usepackage[margin=2.5cm,includehead=true,includefoot=true,centering]{geometry} +$endif$ +$endif$ + +% +% break urls +% +\PassOptionsToPackage{hyphens}{url} + +% +% When using babel or polyglossia with biblatex, loading csquotes is recommended +% to ensure that quoted texts are typeset according to the rules of your main language. +% +\usepackage{csquotes} + +% +% captions +% +\definecolor{caption-color}{HTML}{777777} +$if(beamer)$ +$else$ +\usepackage[font={stretch=1.2}, textfont={color=caption-color}, position=top, skip=4mm, labelfont=bf, singlelinecheck=false, justification=$if(caption-justification)$$caption-justification$$else$raggedright$endif$]{caption} +\setcapindent{0em} +$endif$ + +% +% blockquote +% +\definecolor{blockquote-border}{RGB}{221,221,221} +\definecolor{blockquote-text}{RGB}{119,119,119} +\usepackage{mdframed} +\newmdenv[rightline=false,bottomline=false,topline=false,linewidth=3pt,linecolor=blockquote-border,skipabove=\parskip]{customblockquote} +\renewenvironment{quote}{\begin{customblockquote}\list{}{\rightmargin=0em\leftmargin=0em}% +\item\relax\color{blockquote-text}\ignorespaces}{\unskip\unskip\endlist\end{customblockquote}} + +% +% Source Sans Pro as the default font family +% Source Code Pro for monospace text +% +% 'default' option sets the default +% font family to Source Sans Pro, not \sfdefault. +% +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + $if(fontfamily)$ + $else$ + \usepackage[default]{sourcesanspro} + \usepackage{sourcecodepro} + $endif$ +\else % if not pdftex + $if(mainfont)$ + $else$ + \usepackage[default]{sourcesanspro} + \usepackage{sourcecodepro} + + % XeLaTeX specific adjustments for straight quotes: https://tex.stackexchange.com/a/354887 + % This issue is already fixed (see https://github.com/silkeh/latex-sourcecodepro/pull/5) but the + % fix is still unreleased. + % TODO: Remove this workaround when the new version of sourcecodepro is released on CTAN. + \ifxetex + \makeatletter + \defaultfontfeatures[\ttfamily] + { Numbers = \sourcecodepro@figurestyle, + Scale = \SourceCodePro@scale, + Extension = .otf } + \setmonofont + [ UprightFont = *-\sourcecodepro@regstyle, + ItalicFont = *-\sourcecodepro@regstyle It, + BoldFont = *-\sourcecodepro@boldstyle, + BoldItalicFont = *-\sourcecodepro@boldstyle It ] + {SourceCodePro} + \makeatother + \fi + $endif$ +\fi + +% +% heading color +% +\definecolor{heading-color}{RGB}{40,40,40} +$if(beamer)$ +$else$ +\addtokomafont{section}{\color{heading-color}} +$endif$ +% When using the classes report, scrreprt, book, +% scrbook or memoir, uncomment the following line. +%\addtokomafont{chapter}{\color{heading-color}} + +% +% variables for title, author and date +% +$if(beamer)$ +$else$ +\usepackage{titling} +\title{$title$} +\author{$for(author)$$author$$sep$, $endfor$} +\date{$date$} +$endif$ + +% +% tables +% +$if(tables)$ + +\definecolor{table-row-color}{HTML}{F5F5F5} +\definecolor{table-rule-color}{HTML}{999999} + +%\arrayrulecolor{black!40} +\arrayrulecolor{table-rule-color} % color of \toprule, \midrule, \bottomrule +\setlength\heavyrulewidth{0.3ex} % thickness of \toprule, \bottomrule +\renewcommand{\arraystretch}{1.3} % spacing (padding) + +$if(table-use-row-colors)$ +% Unfortunately the colored cells extend beyond the edge of the +% table because pandoc uses @-expressions (@{}) like so: +% +% \begin{longtable}[]{@{}ll@{}} +% \end{longtable} +% +% https://en.wikibooks.org/wiki/LaTeX/Tables#.40-expressions +\usepackage{etoolbox} +\AtBeginEnvironment{longtable}{\rowcolors{2}{}{table-row-color!100}} +\preto{\toprule}{\hiderowcolors}{}{} +\appto{\endhead}{\showrowcolors}{}{} +\appto{\endfirsthead}{\showrowcolors}{}{} +$endif$ +$endif$ + +% +% remove paragraph indentation +% +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +\setlength{\emergencystretch}{3em} % prevent overfull lines + +% +% +% Listings +% +% + +$if(listings)$ + +% +% general listing colors +% +\definecolor{listing-background}{HTML}{F7F7F7} +\definecolor{listing-rule}{HTML}{B3B2B3} +\definecolor{listing-numbers}{HTML}{B3B2B3} +\definecolor{listing-text-color}{HTML}{000000} +\definecolor{listing-keyword}{HTML}{435489} +\definecolor{listing-keyword-2}{HTML}{1284CA} % additional keywords +\definecolor{listing-keyword-3}{HTML}{9137CB} % additional keywords +\definecolor{listing-identifier}{HTML}{435489} +\definecolor{listing-string}{HTML}{00999A} +\definecolor{listing-comment}{HTML}{8E8E8E} + +\lstdefinestyle{eisvogel_listing_style}{ + language = java, +$if(listings-disable-line-numbers)$ + xleftmargin = 0.6em, + framexleftmargin = 0.4em, +$else$ + numbers = left, + xleftmargin = 2.7em, + framexleftmargin = 2.5em, +$endif$ + backgroundcolor = \color{listing-background}, + basicstyle = \color{listing-text-color}\linespread{1.0}% + \lst@ifdisplaystyle% + $if(code-block-font-size)$$code-block-font-size$$else$\small$endif$% + \fi\ttfamily{}, + breaklines = true, + frame = single, + framesep = 0.19em, + rulecolor = \color{listing-rule}, + frameround = ffff, + tabsize = 4, + numberstyle = \color{listing-numbers}, + aboveskip = 1.0em, + belowskip = 0.1em, + abovecaptionskip = 0em, + belowcaptionskip = 1.0em, + keywordstyle = {\color{listing-keyword}\bfseries}, + keywordstyle = {[2]\color{listing-keyword-2}\bfseries}, + keywordstyle = {[3]\color{listing-keyword-3}\bfseries\itshape}, + sensitive = true, + identifierstyle = \color{listing-identifier}, + commentstyle = \color{listing-comment}, + stringstyle = \color{listing-string}, + showstringspaces = false, + escapeinside = {/*@}{@*/}, % Allow LaTeX inside these special comments + literate = + {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 + {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 + {à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 + {À}{{\`A}}1 {È}{{\`E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 + {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 + {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 + {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1 + {Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1 + {œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1 + {ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 {å}{{\r a}}1 {Å}{{\r A}}1 + {€}{{\EUR}}1 {£}{{\pounds}}1 {«}{{\guillemotleft}}1 + {»}{{\guillemotright}}1 {ñ}{{\~n}}1 {Ñ}{{\~N}}1 {¿}{{?`}}1 + {…}{{\ldots}}1 {≥}{{>=}}1 {≤}{{<=}}1 {„}{{\glqq}}1 {“}{{\grqq}}1 + {”}{{''}}1 +} +\lstset{style=eisvogel_listing_style} + +% +% Java (Java SE 12, 2019-06-22) +% +\lstdefinelanguage{Java}{ + morekeywords={ + % normal keywords (without data types) + abstract,assert,break,case,catch,class,continue,default, + do,else,enum,exports,extends,final,finally,for,if,implements, + import,instanceof,interface,module,native,new,package,private, + protected,public,requires,return,static,strictfp,super,switch, + synchronized,this,throw,throws,transient,try,volatile,while, + % var is an identifier + var + }, + morekeywords={[2] % data types + % primitive data types + boolean,byte,char,double,float,int,long,short, + % String + String, + % primitive wrapper types + Boolean,Byte,Character,Double,Float,Integer,Long,Short + % number types + Number,AtomicInteger,AtomicLong,BigDecimal,BigInteger,DoubleAccumulator,DoubleAdder,LongAccumulator,LongAdder,Short, + % other + Object,Void,void + }, + morekeywords={[3] % literals + % reserved words for literal values + null,true,false, + }, + sensitive, + morecomment = [l]//, + morecomment = [s]{/*}{*/}, + morecomment = [s]{/**}{*/}, + morestring = [b]", + morestring = [b]', +} + +\lstdefinelanguage{XML}{ + morestring = [b]", + moredelim = [s][\bfseries\color{listing-keyword}]{<}{\ }, + moredelim = [s][\bfseries\color{listing-keyword}]{}, + moredelim = [l][\bfseries\color{listing-keyword}]{/>}, + moredelim = [l][\bfseries\color{listing-keyword}]{>}, + morecomment = [s]{}, + morecomment = [s]{}, + commentstyle = \color{listing-comment}, + stringstyle = \color{listing-string}, + identifierstyle = \color{listing-identifier} +} +$endif$ + +% +% header and footer +% +$if(beamer)$ +$else$ +$if(disable-header-and-footer)$ +$else$ +\usepackage[headsepline,footsepline]{scrlayer-scrpage} + +\newpairofpagestyles{eisvogel-header-footer}{ + \clearpairofpagestyles + \ihead*{$if(header-left)$$header-left$$else$$title$$endif$} + \chead*{$if(header-center)$$header-center$$else$$endif$} + \ohead*{$if(header-right)$$header-right$$else$$date$$endif$} + \ifoot*{$if(footer-left)$$footer-left$$else$$for(author)$$author$$sep$, $endfor$$endif$} + \cfoot*{$if(footer-center)$$footer-center$$else$$endif$} + \ofoot*{$if(footer-right)$$footer-right$$else$\thepage$endif$} + \addtokomafont{pageheadfoot}{\upshape} +} +\pagestyle{eisvogel-header-footer} + +$if(book)$ +\deftripstyle{ChapterStyle}{}{}{}{}{\pagemark}{} +\renewcommand*{\chapterpagestyle}{ChapterStyle} +$endif$ + +$if(page-background)$ +\backgroundsetup{ +scale=1, +color=black, +opacity=$if(page-background-opacity)$$page-background-opacity$$else$0.2$endif$, +angle=0, +contents={% + \includegraphics[width=\paperwidth,height=\paperheight]{$page-background$} + }% +} +$endif$ +$endif$ +$endif$ + +%% +%% end added +%% + +\begin{document} + +%% +%% begin titlepage +%% +$if(beamer)$ +$else$ +$if(titlepage)$ +\begin{titlepage} +$if(titlepage-background)$ +\newgeometry{top=2cm, right=4cm, bottom=3cm, left=4cm} +$else$ +\newgeometry{left=6cm} +$endif$ $if(titlepage-color)$ \definecolor{titlepage-color}{HTML}{$titlepage-color$} \newpagecolor{titlepage-color}\afterpage{\restorepagecolor} $endif$ -$if(titlepage-text-color)$ -\definecolor{titlepage-text-color}{HTML}{$titlepage-text-color$} -\else -\definecolor{titlepage-text-color}{HTML}{5F5F5F} -$endif$ -$if(titlepage-rule-color)$ -\definecolor{titlepage-rule-color}{HTML}{$titlepage-rule-color$} -\else -\definecolor{titlepage-rule-color}{HTML}{2e6c80} -$endif$ -\newgeometry{left=0cm,right=0cm,bottom=0cm} -\begin{titlepage} -\thispagestyle{empty} $if(titlepage-background)$ \tikz[remember picture,overlay] \node[inner sep=0pt] at (current page.center){\includegraphics[width=\paperwidth,height=\paperheight]{$titlepage-background$}}; $endif$ +\newcommand{\colorRule}[3][black]{\textcolor[HTML]{#1}{\rule{#2}{#3}}} +\begin{flushleft} \noindent -\begin{minipage}[c][\textheight]{1\textwidth} - \centering - \vspace*{3cm} - \begingroup - \color{titlepage-text-color} - \HRule\\[0.4cm] - {\huge\textbf{$title$}}\\ - \HRule\\[0.5cm] - $if(subtitle)$ - {\Large $subtitle$}\\[0.5cm] - $endif$ - $if(titlepage-logo)$ - \includegraphics[width=$if(logo-width)$$logo-width$$else$10cm$endif$]{$titlepage-logo$}\\[0.5cm] - $endif$ - $if(affiliation)$ - {\large $for(affiliation)$$affiliation$$sep$\\[1em] $endfor$}\\ - $endif$ - \vfill - $if(author)$ - {\large $for(author)$$author$$sep$\\[1em] $endfor$}\\[1em] - $endif$ - {\large $date$}\\[1em] - \vfill - \endgroup -\end{minipage} +\\[-1em] +\color[HTML]{$if(titlepage-text-color)$$titlepage-text-color$$else$5F5F5F$endif$} +\makebox[0pt][l]{\colorRule[$if(titlepage-rule-color)$$titlepage-rule-color$$else$435488$endif$]{1.3\textwidth}{$if(titlepage-rule-height)$$titlepage-rule-height$$else$4$endif$pt}} +\par +\noindent + +$if(titlepage-background)$ +% The titlepage with a background image has other text spacing and text size +{ + \setstretch{2} + \vfill + \vskip -8em + \noindent {\huge \textbf{\textsf{$title$}}} + $if(subtitle)$ + \vskip 1em + {\Large \textsf{$subtitle$}} + $endif$ + \vskip 2em + \noindent {\Large \textsf{$for(author)$$author$$sep$, $endfor$} \vskip 0.6em \textsf{$date$}} + \vfill +} +$else$ +{ + \setstretch{1.4} + \vfill + \noindent {\huge \textbf{\textsf{$title$}}} + $if(subtitle)$ + \vskip 1em + {\Large \textsf{$subtitle$}} + $endif$ + \vskip 2em + \noindent {\Large \textsf{$for(author)$$author$$sep$, $endfor$}} + \vfill +} +$endif$ + +$if(titlepage-logo)$ +\noindent +\includegraphics[width=$if(logo-width)$$logo-width$$else$35mm$endif$, left]{$titlepage-logo$} +$endif$ + +$if(titlepage-background)$ +$else$ +\textsf{$date$} +$endif$ +\end{flushleft} \end{titlepage} \restoregeometry +\pagenumbering{arabic} $endif$ +$endif$ + %% %% end titlepage %% -%% -%% begin custom colors and commands -%% - -% Define custom colors -\definecolor{heading-color}{RGB}{40,40,40} -\definecolor{caption-color}{HTML}{777777} -\definecolor{blockquote-border}{RGB}{221,221,221} -\definecolor{blockquote-text}{RGB}{119,119,119} - -% Define custom commands -\newcommand{\customheading}[1]{\color{heading-color}\textbf{#1}} -\newcommand{\customcaption}[1]{\color{caption-color}\small\textit{#1}} - -%% -%% end custom colors and commands -%% - -%% -%% begin document -%% - $if(has-frontmatter)$ \frontmatter $endif$ $if(title)$ $if(beamer)$ \frame{\titlepage} +% don't generate the default title +% $else$ +% \maketitle $endif$ $if(abstract)$ \begin{abstract} @@ -570,7 +1021,7 @@ $if(toc-title)$ \renewcommand*\contentsname{$toc-title$} $endif$ $if(beamer)$ -\begin{frame} +\begin{frame}[allowframebreaks] $if(toc-title)$ \frametitle{$toc-title$} $endif$ @@ -582,9 +1033,9 @@ $endif$ $else$ { $if(colorlinks)$ -\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$default-linkcolor$endif$} +\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$} $endif$ -\setcounter{tocdepth}{$if(toc-depth)$$toc-depth$$else$3$endif$} +\setcounter{tocdepth}{$toc-depth$} \tableofcontents $if(toc-own-page)$ \newpage @@ -592,12 +1043,12 @@ $endif$ } $endif$ $endif$ -$if(lot)$ -\listoftables -$endif$ $if(lof)$ \listoffigures $endif$ +$if(lot)$ +\listoftables +$endif$ $if(linestretch)$ \setstretch{$linestretch$} $endif$ From 6ef04db16758eff6ff57f15f84470e588b20ea32 Mon Sep 17 00:00:00 2001 From: Kai <37978933+froeb@users.noreply.github.com> Date: Tue, 21 May 2024 01:32:28 +0100 Subject: [PATCH 7/9] Update README.md Comments for changes (see changelog) --- README.md | 73 ++++++++++++++++++++----------------------------------- 1 file changed, 26 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 03121f8..0affcc2 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ For frequent command line use, you can define the following shell alias: ``` bash - +Copy code alias pandock='docker run --rm -v "$(pwd):/data" -u $(id -u):$(id -g) pandoc/extra' ``` @@ -49,7 +49,7 @@ The example invocation with Docker from above now looks like this: ``` bash - +Copy code pandock example.md -o example.pdf --template eisvogel --listings ``` @@ -61,23 +61,21 @@ pandock example.md -o example.pdf --template eisvogel --listings ``` bash - + Copy code pandoc example.md -o example.pdf --from markdown --template eisvogel --listings ``` where `example.md` is the markdown file you want to convert to PDF. -In order to have nice headers and footers you need to supply metadata to your document. You can do that with a [YAML metadata block](http://pandoc.org/MANUAL.html#extension-yaml_metadata_block) at the top of your markdown document (see the [example markdown file](https://chatgpt.com/c/examples/basic-example/document.md)). Your markdown document may look like the following: +In order to have nice headers and footers you need to supply metadata to your document. You can do that with a [YAML metadata block](http://pandoc.org/MANUAL.html#extension-yaml_metadata_block) at the top of your markdown document (see the [example markdown file](https://github.com/Wandmalfarbe/pandoc-latex-template/blob/master/examples/basic-example/document.md)). Your markdown document may look like the following: ``` ---- +yamlCopy code--- title: "The Document Title" author: [Example Author, Another Author] date: "2017-02-20" keywords: [Markdown, Example] ... - -Here is the actual document text... ``` ### Custom Template Variables @@ -136,7 +134,7 @@ This template defines some new variables to control the appearance of the result avoid page break inside listings -- `disable-header-and-footer` (default to `false`) +- `disable-header-and-footer` (defaults to `false`) disables the header and footer completely on all pages @@ -222,7 +220,7 @@ This template defines some new variables to control the appearance of the result LaTeX manages addons and additional functionality in so called packages. You might get the following error when compiling a document with the Eisvogel template: ``` -sh! LaTeX Error: File `footnotebackref.sty' not found. +shCopy code! LaTeX Error: File `footnotebackref.sty' not found. Type X to quit or to proceed, or enter new name. (Default extension: sty) @@ -240,18 +238,9 @@ Eisvogel requires a full texlive distribution that can be installed by running ` A smaller texlive bundle is `texlive-latex-extra`. With `texlive-latex-extra` you also need to install these packages manually: -``` -arduinoadjustbox babel-german background bidi collectbox csquotes everypage filehook -footmisc footnotebackref framed fvextra letltxmacro ly1 mdframed mweights -needspace pagecolor sourcecodepro sourcesanspro titling ucharcat ulem -unicode-math upquote xecjk xurl zref -``` - -Install them with the following command: - ``` sh - +Copy code tlmgr install adjustbox babel-german background bidi collectbox csquotes everypage filehook footmisc footnotebackref framed fvextra letltxmacro ly1 mdframed mweights needspace pagecolor sourcecodepro sourcesanspro titling ucharcat ulem unicode-math upquote xecjk xurl zref ``` @@ -278,7 +267,7 @@ For PDFs with [numbered sections](http://pandoc.org/MANUAL.html#options-affectin ``` bash - +Copy code pandoc example.md -o example.pdf --template eisvogel --number-sections ``` @@ -288,7 +277,7 @@ You can get syntax highlighting of delimited code blocks by using the LaTeX pack ``` bash - +Copy code pandoc example.md -o example.pdf --template eisvogel --listings ``` @@ -297,17 +286,9 @@ pandoc example.md -o example.pdf --template eisvogel --listings The following examples show [syntax highlighting of delimited code blocks](http://pandoc.org/MANUAL.html#syntax-highlighting) without using listings. To see a list of all the supported highlight styles, type `pandoc --list-highlight-styles`. ``` -bash - -pandoc example.md -o example.pdf --template eisvogel --highlight-style pygments -bash - +bashCopy codepandoc example.md -o example.pdf --template eisvogel --highlight-style pygments pandoc example.md -o example.pdf --template eisvogel --highlight-style kate -bash - pandoc example.md -o example.pdf --template eisvogel --highlight-style espresso -bash - pandoc example.md -o example.pdf --template eisvogel --highlight-style tango ``` @@ -317,7 +298,7 @@ To produce a standalone LaTeX document for compiling with any LaTeX editor use ` ``` bash - +Copy code pandoc example.md -o example.tex --template eisvogel ``` @@ -327,7 +308,7 @@ The default language of this template is American English. The `lang` variable i ``` bash - +Copy code pandoc example.md -o example.pdf --template eisvogel -V lang=en-GB ``` @@ -335,7 +316,7 @@ The following example changes the language to German: ``` bash - +Copy code pandoc example.md -o example.pdf --template eisvogel -V lang=de ``` @@ -351,19 +332,19 @@ There will be one blank page before each chapter because the template is two-sid | A green title page | A background image on the title page | | :----------------------------------------------------------: | :----------------------------------------------------------: | -| [![A green title page](https://chatgpt.com/c/examples/title-page-green/preview.png)](https://chatgpt.com/c/examples/title-page-green/document.pdf) | [![A background image on the title page](https://chatgpt.com/c/examples/title-page-background/preview.png)](https://chatgpt.com/c/examples/title-page-background/document.pdf) | +| [![A green title page](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/title-page-green/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/title-page-green/document.pdf) | [![A background image on the title page](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/title-page-background/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/title-page-background/document.pdf) | | images and tables | Code blocks styled without listings | | :----------------------------------------------------------: | :----------------------------------------------------------: | -| [![images and tables](https://chatgpt.com/c/examples/images-and-tables/preview.png)](https://chatgpt.com/c/examples/images-and-tables/document.pdf) | [![Code blocks styled without listings](https://chatgpt.com/c/examples/code-blocks-without-listings/preview.png)](https://chatgpt.com/c/examples/code-blocks-without-listings/document.pdf) | +| [![images and tables](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/images-and-tables/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/images-and-tables/document.pdf) | [![Code blocks styled without listings](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/code-blocks-without-listings/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/code-blocks-without-listings/document.pdf) | | A book | Code blocks styled with listings | | :----------------------------------------------------------: | :----------------------------------------------------------: | -| [![A book](https://chatgpt.com/c/examples/book/preview.png)](https://chatgpt.com/c/examples/book/document.pdf) | [![Code blocks styled with listings](https://chatgpt.com/c/examples/code-blocks-listings/preview.png)](https://chatgpt.com/c/examples/code-blocks-listings/document.pdf) | +| [![A book](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/book/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/book/document.pdf) | [![Code blocks styled with listings](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/code-blocks-listings/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/code-blocks-listings/document.pdf) | | A background images on all pages | CJK Support (when using XeLaTeX) | | :----------------------------------------------------------: | :----------------------------------------------------------: | -| [![A background images on all pages](https://chatgpt.com/c/examples/page-background/preview.png)](https://chatgpt.com/c/examples/page-background/document.pdf) | [![CJK Support (when using XeLaTeX)](https://chatgpt.com/c/examples/language-japanese/preview.png)](https://chatgpt.com/c/examples/language-japanese/document.pdf) | +| [![A background images on all pages](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/page-background/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/page-background/document.pdf) | [![CJK Support (when using XeLaTeX)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/language-japanese/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/language-japanese/document.pdf) | ## Common Errors / Issues @@ -372,7 +353,7 @@ The following section lists common errors and their solutions when using the Eis ### LaTeX Errors `Missing endcsname inserted` or `File x not found` when using `titlepage-background`, `logo`, or `titlepage-logo`. ``` -latexError producing PDF. +vbnetCopy codelatexError producing PDF. ! Missing endcsname inserted. protect @@ -390,7 +371,7 @@ A quick fix would be to replace all underscores in the filename of the image wit ``` yaml - +Copy code titlepage-background: "background_image.pdf" ``` @@ -398,7 +379,7 @@ you can advise pandoc to interpret this as LaTeX and include it in the document ``` yaml - +Copy code titlepage-background: "`background_image.pdf`{=latex}" ``` @@ -406,7 +387,7 @@ The same fix can be used for the logo image as well: ``` yaml - +Copy code logo: "`logo_image.pdf`{=latex}" ``` @@ -418,7 +399,7 @@ Corresponding issues: ### LaTeX Error `Missing \begin{document}` ``` -javascript! LaTeX Error: Missing \begin{document}. +javascriptCopy code! LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. @@ -434,8 +415,7 @@ This error indicates that you try to use some text file for conversion that is n ### LaTeX Error `auto expansion is only possible with scalable fonts` ``` -latexError producing PDF. -! pdfTeX error (font expansion): auto expansion is only possible with scalable +latexCopy code! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts. \AtBegShi@Output ...ipout \box \AtBeginShipoutBox \fi \fi @@ -453,8 +433,7 @@ Corresponding issue: ### LaTeX Error `cannot find image file` ``` -latexError producing PDF. -! error: (file "/tmp/tex2pdf.-be734e802ef6d0c3/""fdcfc29edcf252186f1b0a52f18f50 +latexCopy code! error: (file "/tmp/tex2pdf.-be734e802ef6d0c3/""fdcfc29edcf252186f1b0a52f18f50 43abaeb2d0".png) (pdf backend): cannot find image file '"/tmp/tex2pdf.-be734e802 ef6d0c3/""fdcfc29edcf252186f1b0a52f18f5043abaeb2d0".png' ! ==> Fatal error occurred, no output PDF file produced! @@ -475,4 +454,4 @@ Corresponding issues: ## License -This project is open source licensed under the BSD 3-Clause License. Please see the [LICENSE file](https://chatgpt.com/c/LICENSE) for more information. +This project is open source licensed under the BSD 3-Clause License. Please see the [LICENSE file](https://github.com/Wandmalfarbe/pandoc-latex-template/blob/master/LICENSE) for more information. From 316c2f632858c19d3c5c8237d4e0efbed36e1926 Mon Sep 17 00:00:00 2001 From: Kai <37978933+froeb@users.noreply.github.com> Date: Tue, 21 May 2024 01:37:56 +0100 Subject: [PATCH 8/9] Update CHANGELOG.md documented latest changes --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 638f5f1..d369332 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,13 +12,18 @@ All notable changes to this project are documented in this file. On the [release - Support for custom background images on title pages and all pages. - Flexible geometry settings for title page layout. - Enhanced handling of paragraph and list spacing. +- New variables for header and footer customization: 'header-left','header-center', 'header-right', `footer-center`, `footer-left`, and `footer-right`. +- Customizable copyright text (default usage for footer-left) through a new `\copyrighttext` macro. ### Changed - Updated README.md to include detailed instructions on using and customizing the template. - Integrated custom styling options directly into the template for better user experience. +- Enhanced flexibility for setting date values via the `date` variable. +- Default behavior for `footer-right` now includes the total page count (`\thepage{} / \pageref{LastPage}`). ### Fixed - Minor formatting issues and improved compatibility with various LaTeX distributions. +- Corrected handling of page numbers in the footer to prevent duplication. ## [2.4.2] - 2023-11-25 From 72d42614e32f3943a5d1a6214f1618a5d77edf06 Mon Sep 17 00:00:00 2001 From: Kai <37978933+froeb@users.noreply.github.com> Date: Tue, 21 May 2024 03:10:43 +0100 Subject: [PATCH 9/9] Update eisvogel.tex latest changes where missing in the previous update --- eisvogel.tex | 86 ++++++++++++++-------------------------------------- 1 file changed, 23 insertions(+), 63 deletions(-) diff --git a/eisvogel.tex b/eisvogel.tex index 109cb83..4b2add4 100644 --- a/eisvogel.tex +++ b/eisvogel.tex @@ -151,15 +151,15 @@ $if(mathspec)$ $else$ \usepackage{unicode-math} % this also loads fontspec $endif$ - \defaultfontfeatures{Scale=MatchLowercase}$-- must come before Beamer theme + \defaultfontfeatures{Scale=MatchLowercase}% must come before Beamer theme \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} \fi $if(fontfamily)$ $else$ -$-- Set default font before Beamer theme so the theme can override it +% Set default font before Beamer theme so the theme can override it \usepackage{lmodern} $endif$ -$-- Set Beamer theme before user font settings so they can override theme +% Set Beamer theme before user font settings so they can override theme $if(beamer)$ $if(theme)$ \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$} @@ -180,7 +180,7 @@ $if(outertheme)$ \useoutertheme{$outertheme$} $endif$ $endif$ -$-- User font settings (must come after default font and Beamer theme) +% User font settings (must come after default font and Beamer theme) $if(fontfamily)$ \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} $endif$ @@ -384,7 +384,7 @@ $if(svg)$ \usepackage{svg} $endif$ $if(strikeout)$ -$-- also used for underline +% also used for underline \ifLuaTeX \usepackage{luacolor} \usepackage[soul]{lua-ul} @@ -497,9 +497,9 @@ $if(dir)$ \ifPDFTeX \TeXXeTstate=1 \newcommand{\RL}[1]{\beginR #1\endR} - \newcommand{\LR}[1]{\beginL #1\endL} + \newcommand{\LR}[1]{\beginL #1\endR} \newenvironment{RTL}{\beginR}{\endR} - \newenvironment{LTR}{\beginL}{\endL} + \newenvironment{LTR}{\beginL}{\endR} \fi $endif$ $if(natbib)$ @@ -570,7 +570,7 @@ $else$ $endif$ \subtitle{$subtitle$} $endif$ -\author{$for(author)$$author$$sep$ \and $endfor$} +\author{$for(author)$$author$$sep$, $endfor$} \date{$date$} $if(beamer)$ $if(institute)$ @@ -584,19 +584,11 @@ $if(logo)$ $endif$ $endif$ - - -%% -%% added -%% - $if(page-background)$ \usepackage[pages=all]{background} $endif$ -% % for the background color of the title page -% $if(titlepage)$ \usepackage{pagecolor} \usepackage{afterpage} @@ -609,20 +601,14 @@ $else$ $endif$ $endif$ -% % break urls -% \PassOptionsToPackage{hyphens}{url} -% % When using babel or polyglossia with biblatex, loading csquotes is recommended % to ensure that quoted texts are typeset according to the rules of your main language. -% \usepackage{csquotes} -% % captions -% \definecolor{caption-color}{HTML}{777777} $if(beamer)$ $else$ @@ -630,9 +616,7 @@ $else$ \setcapindent{0em} $endif$ -% % blockquote -% \definecolor{blockquote-border}{RGB}{221,221,221} \definecolor{blockquote-text}{RGB}{119,119,119} \usepackage{mdframed} @@ -640,13 +624,10 @@ $endif$ \renewenvironment{quote}{\begin{customblockquote}\list{}{\rightmargin=0em\leftmargin=0em}% \item\relax\color{blockquote-text}\ignorespaces}{\unskip\unskip\endlist\end{customblockquote}} -% % Source Sans Pro as the default font family % Source Code Pro for monospace text -% % 'default' option sets the default % font family to Source Sans Pro, not \sfdefault. -% \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex $if(fontfamily)$ $else$ @@ -671,18 +652,16 @@ $endif$ Extension = .otf } \setmonofont [ UprightFont = *-\sourcecodepro@regstyle, - ItalicFont = *-\sourcecodepro@regstyle It, - BoldFont = *-\sourcecodepro@boldstyle, - BoldItalicFont = *-\sourcecodepro@boldstyle It ] + ItalicFont = *-\regstyle It, + BoldFont = *-\boldstyle, + BoldItalicFont = *-\boldstyle It ] {SourceCodePro} \makeatother \fi $endif$ \fi -% % heading color -% \definecolor{heading-color}{RGB}{40,40,40} $if(beamer)$ $else$ @@ -692,9 +671,7 @@ $endif$ % scrbook or memoir, uncomment the following line. %\addtokomafont{chapter}{\color{heading-color}} -% % variables for title, author and date -% $if(beamer)$ $else$ \usepackage{titling} @@ -703,11 +680,8 @@ $else$ \date{$date$} $endif$ -% % tables -% $if(tables)$ - \definecolor{table-row-color}{HTML}{F5F5F5} \definecolor{table-rule-color}{HTML}{999999} @@ -732,24 +706,14 @@ $if(table-use-row-colors)$ $endif$ $endif$ -% % remove paragraph indentation -% \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em} % prevent overfull lines -% -% % Listings -% -% - $if(listings)$ - -% % general listing colors -% \definecolor{listing-background}{HTML}{F7F7F7} \definecolor{listing-rule}{HTML}{B3B2B3} \definecolor{listing-numbers}{HTML}{B3B2B3} @@ -799,8 +763,8 @@ $endif$ literate = {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 - {à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 - {À}{{\`A}}1 {È}{{\`E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 + {à}{{\`a}}1 {è}{{\'e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 + {À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1 @@ -814,9 +778,7 @@ $endif$ } \lstset{style=eisvogel_listing_style} -% -% Java (Java SE 12, 2019-06-22) -% +% Java (Java SE 12, 9, 2022-09-22) \lstdefinelanguage{Java}{ morekeywords={ % normal keywords (without data types) @@ -866,23 +828,26 @@ $endif$ } $endif$ -% % header and footer -% $if(beamer)$ $else$ $if(disable-header-and-footer)$ $else$ \usepackage[headsepline,footsepline]{scrlayer-scrpage} +\usepackage{lastpage} % Add this line to include the lastpage package + +\newcommand{\authors}{$for(author)$$author$$sep$, $endfor$} +\newcommand{\copyyear}{$date$} +\newcommand{\copyrighttext}{$if(copyright)$$copyright$$else$© \copyyear{} by \authors. All rights reserved.$endif$} \newpairofpagestyles{eisvogel-header-footer}{ \clearpairofpagestyles \ihead*{$if(header-left)$$header-left$$else$$title$$endif$} \chead*{$if(header-center)$$header-center$$else$$endif$} \ohead*{$if(header-right)$$header-right$$else$$date$$endif$} - \ifoot*{$if(footer-left)$$footer-left$$else$$for(author)$$author$$sep$, $endfor$$endif$} + \ifoot*{$if(footer-left)$$footer-left$$else$\copyrighttext$endif$} \cfoot*{$if(footer-center)$$footer-center$$else$$endif$} - \ofoot*{$if(footer-right)$$footer-right$$else$\thepage$endif$} + \ofoot*{$if(footer-right)$$footer-right$$else$\thepage{} / \pageref{LastPage}$endif$} \addtokomafont{pageheadfoot}{\upshape} } \pagestyle{eisvogel-header-footer} @@ -906,10 +871,6 @@ $endif$ $endif$ $endif$ -%% -%% end added -%% - \begin{document} %% @@ -996,9 +957,8 @@ $endif$ $if(title)$ $if(beamer)$ \frame{\titlepage} -% don't generate the default title -% $else$ -% \maketitle +$else$ +% \maketitle % Comment or remove this line to avoid printing title, subtitle, author, and date on the first page after the title page. $endif$ $if(abstract)$ \begin{abstract}