Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use code-block-font-size from the command line #356

Open
nluetts opened this issue Aug 23, 2023 · 1 comment
Open

Cannot use code-block-font-size from the command line #356

nluetts opened this issue Aug 23, 2023 · 1 comment

Comments

@nluetts
Copy link

nluetts commented Aug 23, 2023

Hi,

thanks for this great template!

I tried setting the font size in code listings using pandoc's metadata flag:

pandoc ... -o out.tex ... -M code-block-font-size:\\scriptsize

(or other variants using quotes) but this is parsed to the latex template as \textbackslash scriptsize:

% out.tex
...
\lstdefinestyle{eisvogel_listing_style}{
  language         = java,
  numbers          = left,
  xleftmargin      = 2.7em,
  framexleftmargin = 2.5em,
  backgroundcolor  = \color{listing-background},
  basicstyle       = \color{listing-text-color}\linespread{1.0}%
                      \lst@ifdisplaystyle%
                      \textbackslash scriptsize%
                      \fi\ttfamily{},
...

So in the final PDF, it will just say "\scriptsize" above each listing, instead of changing the font size.

It works with a yaml header, but it seems that currently it cannot work from the command line.
I am not sure if I am just handling the backslash on the command line wrong, however.
I would be grateful for help either way.

@tinmarino
Copy link

I had the same problem, I think this is related to pandoc and not pandoc-latex-template.

Quickfix

Use -V code-block-font-size='\tiny' and not -M

Bad (in YAML)

metadata:
  code-block-font-size: \tiny

Good (in command line)

-V code-block-font-size='\tiny'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants