Hacker News new | past | comments | ask | show | jobs | submit login

I'd also add that while Markdown and LaTeX can do some of the same things, they're designed toward very different tasks. I've used both numerous times in my career, and I can't remember a case where it's been ambiguous which tool was more appropriate for the task.

If it's going to be printed, you probably want LaTeX. If it's going to be rendered to a screen, you probably want Markdown. If it's going to be rendered to a screen and have math in it, you probably want Markdown with some LaTeX for the math. If it's going to be rendered to a screen and printed, better start looking for a job, because that project is going down in flames.




(In addition / As an alternative) to Pandoc, has anyone tried Bookish [0] by Terrence Parr of ANTLR fame?

It was referenced by Jeremy Howard in a HN comment [1] on the submission for their "Matrix Calculus for Deep Learning " HN submission of 18 days ago [2]:

>Jeremy here. Here to answer any questions or comments that you have. > >But more importantly - I need to mention that Terence Parr did nearly all the work on this. He shared my passion for making something that anyone could read on any device to such an extent that he ended up creating a new tool for generating fast, mobile-friendly math-heavy texts: https://github.com/parrt/bookish . (We tried Katex, Mathjax, and pretty much everything else but nothing rendered everything properly). > >I've never found anything that introduces the necessary matrix calculus for deep learning clearly, correctly, and accessibly - so I'm happy that this now exists.

[0] https://github.com/parrt/bookish

[1] https://news.ycombinator.com/item?id=16267593

[2] https://news.ycombinator.com/item?id=16267178


FYI bookish embeds math formulas as vector images (SVG) to the generated HTML.


When you say "rendered to a screen", do you really mean "placed on a webpage"? PDFs generated by LaTeX are rendered to screen all the time.

edit: Actually, I find that I completely agree with your point if "printed" is replaced by "shared in pdf format" and "rendered to screen" is replaced by "shared in plain text or HTML format".


You can simplify it even further:

Will the content be shown with fixed line lengths, or with responsive line lengths?


I'll have to think about this further, but at first glance this seems like a better heuristic than what I wrote.

There's a little bit of opinion embedded in my original post, which is that PDF is an inappropriate format when intended for screens. It's okay if you're wanting to provide a primarily printed document on the web or in email, it's okay, but if your primary target is screens, PDF provides a pretty poor user experience.


If you haven’t tried it yet, I encourage you to give Markdown + Pandoc a try for printed docs. Pandoc can take a LaTeX template and flow Markdown into it. I find Markdown formatting simpler to remember and execute than LaTeX, and there are a huge number of editors and live-preview apps that will let you validate your Markdown as you write. A few keystrokes, and you get a beautiful PDF document, flawlessly typeset in Computer Modern - and with a few more keystrokes, you can have an HTML page with exactly the same content.

There is even a company, LeanPub, that is based on generating paper and e-books direct from Markdown.


Makefiles address that.

     make html pdf
This one has many OSXisms & wants some homebrew bits, but may give you a starting point:

https://pastebin.com/raw/H43MKTCq

Referenced utility script:

https://pastebin.com/raw/J6quT7Mj


Yup, having a default Markdown doc project that you clone is a big help. That way, you can include a Makefile, as well as embed LaTeX header info.

For cases where you really need to share your doc with coworkers in an editable form, you can even define an MS Word target...


That's among the targets here.


While not exactly the simplest tool around, org mode is still a lot simpler than LaTeX and brings excellent export features to both LaTeX/pdf and html. It’s probably a hard sell for anyone who doesn’t use Emacs already, but for someone already using Emacs, it’s quite neat. I’ve found that for me, it offers the right balance between simple basic functionality (like Markdown) and optional advanced features.


> If it's going to be rendered to a screen and printed, better start looking for a job, because that project is going down in flames.

What makes you say that? I'm just finished up my first published book. The entire thing is in LaTex, which is extremely powerful. With conditionals and macros etc. etc. So I make a print-ready pdf and I'm good to go.

