crowdagger / crowbook

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add option to generate `stdpage` output.

hirschenberger opened this issue · comments

Add an option to the latex template, to generate stdpages with fixed size typewriter font and 60 lines per page and extra wide annotation border. This is the standard for sending drafts to lectors (at least in germany).

There's a latex package here which is overriding all styles by just including something like this in the header:

\usepackage[hyphen=false,parskip]{stdpage}

I think it can be easily included as option for the latex template, I can send you a PR, if you think this is good feature?

Yes, it could be something like a tex.stdpage option. I'll look into it, unless you want to send a PR first :)

Just pushed a commit that should implement this, with the tex.stdpage option. I currently use the options you suggested:

\usepackage[hyphen=false,parskip]{stdpage}

I guess it could be possible to allow for more customization by allowing the user to set tex.stdpage to other thing that true or false, e.g.:

tex.stdpage: false # do not use stdpage
tex.stdpage: true # use stdpage with default options
tex.stdpage: "chars=50, lines=30, noindent" # use stdpage with specific options

My current opinion is that if you require this level of customization, you'd probably better provide a custom latex template, but I do not feel very strongly about it, so if you think it's important to provide the option with a way of setting the options provided to stdpage I can implement it.

Great, I'm not sure what the real standard options are. Some say never ever hyphenate but it looks pretty ugly without hyphenation. The creator of the package suggests using hyphenation.

Personally I can live with these settings very well and I assume that a good manuscript was never rejected because of these details.

The current solution assumes an installed stdpage package in the latex distribution.
I've not looked into the licensing of the stdpage package, but perhaps it would be convenient to include the stdpage.sty file in crowbook and execute latex with the distributed file.

Well, honestly the way latex dependencies are currently handled is quite a mess in crowbook (though it's more accurate to say it's not handled at all). I think the first step is to clean the LaTeX template and document clearly what packages it requires, in what circumstances (e.g. the url package should only be necessitated if there is actually an URL in the document, which isn't the case now), and where you can find them; including the less common ones is probably a good idea too (provided licenses allow it) but I think it requires a bit of refactoring before.

As latex is not using package management too, I think it's not a problem as long as there's e.g a list of dependencies on the homepage.
I think the normal latex installation is done by installing two or three huge packages (latex, latex-extras) which includes literally everything and that's it.