Live data from Hacker News

The LaTeX cargo cult

joshparsons.net

121–130 of 134 posts

Re: The LaTeX cargo cult

#121
post #78
post #66

Earlier quoted context omitted.

Let me be more clear: Long ago a friend kept suggesting that I write a converter from TeX (maybe also LaTeX) to HTML. I kept telling him that that was essentially impossible because TeX is a programming language, likely Turing machine equivalent, complete with if-then-else, allocate-free, file read-write, while HTML is just a text markup language. No doubt JavaScript is Turning machine equivalent, but I'd have a toug…

The point isn't to convert a TeX program into an equivalent HTML program, it's to be HTML an output of a TeX program. For example, make \emph{foo} output " foo " instead of "/Times-Italic 12 selectfont (foo) show" or whatever the PS output would be.

> The point isn't to convert a TeX program into an equivalent HTML program.

You are correct, of course. And one of my main points is that such a conversion is essentially impossible. E.g., TeX can read and write files, but, thankfully for Internet security, HTML can't.

So, my solution and envisioned converter is to convert TeX output in a DVI file to an HTML file. Such a converter seems doable and to solve a concern the OP had.

Further, my envisioned converter from DVI to HTML would do just what you are describing.

Or, the DVI file has to put the 'f' of 'foo' at some coordinates (x,y) on the page in some font, say, some bold font. Fine. TeX can handle lots of fonts, the many standard ones and more if want to make routine use of the ability of TeX to handle essentially any font given in the form TeX wants.

Want to create your own fonts? Knuth has been there, done that, and left a terrific tool MetaFont, open source, beautiful documentation. Create all the fonts you want and have TeX use them. Then create equivalent fonts for HTML and that a Web browser can use. Such work with fonts is just making routine use of what TeX has had for decades.

So, from the DVI, write to the HTML the markup string

     f 
at a position given by absolute coordinates while also specifying the desired font. That's about all there is to it. Seems quite doable to me.

Want to convert to PS? Okay, from the times I read the big, red Adobe books on PS, converting from DVI to PS is also quite doable. Indeed, there is likely a TeX device driver for that conversion now, as there is from DVI to PDF -- which I use heavily. Indeed, checking, my script for converting DVI to PDF uses EXE

     I:\protex1p2_run\miktex\bin\dvipdfm.exe
and that EXE is standard in the TeX world. It works fine.

Re: The LaTeX cargo cult

#122
post #86

Earlier quoted context omitted.

CSS3 actually supports pagination, automatic numbering and referencing, hyphenation, justified text, and footnotes. At least that's what the spec says...

For ACM style papers you need a two-column layout. On the first page at the bottom of the left column must be a copyright notice. As far as I know, CSS cannot do that.

CSS now supports fancy footers and multi column layouts.

Re: The LaTeX cargo cult

#123
post #49
post #39

As much as I like LaTeX, I think it has outlived its usefulness. Let me elaborate a bit... LaTeX is pretty good for typesetting lots of text, like novels, if you want to output something that looks professional without much effort. It's also good for typesetting lots of mathematical formulas, as the GUI alternatives are pretty tedious to use and the result doesn't look as good. It's also interesting as a template lan…

> LaTeX becomes downright irritating when trying to make complex documents. Sorry, but this is simply not true. Maybe I could agree with a general "it is irritating to make complex documents", though. After many bitter fights with WYSIWYG software and 300+ page technical documents, I firmly believe that LaTeX is by far the least irritating way of making them.

[deleted]

Re: The LaTeX cargo cult

#124
post #116
post #35

There are a few nice things about Latex for scientific publications: 1. It's style driven. I'm not sure how well you can do this is Word now. But in Latex it's pretty easy to reformat your document to match a journal or thesis style. 2. It's scriptable. I don't mean that it's Turing complete. But you can drive it with a Makefile. This is great for scientific publications I've found. You can script it such that Make w…

1. has been possible in Word for ages (according to an article recently on the front page, it's been the main difference between Word and WordPerfect), and it's pretty much how you write documents of any size without going insane. I'm actually astonished how many people think that using Word means using direct formatting and eschewing styles.

I really wish people would use word's features - having the entire document marked up with appropriate headings makes its a breeze to go through and restyle a document.

I find that while collaborating on things, I have to make a pass that involves purely going through and marking up heading text appropriately.

----

I've found the best compromise is to have a sort of technical prologue that discusses how to edit the document, or forcing people to work in something like markdown where the lack of font sizes force the use of a heading class notation.

I prefer https://stackedit.io/editor because it includes mathjax support which means you get access to a large swath of LaTeX style math tools.

Re: The LaTeX cargo cult

#125
post #7

I like Latex (Math/CS background), but I would definitely like to try some alternatives (like Asciidoc discussed in https://news.ycombinator.com/item?id=8509062 ). The problem is I never can tell which Markdown/Docbook inspired systems actually have working implementations and which ones are hot air. I don't want to end up with a big SGML mess that I can't do anything with or have to edit CSS just to render a book in…

I've had good luck using tools like Pandoc as part of a workflow to translate between various messes.

Re: The LaTeX cargo cult

#126
post #89

Earlier quoted context omitted.

The point is, are there any other applications that will render a LaTeX document correctly that aren't LaTeX itself? It's open source, but in practice the code is so complicated and large no one has ever duplicated it. It's not proprietary in the traditional sense, but if you want your LaTeX file to not be mangled, you must use LaTeX itself.

TeX, pdfTeX, XeTeX, LuaTeX... there are a lot of engines that can properly render a *.tex file.

And here's the problem: all of them are mutually incompatible in most situations. Even moving .tex documents over different platforms is an enormous pain, and pdflatex/xelatex don't possess the error reporting you need to quickly find which packages are missing on which systems.

Don't get me wrong, I love LaTeX, and I agree that the author misinterprets 'proprietary', but from a user standpoint the problem is the same: old documents are not rendered correctly, and new documents don't work with old compilers. It's a mess.

Re: The LaTeX cargo cult

#127
I don't get the point about declarative vs operational paradigms. LaTeX does a great job separating the data and the processes (it is declarative in this sense), although it allows to mess with both inside the document for flexibility.

I can't see the fundamental difference with HTML: it indeed lacks "operational" commands, but is massively used with javascript that implements the dirty stuff.

Re: The LaTeX cargo cult

#128
post #59

Earlier quoted context omitted.

There are a couple of issues here. First, Markdown and HTML simply punt on the vast majority of the issues that TeX solves. Just as the author rightly comments that TeX is not geared toward online publication, HTML is geared toward only that model. If you want to paginate HTML or Markdown, you do it yourself. Widows and orphans are (obviously) your problem to deal with. Compared to the work that TeX is doing, Markdow…

CSS3 actually supports pagination, automatic numbering and referencing, hyphenation, justified text, and footnotes. At least that's what the spec says...

I'm happy to be corrected on that point, but then the question becomes: what gives us any confidence that the CSS spec is going to be followed in exactly the same way by multiple browser vendors consistently between now and 2034? Certainly nothing in the history of client side rendering on the web gives me any faith in that proposition.

Also, and this is probably just me, but I find CSS even harder to use for bespoke layouts than TeX. Which gets to the last point I made -- certainly you could replace LaTeX with an equally capable substitute, but it's not clear that the substitute wouldn't necessarily recreate a lot of what people hate about LaTeX. Markdown is almost universally loved precisely because it can't do very much. The more features you add, the more cumbersome the mechanism to select them needs to be, and at some point, you just have LaTeX with angle brackets and tag selectors instead of curly braces.

Re: The LaTeX cargo cult

#129
post #78

Earlier quoted context omitted.

The point isn't to convert a TeX program into an equivalent HTML program, it's to be HTML an output of a TeX program. For example, make \emph{foo} output " foo " instead of "/Times-Italic 12 selectfont (foo) show" or whatever the PS output would be.

> The point isn't to convert a TeX program into an equivalent HTML program. You are correct, of course. And one of my main points is that such a conversion is essentially impossible. E.g., TeX can read and write files, but, thankfully for Internet security, HTML can't. So, my solution and envisioned converter is to convert TeX output in a DVI file to an HTML file. Such a converter seems doable and to solve a concern…

Any reasoning about TeX being able to do things that HTML can't is irrelevant. TeX -> PDF can be done without an intermediate DVI stage using pdftex. There could therefore be a similar "htmltex" which could directly convert TeX -> HTML.

In the same way that pdftex has the advantage of knowing its output format (and can e.g. write pdf metadata), this hypothetical "htmltex" would know that its output is html, and could do things like allowing paragraph re-flow and embedding maths using MathJax.

Of course, this wouldn't be easy, you'd likely need to fork TeX to implement it correctly (or only support a subset of LaTeX features like the current TeX->HTML converters), but it's far from impossible.

Re: The LaTeX cargo cult

#130

LaTeX is a good idea with a terrible implementation. The popularity of markdown (+variants) is a testament to the usefulness of plain text writing. However, LaTeX syntax is a clunky and the ecosystem is a scrapheap-challenge amalgamation of packages with assorted cross-incompatibilities. Latex to PDF converters are also shockingly slow for this day and age, a simple document can take several seconds to compile compar…

> HTML+browsers have been carefully designed and optimized by people who know the intricacies of document rendering

I think HTML+browsers is something that has been cobbled together as well. Many times. With the added joy of useful features killed by political or profit driven reasons.

Post reply on HN