News for hackers. Stuff that matters.
Re:Pollen: the book is a program by ivan_ah on Friday May 30, 2014 @01:50PM (#7823085)
This looks very interesting. Books really are code: 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...

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.

Re:Pollen: the book is a program by grayclhn on Saturday May 31, 2014 @01:15AM (#7825338)
>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.)
Re:Pollen: the book is a program by ivan_ah on Saturday May 31, 2014 @11:13AM (#7826217)
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.
Re:Pollen: the book is a program by grayclhn on Saturday May 31, 2014 @02:14PM (#7826715)
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.