Live data from Hacker News

Pollen: the book is a program

mbutterick.github.io

51–56 of 56 posts

Re: Pollen: the book is a program

#51
post #9

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…

>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

#52
post #47

"The ◊ character is called a lozenge. In Pollen, the lozenge is a special character that marks anything Pollen should interpret as a command (rather than plain text). How to type a lozenge: Mac: option + shift + V Windows: holding down alt, type 9674 on the num pad Ubuntu: ctrl + shift + U, then 25CA" That's an unfortunate choice, imo. Pollen looks great but I wouldn't want to have to type that character all the time…

If you're interested in something that actually is halfway between Markdown and LaTeX, take a look at Softcover: http://softcover.io/.

Re: Pollen: the book is a program

#53
post #9

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…

>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…

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

#54
post #43

Earlier quoted context omitted.

"(...) my thinly-veiled ambition is to create a contemporary successor to TeX. Contemporary = optimized for web publishing + better "macro" language (Racket) + shallower learning curve. That said, TeX got a lot of things right." So why not resist the start-from-scratch instinct and build a framework on top of TeX instead? In that way, you would not only inherit all that TeX gets right already; but most importantly, y…

I didn't start from scratch. I built the project on top of Racket & Scribble (which itself has similarities to TeX). Bear in mind that creating Pollen was a side mission of the main project: making the website http://practicaltypography.com . The existing tools weren't good enough, so I ended up making my own. I looked at using TeX. No one had anything nice to say about its HTML capabilities. So I moved on. Pollen do…

Well, you can make dvi and convert it into svg with dvisvgm; taking the inconsistent, usually terrible browser rendering and absolute lack of a proper typesetting in HTML into account this is probably the only way to achieve a nice web-published text (;

Re: Pollen: the book is a program

#55
post #47

"The ◊ character is called a lozenge. In Pollen, the lozenge is a special character that marks anything Pollen should interpret as a command (rather than plain text). How to type a lozenge: Mac: option + shift + V Windows: holding down alt, type 9674 on the num pad Ubuntu: ctrl + shift + U, then 25CA" That's an unfortunate choice, imo. Pollen looks great but I wouldn't want to have to type that character all the time…

If our languages never stray outside of ASCII, then our input methods will never improve. The Emacs version is not much better:

C-x 8 RET loz[enge]

or

C-x 8 RET 25CA

Which suck, but can at least be rebound to a useful key. Unfortunately, the \lozenge command in TeX mode produces U+2727 “white four pointed star”. Sigh.

Re: Pollen: the book is a program

#56

Earlier quoted context omitted.

>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…

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.

Post reply on HN