I run the whole thing through pandoc and it spits me out an ePub that's good to go for the eBook version.

Works a treat. I do battle LaTeX some days, but the results are gorgeous.


It's mostly a joke. I've worked on a few things that "needed" to be PDFs with links inside them, because the clients couldn't decide whether they wanted a print version or a digital version, and went with "both". I won't write off the idea that it can be done usefully, I've just never seen it result in anything but a bad user experience for both use cases.

I'd agree your use case is a good one for LaTeX.


Why is LaTeX unambiguously better for print? Is it just the support for math notation, or is there more to it?

And since "print" very often means a PDF that's also available online, has there been any progress on tagged PDF support in pdflatex or a similar tool? This is important for accessibility.


Have you ever tried to typeset a complex document with side bars, figures, multi-part figures, figures that contain math (not just images), and layouts that take a lot of tweaking to get just right?

I can imagine doing that in Pandoc Markdown, but only with extensive use of raw LaTeX code. Most of the above doesn't have a direct equivalent even in richer Markdown dialects like Pandoc.


Ah, thanks for educating me. I pity anyone who has to work within the constraints of print in 2018. To me, hypertext that adapts to the user's device and needs (e.g. rendering at a different font size and reflowing appropriately, or rendering through non-visual means like speech and braille) is the only way to go these days.


To be fair to latex, the majority of hypertext examples don't do any of those things either.


It's harder to make fine adjustments, such as those made by the microtype latex package.


Aside from what other commenters told you: LaTeX just typesets better, meaning that it will choose line-breaks, inter-character and inter-word spacing, ligatures, hyphenation, etc. much better than your regular browser.

Try justifying text on a relatively narrow column in HTML, and then try it with LaTeX. There's a world of difference in readability between them.


> Why is LaTeX unambiguously better for print? Is it just the support for math notation, or is there more to it?

LaTeX is techniques and heuristics from hundreds of years of typesetting for print, codified into a program.

HTML is at most 29 years old, and has only supported typesetting of any kind for a fraction of that. What typesetting capabilities it supports are designed by committees, and its primary purpose has always been screen display, never print.

In the simplest/best case, LaTeX will simply produce nicer-looking results for print. In more complex/worse cases, LaTeX can do things that HTML in a browser can't reasonably do at all for print, even with CSS.

> And since "print" very often means a PDF that's also available online, has there been any progress on tagged PDF support in pdflatex or a similar tool? This is important for accessibility.

I can't answer this question directly because it's been a while since I attempted such a thing, but this is largely what I was joking about with the "the project is going down in flames" bit in my previous post. If you are concerned about accessibility, targeting a proprietary format that resists parsing for text-to-speech or fragment translation and doesn't support variable-width lines for screen readers is a bad idea. Tagged PDFs are really just a hacky attempt to fix the problem: HTML was designed with accessibility in mind from the beginning (though admittedly HTML/CSS/JS as used by modern websites do a very poor job of providing accessibility). Maybe there has been progress in adding this to pdflatex, but it's still a bad idea.


Knuth said that doculents should be readable, but artvto be hanged on a wall.

Typesetting my thesis in LaTeX (physics, 2000) was an amazing choice. I could hardly modify anything (it is doable but requires a lot of work and in the meantime you learn that the default is better) so I was left with the content.

I knew that it would just work and took from me all the philosophical sufferingbof choosing such and such fontvsize for the title of adjusting margins, or placing a graph.


I've done the latter, but basically it's been luck that the program I used (Pages 09) works for print, and also copy/pastes decent html.

Currently jerry-rigging a script to get html out of it by pasting the scrivener and exporting, while keeping pages 09 for print.

It....works, but I would not recommend it unless you have a clear reason to do both. And I'd recommend another program, as pages 09 will eventually be made incompatible on mac.


“If it's going to be rendered to a screen and printed, better start looking for a job, because that project is going down in flames.”

Ah that explains what’s going on at Safari Books...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: