4 ms·
Ask HN: How far are we from in-browser typesetting
Given advances in computing power and browser abilities, how far are we from in-browser
typesetting? Suppose we ignore issues such as reflow and legacy browser support. I am asking whether true typesetting, such as is provided by the LaTeX engine, is now possible with up-to-date technology.
- ChuckMcM 14y agoThis has been possible for a while, its even easier with WebGL. I would not be surprised if it made for a killer 'retina' display demo.
- mgualt 14y agoI would be interested to know whether a version of the TeX typesetting program could be implemented in WebGL or some appropriate tool. I have been seeing a lot more HTML5 demos with unusual placement of fonts and text. So it seems a no-brainer to port TeX to the browser (for many years this was considered impossible for some reason)
- ChuckMcM 14y agoMemory available to the browser was limited, sub-pixel rendering was impractical. There is a commercial product 'MathType' that uses TeX to render beautiful mathematics on web pages but I don't know if they have a WebGL version or not. If you read Don Knuth's book on TeX you can probably figure out how to make it run.
- mgualt 14y agoI will at least look at Knuth's book, though I doubt I will be able to make it work!
- andrewcooke 14y agowhat is missing now? what difference is there between "true typsetting" and current web layout engines? they seem pretty much identical to me. maths used to be a weak point, but take this page from my blog - http://www.acooke.org/cute/Calibratin0.html http://www.acooke.org/cute/Calibratin0.html - and scroll down to the maths. then look at the source. the source is basically tex. it's rendered in the browser using mathjax - http://www.mathjax.org/ http://www.mathjax.org/ that's all possible now.
- mgualt 14y agoWeb layout is nowhere near the kind of typesetting required for professional quality documents and books. I am aware of mathjax, which is useful for embedding snippets, but this is still far from what I am talking about, which is a complete publishing system such as latex, as is used by publishers for all kinds of documents, but for electronic active documents with features that go beyond those of books and PDF.
- andrewcooke 14y agoinstead of repeating your assertion perhaps you could explain how it is "nowhere near"? it's a different toolchain, with different end-users in mind. but you have an underlying engine that arranges text with arbitrary modifications to font styles in arbitrary regions. the kind of differences i see are at the level of whether those regions are rectangular or not (which css3 is addressing, i think). that is not critical for most use.
- mgualt 14y agoI think it is reasonably self-evident that one doesn't often find webpages with the quality of typesetting that one finds in many printed books. The TeX environment nowadays has hundreds of specialized packages which provide micro-typography support, programmatic diagrams, advanced mathematical features, detailed cross-referencing, multilanguage support, advanced treatment of fonts including ligatures, linebreaking, justification, character protrusion, grayscale balancing... A cursory glance at the PDFTeX author's thesis work may give an idea of how far the system has evolved: http://www.pragma-ade.com/pdftex/thesis.pdf http://www.pragma-ade.com/pdftex/thesis.pdf It is impossible for me to adequately convey the TeX ecosystem in a comment -- you may consider that my question is aimed at people already familiar with it. Now, I understand that current web technology seems to be improving to the point where, as you say, "you have an underlying engine that arranges text with arbitrary modifications..." So, I am left with the question of whether the TeX ecosystem can somehow be ported completely to create, say, HTML5 documents or something like this, instead of the current PDF output. I am talking about something new - this will not be a PDF, and it will not be a traditional webpage with features such as re-flow or "multi-browser support"... this would be an electronic publication where the author has complete control over the viewing experience. The advantage of this would be the possibility of extending TeX even further, to allow for programmatic control of the reading experience, to include features such as folding, nonlinear document structure, embedded media and code, and many other things I can't even fathom. If the current toolchain does in fact have the capabilities for TeX to be implemented in it - then it would be very interesting to create a plan for how to accomplish this goal in the proper way.
- _delirium 14y agoFormatting for print is one place that's still a bit tricky. Not much control over how browsers will print things, though some people I know have had success with PrinceXML as a print converter. Doing lots of "normal" print things like referencing page numbers is a bit unnatural as well, e.g. replicating the LaTeX \label \ref pair that lets you write things like "(see page 256)" without hard-coding it.
- mgualt 14y agoFormatting for print? I assume you aren't talking about /actual/ printing on paper... the whole point of my question is that we need a new typesetting system for active and web-enabled electronic documents which provides as much control over the reader experience as PDF does, but is not tied to the print format and has new features which are now possible.
- _delirium 14y agoAh ok, I took you to be asking what's needed for HTML5 technologies to replace LaTeX/ConTeXt and similar as general tools for typesetting, which would include the ability to target both paper and screen output. If it's for electronic documents purely, then I think we're pretty close, at least in terms of what the technology supports. Making it easy to do various kinds of typesetting tasks are perhaps another story; there is a lot of stuff that is technically possible with the tech modern browsers support but not easy to do, certainly not with a workflow as automated as LaTeX's.
- mgualt 14y agoI think you are absolutely right, and this brings us to a daunting challenge -- how to plan and implement the document of the future...
- deleted 14y ago[deleted]
- macca321 14y agohttp://googledocs.blogspot.co.uk/2010/05/whats-different-about-new-google-docs.html http://googledocs.blogspot.co.uk/2010/05/whats-different-abo...