Closed naeluh closed 6 years ago
Try putting this inside a conditional
$if(navpage)$
...
$endif$
That variable is set for nav.xhtml but not the other pages.
@jgm thanks this worked
Is there a way to expose more of these variables from the template?
By 'expose' do you mean 'document' or something else?
Many of the template variables are documented, but navpage
is designed to be set internally by pandoc, which is probably why it wasn't.
Version: pandoc 2.2.3.2 Compiled with pandoc-types 1.17.5.1, texmath 0.11.0.1, skylighting 0.7.2 Copyright (C) 2006-2018 John MacFarlane
I was trying to alter the table of contents by downloading the template by using
pandoc -D epub3
Then I added
to the template
then to access the template and new variable I added the appropriate flags
--toc --toc-depth=2 --template=template.xhtml -V toc-title:'Table of Contents'
Here is the full command:
The expected behavior was:
That
$if(toc)$
would becometrue
one time on the Table of Contents page and alter the output of the generated Table of ContentsThe actual behavior was:
Table of Contents and a link to the chapter was printed atop every chapter page generated.