News for hackers. Stuff that matters.
Re:Web4 Should Run on LaTeX by dredmorbius on Sunday November 28, 2021 @01:52PM (#29371672)
LaTeX is not equivalent to PDF, though that is one publishing format it supports.

HTML lacks numerous features which a first-class document-specification language should have, including grid layouts (only very recently possible), footnotes and sidenotes, and formulae.

The promise of LaTeX is that documents could be defined strictly in semantic terms, though my belief is that this would last for approximately 37.229 minutes after such a proposal actually hit the Web.

The underlying failure of HTML is that it is runtime compiled, not precompiled. This makes things far easier on authors and publishers, and far worse for readers. In the early days, the former mattered in order to incentivise content. Last I checked, incentivising content is no longer the Web's principle problem.

I've also been leaning toward LaTeX as a document speification language for hypertext systems, though I don't believe that alone is sufficient to fix the Web's ills.

Re:Web4 Should Run on LaTeX by dnautics on Sunday November 28, 2021 @02:56PM (#29372324)
> The promise of LaTeX is that documents could be defined strictly in semantic terms, though my belief is that this would last for approximately 37.229 minutes after such a proposal actually hit the Web.

I mean, that already failed for LaTeX. To me it's kind of an unwieldy pile of wierd imperative imports. I did write my thesis in it, but for the most part it was "smash these imports together, pray for the best, if it doesn't work, try a different collection of imports, don't bother trying to fix your imports, settle for "least bad" -- which, of course, was better than MS word". I used to do my resumes too, with the same spray and pray feel. Now I just write a markdown file, and anyone that cares that the resume is poorly formatted I probably don't care to work for (many places sanitize resumes to a single format anyways, i suppose for non-discrimination purposes).

Honestly, even though I myself can't use CSS effectively, what little bit I can use feels like CSS is converging to that declarative-layout-that-is-separate-from-document-contents philosophy that LaTeX tried to do, with the major distinguishing point that LaTeX had a huge "start with sane defaults" selling point, and CSS most definitely does not start with sane defaults.

Re:Web4 Should Run on LaTeX by GiovanniP on Sunday November 28, 2021 @04:24PM (#29373190)
> I mean, that already failed for LaTeX. To me it's kind of an unwieldy pile of wierd imperative imports

You need to try TeXmacs (which, despite its name, is not based on TeX ;-) ). www.texmacs.org

Re:Web4 Should Run on LaTeX by infogulch on Sunday November 28, 2021 @03:13PM (#29372492)
What would sane defaults for css be?
Re:Web4 Should Run on LaTeX by dredmorbius on Sunday November 28, 2021 @05:31PM (#29373795)
I'd like to see something far closer to my "Motherfucking Website" variant:

https://codepen.io/dredmorbius/full/KpMqqB

There are a few bits of that I'd fiddle with, but the idea of defining margins and avoiding text that runs flush to gutters, as well as defining most of the whitespace in rem & em units rather than pixels or points, is a big part of it.

Another alternative would be a stock set of document types for which users could choose from predefined styles. The document would specify the doctype, the user the styling. That could include various branding or simiilar components, but they'd be reasonably minimal.

The ever-encroaching headers, footers, sidebars, floating interstitials, etc., of the modern web really need to go DIAF.

Re:Web4 Should Run on LaTeX by dnautics on Sunday November 28, 2021 @03:38PM (#29372746)
Maybe I spoke too soon -- Thinking back (and I could be wrong about this) but the "top" of the style sheet cascade is supposed to be defined by the browser? So I guess it's the browers' responsibility?

I guess the point I was trying to make is that if you just type only non-layout LaTeX it looks reasonably good, yeah, it does format it with super-wide margins (shrug), but if you do that with html you get mouth spiders.

Re:Web4 Should Run on LaTeX by freemint on Sunday November 28, 2021 @03:20PM (#29372565)
How would you support multiple screen resolutions or even resizing windows with precompiled layouting?

If layouting (an computationally expensive step) is done at "run-time" what would precompiled even mean?

Re:Web4 Should Run on LaTeX by dredmorbius on Sunday November 28, 2021 @11:51PM (#29376504)
Re:Web4 Should Run on LaTeX by zozbot234 on Sunday November 28, 2021 @02:55PM (#29372322)
Footnotes and sidenotes can be realized as <aside> elements and styled/scripted to appear as actual footnotes on print media. Formulas are supported via MathML.
Re:Web4 Should Run on LaTeX by dredmorbius on Sunday November 28, 2021 @03:14PM (#29372496)
Neither are native first-class elements of plain HTML.
Re:Web4 Should Run on LaTeX by ttybird on Sunday November 28, 2021 @03:54PM (#29372915)
Nor a "first-class" TeX element either. \footnote is just a macro.
Re:Web4 Should Run on LaTeX by dredmorbius on Sunday November 28, 2021 @05:24PM (#29373710)
We're discussing LaTeX.

TeX itself is a set of typesetting primitives. LaTeX is a set of structurally-semantic, document-oriented macros built on TeX.

Re:Web4 Should Run on LaTeX by tasogare on Sunday November 28, 2021 @10:38PM (#29376104)
Latex is not semantic, the fact it's using macro (which are factoring function calls) says it all. There is some degree of separation between content and presentation, but that's it.
Re:Web4 Should Run on LaTeX by dredmorbius on Monday November 29, 2021 @02:21AM (#29377283)
LaTeX as designed is generally semantic (formatting is left to the applied style), and whilst HTML5 is in theory reasonably semantic, in practice, LaTeX tends to be used far more semantically than HTML is.

Some of those reasons are technical, though as noted elsewhere in this subthread, economic and other factors seem more dominant, and I severely doubt that LaTeX on its own will address the broader scope of issues raised in TFA.

Re:Web4 Should Run on LaTeX by ttybird on Monday November 29, 2021 @04:42AM (#29377915)
Is this why after all these years there is STILL no sane way to make accessible pdfs from LaTeX?

LaTeX is almost never semantic. People are encountered to think only about the document presentation (mostly due to LaTeX's own failures).

As for footnotes being "first class". It's just a macro, nothing first-class about that when compared to HTML's solution.

Re:Web4 Should Run on LaTeX by dredmorbius on Monday November 29, 2021 @06:21AM (#29378539)
"After all these years" being the four and change since the tagged-PDF standard ISO 32000-2, 14.8 was released, in January 2017?

https://www.pdfa.org/resource/iso-32000-pdf

The LaTeX project announced an a16y project in January of this year. A tool is now available, though success varies.

https://www.latex-project.org/publications/indexbytopic/pdf/

Of footnotes: LaTeX has the macro, it's common across multiple document types. HTML does not.

Re:Web4 Should Run on LaTeX by ttybird on Wednesday December 01, 2021 @02:42AM (#29401647)
To respond to your question: no. Not sure why you linked me the PDF 2 specification. PDF/UA is from 2012, and the ability to tag PDF files for accessibility is a thing since 2001 (with PDF 1.4).

Various tools and packages that attempted to generate accessible pdfs from LaTeX have existed for aeons, all of they had a common characteristic: they sucked. I am convinced that by this point everyone who cares about accessibility has moved to other formats (like HTML).

"HTML does not"

<aside> is "first class".

Re:Web4 Should Run on LaTeX by DaiPlusPlus on Sunday November 28, 2021 @02:41PM (#29372191)
What do you mean by “runtime compiled”, exactly?
Re:Web4 Should Run on LaTeX by dredmorbius on Sunday November 28, 2021 @03:13PM (#29372490)
With LaTeX, the document creator must compile the document, through a fairly persnickety processor (latex, tetex, or an equivalent). Whilst that may still pass poorly-structured documents and result in poorly-formed output, straight-up illegal syntax won't make.

HTML has no such requirements. There's absolutely nothing stopping you from posting that in the first place. Throw something at a browser, and it will try its damndest to ingest it --- that's the "runtime compiled" element of the Web.

(It's not a perfect analogy to software compilation, though it can get surprisingly close.)

Essentially: the Web lacks any editor role. That's long been touted as a benefit. At scale, however, and over time ... it becomes problematic.

Moreover, the commercial Web has a selection process and corresponding evolutionary path which has come to be seen as less than optimal for those seeking high-value, high-relevance content. It is in fact hostile to such content, on multiple bases.

Again, LaTeX alone won't fix these problems. It addresses a few issues of structure. The concept of a post-authoring compliation state (ironically itself somewhat present in many web content-management systems, but not oriented around the document or content itself for the most part, but rather branding, advertising, and surveillance instrumenting) is also somewhat attractive but ... problematic. A discovery-mechanism scoring penalty might help (and Google's certainly applied that in other areas).

Re:Web4 Should Run on LaTeX by DaiPlusPlus on Sunday November 28, 2021 @03:27PM (#29372644)
> Moreover, the commercial Web has a selection process and corresponding evolutionary path which has come to be seen as less than optimal for those seeking high-value, high-relevance content. It is in fact hostile to such content, on multiple bases.

That aspect has absolutely nothing to do with the technical format of a document.

Re:Web4 Should Run on LaTeX by dredmorbius on Sunday November 28, 2021 @05:27PM (#29373748)
That's a large part of my larger point. It wasn't, however any aspect of the question you'd asked, and I'd answered.

That said, and despite some quite strong semantic elements to HTML (and HTML5 especially), and the semantic/presentation separation of HTML/CSS, what we're getting, what seems to be encouraged by, and what the adtech-profiting browser vendor and driver of Web browser development seem to be encouraging, is not in fact well-structured, meaningful, high-value, high-relevance documents.

You're absolutely correct that the core of the problem isn't the technical format. But the technical format's become infected by that core problem.

Re:Web4 Should Run on LaTeX by ttybird on Sunday November 28, 2021 @03:57PM (#29372937)
"must"? A web4 browser would probably use a "runtime compiled" implementation.

"Whilst that may still pass poorly-structured documents and result in poorly-formed output" - this by the way happens much more often with LaTeX compared to html in my experience.

Re:Web4 Should Run on LaTeX by dredmorbius on Sunday November 28, 2021 @05:36PM (#29373849)
A LaTeX document is virtually never directly consumed by a reader. It's first converted ("compiled") into some consumable format. Typically PDF/Postscript, though there can be numerous others.

You seem to be unfamiliar with this aspect of the system?

Re:Web4 Should Run on LaTeX by ttybird on Monday November 29, 2021 @04:22AM (#29377823)
Don't make assumptions about me. A LaTeX document is also virtually never directly consumed by web browsers. In addition to that we are considering LaTeX for the web, not DVI, not PDF, not something else that you compile LaTeX into.

And well, given the amount of people that use overleaf I would say that a lot of people (although writers instead of readers) consume LaTeX.

(Btw, you can compile html too, try printing it as ps/pdf document)

Re:Web4 Should Run on LaTeX by dredmorbius on Monday November 29, 2021 @06:24AM (#29378555)
That the Web is principally oriented around HTML is something of an accident of history. Note that any data can be transferred over HTTP(S), including, on occasion, either compiled or uncompiled LaTeX.

I am not making assumptions about what you do or do not know. I'm telling you how you're being perceived. You have the power to alter that perception. You've failed to use it.

Re:Web4 Should Run on LaTeX by ttybird on Wednesday December 01, 2021 @02:49AM (#29401679)
"Note that any data can be transferred over HTTP(S), including, on occasion, either compiled or uncompiled LaTeX."

Sure, but I don't see what this has to do with anything.

As for your perception, I don't care :) Keep it to yourself next time please. You too are being perceived in a certain way as well but telling you how would likely be against this site's rules.

Re:Web4 Should Run on LaTeX by garbagecoder on Sunday November 28, 2021 @06:32PM (#29374414)
We don’t see html raw either dude
Re:Web4 Should Run on LaTeX by tasogare on Sunday November 28, 2021 @10:43PM (#29376127)
Username checks out. It's not the same: HTML is interpreted and often modified on the fly (with JavaScript), with the source being a click away, but it's still just HTML. On the other hand Latex documents are compiled into other formats like PDF that are distributed, instead of the Latex source.
Re:Web4 Should Run on LaTeX by dredmorbius on Sunday November 28, 2021 @11:54PM (#29376532)
Correct, further:

- The compilation means that there's at least a check for syntactic validity before any old crap is published.

- JS-based HTML can be fully dynamic to the extent that there's no sense of an underlying document at all. There are times when this is useful. That is an exceedingly small minority of the cases in which it is used. The fact that it's often preferable to rerender an HTML document as PDF, simply for readability, let alone archival, should speak volumes.

Re:Web4 Should Run on LaTeX by ttybird on Monday November 29, 2021 @04:34AM (#29377893)
I talked about the compilation aspect at https://news.ycombinator.com/item?id=29372937 In addition to that there are various checkers for html.

There is lua-based LaTeX and js-based pdf. Just use html without JS.

"The fact that it's often preferable to rerender an HTML document as PDF, simply for readability, let alone archival, should speak volumes."

The fact that it's always preferable to export a LaTeX document as pdf...

Re:Web4 Should Run on LaTeX by ttybird on Monday November 29, 2021 @04:25AM (#29377844)
Username checks out? Are people who compile markdown, org (or even LaTeX) via pandoc into html somehow "garbage coders"?