>I now have 10+ conditional flags in my book: ifPG13, ifPRINT, ifEBOOK, ifEREADER, etc. I'm looking to add more, but the basic \ifthenelse macro in LaTeX won't be enough...
Makefiles can be your friend... in the file `Makefile` put
.PHONY: all pg13 print ebook ereader
all: pg13 print ebook ereader
pg13: book-pg13.pdf
book-pg13.pdf: mainfile.tex
pdflatex "\setstuffforethisversion\input{mainfile}"
print: book-print.pdf
[etc...]
Then type `make print` or `make ebook` etc at the command line. (This version is almost certainly too simplistic, but I hope the point is clear.)Hm... reading-in the src from the command looks a little brittle, but it's a must try. The makefile will also help with the need to compile 3 times with latex.
It's definitely brittle, but it's brittle along a dimension that usually doesn't change much over the course of the project (paper, book, etc). If you have automatically generated images or tables the benefits can be huge.
`latexmk` solves the "compile many times" problem, and can monitor for changes to the source file in the background.
How hard would it be to implement things like \ref and \pageref and support more of the LaTeX environments supported by MathJax?
I think a triple output format HTML + ePub + LaTeX|PDF|print would be awesome --- I'd switch right away!
Thanks for releasing this as LGPL.