LaTeX output (or direct to PDF)? #7

Closed
opened 10 years ago by jpallen · 1 comments
jpallen commented 10 years ago (Migrated from github.com)

Let me quickly say that I love this project, and I think you've done everything right to build a successor to (La)TeX. With that in mind, how feasible would it be to generate either LaTeX output, or have a built in PDF output mechanism? I think it's important to be able to publish not just to HTML, but to ePub (easy if it can do HTML), and PDF (and ideally, any arbitrary format if someone is motivated to write the rendering code).

I'm planning to migrate the book that I'm writing at the moment over to pollen to give it a good test drive, but my understanding so far is that behind-the-scenes you do something roughly like:

  1. Parse markdown, or 'pollen' mark-up (using the lozenge, and user-definable commands).
  2. This internally creates a tree-like object describing the document, which is very close (identical?) to what HTML produces.
  3. Render this to HTML.

Would it be easy to swap out this last step with rendering to LaTeX? Or is the tree that is built up between steps 1 and 2 too tied into targeting HTML to be able to capture the semantic information that would be needed to target a different output format?

Either way, I'm going to give pollen a try since I've found Markdown way too restricted and lacking the macros possibilities that I love from LaTeX. Great job!

Let me quickly say that I love this project, and I think you've done everything right to build a successor to (La)TeX. With that in mind, how feasible would it be to generate either LaTeX output, or have a built in PDF output mechanism? I think it's important to be able to publish not just to HTML, but to ePub (easy if it can do HTML), and PDF (and ideally, any arbitrary format if someone is motivated to write the rendering code). I'm planning to migrate the book that I'm writing at the moment over to pollen to give it a good test drive, but my understanding so far is that behind-the-scenes you do something roughly like: 1. Parse markdown, or 'pollen' mark-up (using the lozenge, and user-definable commands). 2. This internally creates a tree-like object describing the document, which is very close (identical?) to what HTML produces. 3. Render this to HTML. Would it be easy to swap out this last step with rendering to LaTeX? Or is the tree that is built up between steps 1 and 2 too tied into targeting HTML to be able to capture the semantic information that would be needed to target a different output format? Either way, I'm going to give pollen a try since I've found Markdown way too restricted and lacking the macros possibilities that I love from LaTeX. Great job!
mbutterick commented 10 years ago (Migrated from github.com)

Thank you for the kind words. The design of the system contemplates output to a variety of targets, though so far I’ve focused on HTML (because that’s primarily what I use it for, and as you say it also covers a set of HTML-ish things, like ePub).

As for PDF. What LaTeX has, that Pollen does not, is a text-layout + type-rendering engine. With HTML, obviously one relies on the web browser for those functions. I don’t foresee a problem with rendering Pollen source into LaTeX (though my LaTeX knowledge is rudimentary).

When you say Pollen “creates a tree-like object,” that’s basically true. Internally Pollen compiles everything into an X-expression, which is a Lisp-style S-expression that represents marked-up textual content. You can think of it as meta-markup, which can then be processed into more specific markup (e.g., HTML, XML, LaTeX, etc.), and from there into PDF.

As an intermediate step, you could also use LaTeX sources within Pollen, and rely on Pollen just for its preprocessor facility (rather than its markup-processing facility).

Having said that, LaTeX is a mature tool for handling the gnarly problems of long, structured documents; it does many things that Pollen cannot. I’m not trying to pry LaTeX from the hands of those who need it. Rather, I’m trying to take some of the good ideas of LaTeX and put them in a more accessible package.

Thank you for the kind words. The design of the system contemplates output to a variety of targets, though so far I’ve focused on HTML (because that’s primarily what I use it for, and as you say it also covers a set of HTML-ish things, like ePub). As for PDF. What LaTeX has, that Pollen does not, is a text-layout + type-rendering engine. With HTML, obviously one relies on the web browser for those functions. I don’t foresee a problem with rendering Pollen source into LaTeX (though my LaTeX knowledge is rudimentary). When you say Pollen “creates a tree-like object,” that’s basically true. Internally Pollen compiles everything into an _[X-expression](http://mbutterick.github.io/pollen/doc/big-picture.html#%28part._.A_special_data_structure_for_.H.T.M.L%29)_, which is a Lisp-style S-expression that represents marked-up textual content. You can think of it as meta-markup, which can then be processed into more specific markup (e.g., HTML, XML, LaTeX, etc.), and from there into PDF. As an intermediate step, you could also use LaTeX sources within Pollen, and rely on Pollen just for its [preprocessor](http://mbutterick.github.io/pollen/doc/First_tutorial.html#%28part._.Working_with_the_preprocessor%29) facility (rather than its markup-processing facility). Having said that, LaTeX is a mature tool for handling the gnarly problems of long, structured documents; it does many things that Pollen cannot. I’m not trying to pry LaTeX from the hands of those who need it. Rather, I’m trying to take some of the good ideas of LaTeX and put them in a more accessible package.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen#7
Loading…
There is no content yet.