Skip to content

Feature Request: Override titlepage completely (PDF) #260

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

Open
ctjlewis opened this issue Oct 6, 2021 · 4 comments
Open

Feature Request: Override titlepage completely (PDF) #260

ctjlewis opened this issue Oct 6, 2021 · 4 comments

Comments

@ctjlewis
Copy link

ctjlewis commented Oct 6, 2021

I'd like to just design the title page PDF myself and then add it as the title page. This currently does not seem possible, even via workarounds like setting a titlepage background and trying to make the text transparent (titlepage-text-color will not accept transparent values).

@ctjlewis
Copy link
Author

ctjlewis commented Oct 6, 2021

I worked around with frontmatter:

---
header-includes:
  - \usepackage{pdfpages}
---

And, at the top of the document:

\includepdf{Cover.pdf}
\pagebreak

@daamien
Copy link
Contributor

daamien commented Dec 20, 2022

I'm thinking that a titlepage-override-latex parameter would be nice:

$if(titlepage-override-latex)$
  $titlepage-override-latex$
$elseif(titlepage-background)$
{
% The titlepage with a background image has other text spacing and text size
[...]
}
$else$
{
[...]
}
$endif$

@Wandmalfarbe: I'm willing to implement this and the associated tests, if it's ok for you

@daamien
Copy link
Contributor

daamien commented Dec 22, 2022

@ctjlewis: thanks for the idea of using pdfpages ! I wrote a filter that generates the cover based on an SVG template and the pandoc metadata

https://github.com/daamien/pandoc-cover/

By the way, a couple of remarks about your solution:

  • AFAIK The \pagebreak command is not necessary
  • This may not work when the table of content (toc is activated), you insert the cover using the include-before variable
include-before:
   - \includepdf{Cover.pdf}

@pykong
Copy link

pykong commented Mar 21, 2023

I'd also like the ability to override the cover page.
I am not familiar with SVG templates, as used in pandoc-cover.

The ability to use any files supported by pandoc as template is most versatile.
We could use pandoc partials in that respect in order to have variables in that temple be expanded (see jgm/pandoc#5931 (comment)).

Something along the lines of:

\begin{titlepage}
$cover.tex()$
\end{titlepage}

I do not know though how to set the partial dynamically.
I have opened an issue to ask jgm for guidance on this problem:
jgm/doctemplates#23 (comment)

I have also tried to use a template partial within the frontmatter, but this does not get rendered, giving an empty title page with the variable string ad verbatim.

include-before:
   - $cover.tex()$

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

No branches or pull requests

4 participants