-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TeX for the web #5
Comments
Past attempt in firefox, https://bugzilla.mozilla.org/show_bug.cgi?id=630181 |
Yes, @bramstein it would be fantastic to have your input on this :) @rht Yeah, I saw that issue, and was somewhat amused by this comment:
|
I think the performance argument is not a very good one. It'll get slow with very large paragraphs, but there are ways around that (splitting the paragraph, falling back to the greedy line breaking algorithm, etc.) The bigger issue is that some parts of CSS are incompatible with the TeX model. Even if it were possible to combine CSS and the glue and boxes model, it'll require a significant rewrite (which browser vendors are understandably not a huge proponent of). As for doing it as a library: I think that is a reasonable approach if you limit support to a subset of HTML and CSS. All modern browser now support sub-pixel positioning, so some of the ugly hacks I had to do in Typeset are no longer necessary (and the whole thing becomes much more performant). |
Me either
Frankly I'd be happy with anything more intelligent than the greedy algorithm used by browsers (somewhat disturbingly it seems IE is the only one supporting something like this currently)
Definitely, I only intend to support the basic subset output by LaTeX-to-HTML conversion tools like tex4ht or LaTeXML
That's good to hear @bramstein I know you've said that |
If you have an example to pinpoint this incompatibility... It's either full TeX typesetting onto a subset of html/css/js, or parts of TeX on full html/css/js (which e.g. for math, is already well supported). If the goal is to better format the tex4ht/latexml out of scientific papers, then the former is preferable. Also, mind the format size:
(This one needs justification as well: https://github.com/worrydream/EarlyHistoryOfSmalltalk) |
(...what is it like to read originally paged books but without the page breaks helper?) |
@rht most of that 4MB is poorly compressed images, which can be improved (eg. using SVG instead of PNG) Re pagination: I don't think trying to emulate physical books too closely is a good idea, but something definitely needs to be done to improve location memory Edit: it would be cool if you could leverage something like https://en.m.wikipedia.org/wiki/Method_of_loci for this purpose, eg: gradually changing background colour/pattern/image as you scroll down the page |
Another example: https://ipfs.io/ipfs/Qmav57P5mmwcpUtmgRb2tp9j6YpXZdgobxDv7VBeJtgtCp/ |
@davidar sorry for the late re, I wonder if it is useful to have a more fine-grained href (paragraph, section), like https://github.com/ipfs/go-ipfs/blob/master/core/bootstrap.go#L4. For the images, there is also https://www.npmjs.com/package/gulp-imagemin. For the qualia of a book, now that it is confined to a flat screen, it has less attributes and becomes less of a physical 'thing'. This stuff is more related to #2. For the experiment with method of loci, it would have been preferred if the author had incorporated this method from the beginning. Because it is more subjective (there is risk of fogging the intention of the author), and more pervasive than just a change in font or layout. If I were to use one, I'd construct such that the mnemonic is naturally connected to the text e.g. a book about the innards of a ship (thought) & the ship it describes (extension). |
(papers are often annotated externally, but codes aren't. They are instead referred by range of line number |
@davidar that looks really good!! maybe soon we'll have damn clickable references :) |
imported modules in code are not clickable either (unless with sourcegraph). |
The raw of https://github.com/rht/papers/blob/href/ipfs-cap2pfs/ipfs-p2p-file-system.pdf has clickable references. |
@rht yes, section/paragraph linking is definitely something I'd like to do
Yeah, I'm not trying to emulate a physical book, but I'd like to remedy some of the deficiencies of on-screen reading in terms of recall, etc.
I've experimented with subtly changing the background colour based on scroll position, which seemed to work quite nicely, although it had some technical problems, so i decided to take it out for the moment.
@jbenet Yes, that's definitely on my radar, I really hate traditional bibliographies (there's this thing called hyperlinks, people). Of course, you can't hyperlink a dead tree, but who prints stuff these days?
Cool, although it's not quite as seamless as it could be (e.g. having a citation link directly to the section of the article the author is referencing). |
I've broken this into a separate project now: https://davidar.io/TeX.js/ Please submit bugs / feature requests to https://github.com/davidar/TeX.js/issues |
Since the html page can't be annotated (/PR-ed), I thought apple had brought typography to the web? The os in the screenshot is NeXTSTEP.
But again, this is just a mnemonic tool (associating 2 random slightly related facts, much like naming star constellations). Unless the background color is calculated based on the aggregate sentiment of the text in a page/paragraph or something (and there is still risk of fogging the author's intention).
The recent (in TeX timescale) biblatex package by default displays url if the field exists, but this is the amount of boilerplate code for clickable refs in https://github.com/rht/papers/blob/href/ipfs-cap2pfs/ipfs-cap2pfs.tex#L12-L27.
The ecosystem doesn't exist yet, but meanwhile, this can be done manually by the author, e.g.
Similarly, to cite the definition of merkledag in the paper, https://ipfs.io/ipfs/QmR7GSQM93Cx5eAg6a6yRzNde1FQv7uL6X1o4k7zrJa3LX/ipfs.draft3.pdf #section2.3sentence2footnote. |
hyphenation on the web, 2011, http://blog.fontdeck.com/post/9037028497/hyphens. |
You're welcome to PR the HTML page (is there a difficulty in doing so?)
Yes, I'm having trouble seeing the relevance here though?
Of course. I'm not trying to associate semantically meaningful images to the text, I'm simply trying to improve the ability to recall the position in the text where you read something. The baseline is "I read this phrase at the bottom of the left-hand page when I was roughly two-thirds of the way through the book", so I'm not aiming for anything more meaningful than that.
I'm not sure if this is what @jbenet meant, but personally I'm talking about removing the bibliography entirely in favour of embedding hyperlinks directly into the in-text citations. (Although someone can generate a bibliography from this information if they so desire.)
That's why I'm trying to bootstrap the ecosystem with the arXiv corpus ;) |
I mean, the display of the paper (https://davidar.io/TeX.js/) can't be annotated that I can only comment on the source code.
That is still a more precise address than referring to a background color shade.
Had thought of that when parsing what 'clickable references' means. But wikipedia still does with displaying the references in a section https://en.wikipedia.org/wiki/Bibliography#References. Edit: s/background color/background color shade/ |
|
@rht You should now be able to directly annotate https://davidar.io/TeX.js/ (and any other page using TEX.js) thanks to @hypothesis (cc @RichardLitt @nickstenning) 😄 Note to self: think about integrating @ipfs and @hypothesis (cc @jbenet) |
@davidar this works very well, good stuff! |
Would this be a good repo to open an issue for designing and discussing ipfs comments? |
@tilgovi i think so |
Opened #12. |
@davidar where was your hypothesis annotated version? not finding it |
@jbenet the hypothesis enabled version doesn't seem to have made it into ipfs yet, will add it to my to-do list |
cc @BigBlueHat |
It has long been possible to convert TeX to HTML (#1). However, I think it's fair to say that the results are often hideous, as web browsers (by default) suck at typesetting compared to TeX. Fortunately, it is now possible to work around some of these deficiencies with JS and CSS, which I've tied together in
this demohttps://davidar.io/TeX.js/ ( https://github.com/davidar/TeX.js )The aim of this is to achieve (an approximation to) the professional quality of TeX typesetting, whilst integrating with the web and optimising for on-screen viewing better than a PDF viewer can.
The text was updated successfully, but these errors were encountered: