3 ms·
You can compile from LaTeX to HTML with pandoc and then repackage the HTML into an epub using a tool like epubmaker[0]. YMMV though with pandoc, not sure how w
by fny 9y ago
You can compile from LaTeX to HTML with pandoc and then repackage the HTML into an epub using a tool like epubmaker[0].
YMMV though with pandoc, not sure how well it handles more fancy latex macros and packages.
The simplest thing to do might be start with a more HTML-based solution (e.g. Markdown with extensions, RST) and then compile that into whatever layout you intend for the physical/pdf form.
[0]: https://github.com/setanta/ebookmaker https://github.com/setanta/ebookmaker
- eslaught 9y agoPandoc is excellent, but I'd recommend coverting Markdown to LaTeX instead of the other way around. I've tried several LaTeX to X converters (for any value of X other than PS/PDF) and frankly none of them are very good. The advantage of starting with Markdown is that you know that the format is a good match for the tool's internal AST, which makes the results much more predictable. Pandoc has the advantage that you can still write LaTeX directly inline when you need to. You can also write in terms of divs and spans (which Pandoc understands natively) and convert these to whatever you want via filters. The latter approach has the advantage that different filters can generate the appropriate code for the format you're generating, so that you don't just lose the elements when you convert to an incompatible format. Shameless plug: I've built a tool that helps manage the conversion: https://bitbucket.org/elliottslaughter/bookmd https://bitbucket.org/elliottslaughter/bookmd
- emmab 9y agoHTML doesn't have a notion of multiple pages within the same document though?
- dragonwriter 9y ago> HTML doesn't have a notion of multiple pages within the same document though? HTML is at a higher level of abstraction, but the HTML/CSS stack supports paged rendering, and browsers tend to support this for print (pre-Blink Opera did for on-screen use, though I don't know if current browsers do.)
- dredmorbius 9y agoThat depends on what you're talking about. HTML itself is a text markup language, not a styling language. (Well ... mostly.) But through CSS with a paper media-type, you can specify page-based conditions and actions.