crowdagger / crowbook

Converts books written in Markdown to HTML, LaTeX/PDF and EPUB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] How to add license to a single file book?

Geobert opened this issue · comments

I have a short story so it doesn't have chapters. I'm generating the pdf and epub using the -s flag. I want to add the license of the text to both format but I can't find my way though it :-/

PDF: I've printed the tex.template, and see a redefinition of \maketitle but it is used only for book, I can't find the one used if it's not a book.

EPUB: I've printed the template using the command on the doc, but can't see how to add the license on the title page

Also, what's the autograph metadata? It was added without documentation :)

Replying to myself for the EPUB part: we can't add license to the title page, as its template is hardcoded and no option allows to replace it. I'm working on a patch for this

Fixes the EPUB part in #105 allowing to override the epub.titlepage.xhtml template.
For pdf, I added this to the template:

<<^book>>
% Redefine the \maketitle command, for single file stories (not used if book option is set to true)
\renewcommand{\maketitle}{
  \thispagestyle{plain}
  % title, title, subtitle, date, license
  \begin{center}  
    {\LARGE \@title \par}%
    \vskip 1.5em%
    {\large
      \lineskip .5em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    <<#has_date>>{\vskip 1em \large \@date}<</has_date>>
    <<#has_license>>{\vskip .2em \small Texte sous license <<&license>>}<</has_license>>
  \end{center}
  \par
  \vskip 1.5em
}
<</book>>