5 ms·
I always wonder why people compare Latex with word and not with the single most popular document markup (especially here): HTML + css + javascript. The problem
by BlackFly 1y ago
I always wonder why people compare Latex with word and not with the single most popular document markup (especially here): HTML + css + javascript.
The problems are quite similar, "How do I center a div?" vs "How do I keep this float on this page?" Has latex really modernized? I don't hear a lot about new layouts or style mechanisms.
Most people are probably reading articles online these days, although there is a lot to be said about printing an article to read. It seems to me that adding responsiveness to journal articles instead of using a fixed paper layout regardless of media might be a good improvement for many readers in many situations.
- JackeJR 1y agoThere are many reasons this comparison is not made. I will just touch on one. The target medium is different. For html, you have monitors of different sizes as well as windows that can be resized. For latex, you choose your target at the start: A4 paper? Screen presentation? A0 poster? With a fixed medium in mind, you can be extremely particular on where on this canvas you want a piece of text/graphic or whatever. Without a fixed medium, you have to have logic to address the different mediums and compromises have to be made.
- karencarits 1y ago> For latex, you choose your target at the start Yes, sometimes, but I would say that one of the benefits of latex is how easy you can switch to another layout. But I guess the point is that you typically render to a set of outputs with fixed dimensions (pdf)
- chabska 1y agoHTML+CSS has facilities to target a page format (CSS @page rule, cm and in dimension units). Not to say that it's on the same level as LaTeX, but it's pretty impressive by its own right.
- maegul 1y agoAre there good deep dives on how far you can practically this? Especially in combination with headless browser pdf generation? Last time I looked into it, a while ago, my impression was that it would get rickety too soon. It’d be a good place to be, I think, if web and “document” tech stacks could have nice and practical convergence.
- p4bl0 1y agoI'd say it's already there. See for example the https://pagedjs.org/ https://pagedjs.org/ project which allows advanced typesetting (including for printing) using web technologies. It is already used in production by at least one book publisher (C&F editions)
- throwanem 1y agoI've used it for my own such production, perfect binding with a hand guillotine and screw clamps in my attic - nothing remotely professional, but you still have to start by making a book block, and Paged.js is a solid call there. Unless beauty of typography (more than TTF/OTF hinting can handle) is of particular merit, it's usually my preferred first typesetting option. As an old hand with PDF-in-browser production, I expected much worse of Paged.js than I found. It's powerful and mostly enjoyable to use! Oh, you end up with a large set of CSS rules, and it is not without bugs and gotchas (failing to specify a bleed rule somewhere at least once in every @page context subtly breaks layout; footnote layout is functional but automatic call numbering isn't always perfect, etc.) You should definitely not expect to take Paged.js out of the box, slap a theme on it, and go; it comes as a box of parts with a mostly complete machine inside, and if it breaks you get to keep all the pieces. I imagine the publisher who uses it must have some prior interest in web technologies, for example. Nor is Paged.js remotely as capable or flexible as InDesign or a comparable tool, especially for the deeply rudimentary condition of web typography overall - something even as elaborate a tool as this can't really approach fixing. But Paged.js is also unlike InDesign in having a much shallower (days vs months) learning curve for folks like us with prior web experience, and however equivocal a review I may now be giving of its technical merits, I do actually like working with Paged.js quite a lot.
- SkiFire13 1y agoNote that this won't prevent the page from being displayed in other sizes, where it will most likely have a broken layout instead.
- chabska 1y agoTrue, but with CSS you define one layout for the web format alongside a different layout for the print format, using the @page rule.
- eru 1y ago> For latex, you choose your target at the start: A4 paper? Screen presentation? A0 poster? You can change that as you go along.
- naikrovek 1y ago> You can change that as you go along. that's not the point they were trying to make. you may need to change the display target for every viewer.
- SebastianKra 1y agoThat seems contradictory, when Latex is rather famously imprecise at placing figures and such. Weren't both languages (at least at some point) intended to take layouting control away from the writer? But regardless, I think that, in addition to moving away from Latex we should also reconsider the primary output format. Documents are rarely printed anymore, and inaccessible, fixed-size A4 pdfs are annoying to read on anything but an iPad Pro.
- wtallis 1y agoLaTeX isn't intended to take layout control away from the author so much as it is intended to automatically produce a good-enough layout allowing a single author to produce a very large document without employing a designer. HTML by contrast explicitly does remove control over layout from the author and place it in the hands of the user (and their chosen user agent). Both languages have mechanisms to (somewhat) separate the content from the formatting rules.
- meinersbur 1y agoBoth claims are incorrect. LaTeX would rather produce a bad document if it cannot produce a good one. Example: overfull hbox. A designer is still required who creates the documentclass, it is just that LaTeX comes with some predefined ones intended for scientific publishing. HTML+CSS require pixel-perfect rendering. Example: ACID2 test. While it might have been the idea of plain HTML at some point (<em> instead of <i>), control has never been taken away from the author thanks to CSS.
- wtallis 1y agoYou're badly mischaracterizing tests like ACID2. The test definition includes a long list of things that invalidate the test, including things like changing the zoom level. So it's wrong to construe that test as requiring pixel-perfect rendering when it explicitly doesn't cover exactly the kind of user agent controls I'm talking about. Your comments about LaTeX do not seem to contradict anything I said.
- 1y ago
- KeplerBoy 1y agoBecause HTML is not an option. For academic papers you usually have to submit pdfs conforming to either a latex or word template.
- flanked-evergl 1y agoAcademic publishing standards are about as much of a joke as academia itself.
- KeplerBoy 1y agoSure, but if you ignore academia, you might as well ignore LaTeX.
- setopt 1y agoIn many math and physics journals, as well as on arXiv, you usually submit the TeX file itself so they can adjust it and recompile.
- josephg 1y agoIts the same reason that Markdown became popular. I want my document to primarily contain content. Not a sea of handwritten tags. I don't want to manually type (or read past) HTML tags littered around the place. I don't want to manually put <p> tags on my text, or worry about how indentation will affect my rendered output. (For example, <p>foo</p> and <p> foo </p> render differently). If I'm writing a blog post, I also don't want my post's text to get mixed up with site specific stuff, like meta tags and layout elements. Are there any good "literate HTML" type tools which first and foremost let me type text, but still let me break into HTML? That I could get behind.
- tannhaeuser 1y agoSGML (ISO 8879) has basically all these things: it infers tags (such as for opening paragraphs as in your example, but also infers missing html, head, and body tags, and also infers end-element tags for paragraphs, etc etc), has a built-in mechanism for recognizing custom tokens and turn those into tags to implement markdown and custom syntaxes, provides text macros, and many, many more things (including stylesheets, transformations for things such as table of content generation and search result views). In other words, SGML is complementing the HTML vocabulary with authoring affordances, as originally intended (HTML is based on it).
- wolfgang42 1y agoMarkdown as specified lets you break out HTML whenever you want, and even understands the difference between inline and block tags. Most places where you can use markdown support this. Personally I’m also a fan of https://github.com/pugjs/pug https://github.com/pugjs/pug , which is an alternate syntax for HTML that I find easier to work with when I need the full power of HTML but don’t want a thicket of angle brackets.
- josephg 1y ago> Markdown as specified lets you break out HTML whenever you want I know, but breaking into raw html isn’t as useful as you’d hope. You need a lot of html just to make an image with a caption. And all that ugly html needs to be copy pasted each time it’s needed, since there’s no way to reuse it. And there’s lots of problems you can’t really solve like that at all. For example, I want latex style automatic numbering of figures (Figure 8: Xxx) and I want to link to that figure elsewhere in the document (“for detail, see Figure 8”). I want the numbers to be automatically generated based on document order. I also want numbered sections / headings. You can sort of do with css. But you can’t automatically label the links to those sections. Markdown also doesn’t support comments. You can use html comments but then my internal notes / removed sections end up in the generated html! Even trying to do some of this stuff makes your document become - as you said - a thicket of angle brackets. I want to retain the readability of my document along the way. Even with a tool like pug, do I have to type a P before each paragraph? Gross. I just want to write my paragraphs with line breaks, like markdown. I don’t want it peppered with stuff like that. And I don’t want forced indentation on my prose. p This is not a natural p way to write a series of paragraphs of text
- einpoklum 1y ago> I always wonder why people compare Latex with word and not with... HTML... At the very least, because those are the two popular software systems used for creating documents. HTML+CSS isn't; and Javascript is irrelevant for print.
- SkiFire13 1y agoThere was an article on this semirecently that compared among other things HTML and Latex for typesetting. https://blog.ppresume.com/posts/on-typesetting-engines https://blog.ppresume.com/posts/on-typesetting-engines
- kzrdude 1y agoIs there a microtype (latex package) for the web?
- maxnoe 1y agoHTML + CSS is only half of the equation. The renderer is also important. So you need a layout engine that turns the HTML+CSS into something you can view. Most of the time, this is one of the browser engines, but there are many more things. There is e.g. weasyprint to produce PDFs from HTML and CSS, which would be the closest alternative to LaTeX taking HTML+CSS as input. For simple documents, it's a much cleaner alternative, I used it to autogenerate documents in a python backend.