Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Web Publications – LaTeX Style – HTML View (goessner.github.io)
88 points by fango on June 6, 2021 | hide | past | favorite | 19 comments


I found it hard to understand the point of this. It talks about imitating the “look and feel” of LaTeX documents in HTML, but fails to do so. If the article itself is an example, it’s the familiar low-quality browser-rendered HTML typography.


From the abstract:

> The resulting HTML document already contains prerendered math formulas, so browsers won't have the burden of math rendering via scripting.

It wants the math support of latex in an html document generated from the markdown source file.


KaTeX already provides pre-rendering of math. If you want to start with Markdown you can use Pandoc. Then you can get TeX, HTML, and even Word formats from the same source. This project seems to only work with one particular editor, as well.


Also "LaTeX look and feel" doesn't mean anything to start from: Latex documents look vastly different depending on which template they use. A lot of conferences and journals allow for both Word and Latex files to be sent, and it's impossible to guess in the output which tool was used to author a given paper.


Yes, LaTeX documents could have many different document classes. But many, many authors stick with the defaults, which a person could as a shortcut call the "LaTeX look."


I am convinced if you give me a Word and a LaTeX paper from the same conference, I can tell you which one is from the typesetting tool and which one from the word processor.


This is maybe the third time I've seen the concept of a LaTeX styled html page and it never seems like a good idea to me. I'm all for math typesetting in HTML, but I no longer "believe" in justification, especially not browser's dissatisfying one-paragraph based techniques. But even with knuth-plass I have reasons to suspect ragged right text is better, see https://news.ycombinator.com/item?id=27189306 I'm willing to change my mind with more evidence, justified text is pretty.


I also forgot to mention that for most people at low dpi (I would say 300dpi and lower, but I personally wouldn't use a serif till ~1500dpi) sans-serifs are more legible. This blog post has some good information: https://geniusee.com/single-blog/font-readability-research-f...

I had better sources at some point but I'll have to dig them up.


Where are you getting 1500 DPI?

Most printers start at 300--600 DPI, before ink and/or toner bleed. 1200 DPI is photo-print level.

Serif at ~150+ DPI is both readable and preferable to sans IME.

Your referenced blog entry makes no mention of DPI that I find. And makes numerous grammatical choices which lead me to question its authority.

For printer DPI comparisons see: https://www.printerknowledge.com/threads/effective-print-out...


I agree if you have in mind fonts with really thin serifs, such as the classic Computer Modern. But serif fonts in general seem fine to me at 300 dpi, or even 240 dpi. Readability depends more on the particular font used at a particular size, rather than whether it’s serif or not.


Yeah the serif/sans distinction is definitely down the list compared to font size, column width, line spacing, contrast, etc. I just brought it up because I consider it part of the "LaTeX" style. But you're right...something something premature optimization


Thanks for that informative link. I personally like ragged right text. I also like fixed-width fonts. Strange, I know.


I've found that Texmacs produces some nice and fast html pages, like this: https://www.texmacs.org/joris/pcomp/pcomp.html

However, I don't know if there's a way to use it for regular Tex documents.


It is sad that in 2021 we are still using heavyweight js libraries for displaying mathematical notation, instead W3C specification - MathML.


If you look at the source of the fine article, you will see that the equations are in MathML. They are pre-rendered by KaTeX from LaTeX notation to MathML. There are other tools that do this, too. MathML is indeed being used, you see. It’s just that nobody wants to write in it.


Producing Computer-Modern-y HTML output that looks like a defaults-everywhere LaTeX document reminds me of George Bernard Shaw's reputed response to a marriage proposal from a noted actress: “But what if the baby had MY looks and YOUR brains?”


Use Katex


> Use Katex

This does use KaTeX for rendering the TeX:

> Math support is the core functionality of mdmath. Inline math $r = \sqrt{x^2 + y^2}$ and display math expressions $$e^{ix}=\cos x + i\sin x$$ are supported, due to markdown-it extension markdown-it-texmath [8] and the fast math renderer KaTeX [9].

> [8] markdown-it-texmath, (https://github.com/goessner/markdown-it-texmath).

> [9] KaTeX, (https://katex.org/)


My bad for not reading it further than VSCode.




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

Search: