Wandmalfarbe / pandoc-latex-template

A pandoc LaTeX template to convert markdown files to PDF or LaTeX.
BSD 3-Clause "New" or "Revised" License
6.09k stars 959 forks source link

Use different variable for titlepage logo for compatibility with Beamer #265

Open mfhepp opened 2 years ago

mfhepp commented 2 years ago

Hi, the current template uses the $logo$ variable from Pandoc to set the path to the title page logo.

Unfortunately, this causes problems when using the same Markdown file for generating both an Eisvogel report and Beamer slides, because the \logo LaTeX command in Beamer will show on any slide as a background image.

It would be better if there was an additional $titlepage-logo$ property for the title-page logo in Eisvogel, because suppressing the use of the logo in Beamer is not trivial and Beamer is very popular.

Proposal: Use a condition in all two of the three sections in eisvogel.tex that deal with $logo$:

Actual Logo:

$if(titlepage-logo)$
\noindent
\includegraphics[width=$if(logo-width)$$logo-width$$else$35mm$endif$, left]{$titlepage-logo$}
$elseif(logo)$
\noindent
\includegraphics[width=$if(logo-width)$$logo-width$$else$35mm$endif$, left]{$logo$}
$endif$

Conditionals: Note: I did not see support for logical connectors like or in Pandoc's template syntax.

$if(titlepage-logo)$
\usepackage[export]{adjustbox}
\usepackage{graphicx}
$elseif(logo)$
\usepackage[export]{adjustbox}
\usepackage{graphicx}
$endif$

Leave Eisvogel's Beamer section untouched:

$if(logo)$
\logo{\includegraphics{$logo$}}
$endif$
mfhepp commented 2 years ago

For those who need a quick workaround:

You can suppress the logo in a Beamer rendering of an Eisvogel Markdown document by invoking Pandoc with the option

--metadata logo=""

This sets the $logo$ variable from the document to an empty string when rendering the document with a Beamer TeX template.