3 ms·
I'm working on a set of self-published E-books (http://justthebestparts.com http://justthebestparts.com). Among my goals was to be able to publish to the Web w
by jamesbritt 14y ago
I'm working on a set of self-published E-books (http://justthebestparts.com http://justthebestparts.com).
Among my goals was to be able to publish to the Web while writing and have the option for public comments. I also wanted to write the books using Markdown or Textile.
I ended up writing some tools to convert the generated (X)HTML to epub and mobi, and the results are pretty good. However, I also want to have a PDF version and I've yet to find an automated tool that does a good job. I'm deeply skeptical that any tool can take HTML and output nicely formated PDF with proper page breaks, image handling, no dangling sentences or paragraphs, no distracting rivers of white-space in the text, etc.
I'll give this a shot but I'm not sure if there's a better solution than periodically hand-crafting the PDF.
- martininmelb 14y agoIf you're interested in creating a PDF from Markdown, I would suggest that you look at Pandoc (used by wbb). It generates LaTeX from the Markdown and generates a PDF from the LaTeX. I've yet to play with it to see if LaTeX metacommands can be placed in the Markdown.
- anonymouz 14y agoI don't know what your requirements for the handling of images and layout are, but LaTeX does a pretty good job with the type-setting. If you don't do anything to complicated in your HTML or Markdown, it might be worth trying to generate a LaTeX file and generating the PDF from that.
- TylerE 14y agoConTeXt is probably even better if you're doing lots of layouts and inline figures, sidebars, etc.
- jamesbritt 14y agoThanks, this looks interesting. Since I'm also doing epub/mobi there are some limits on how clever I can be, so my PDF needs are not all that sophisticated.