avendya: blue-green picture of a woman's face (Default)
avendya ([personal profile] avendya) wrote in [site community profile] dw_suggestions2011-02-04 05:44 pm

LaTeX Support

Title:
LaTeX Support

Area:
entries

Summary:
It would be really, really nice if Dreamwidth supported LaTeX in entries.

Description:
<a href="http://en.wikipedia.org/wiki/LaTeX">LaTeX</a> is a typesetting system usually used for math & science, but allows fine control of formatting of text.

It would allow people to have more control of the formatting of their entries - for instance, line spacing. It is currently pretty much impossible to write about math or math-heavy science on Dreamwidth; LaTeX support would not only make this possible, it would make it elegant. It would also allow people precise control of the layout and presentation of their text - if you look around on the internet, you can see the sheer variety of things you can make with LaTeX.

Problems/drawbacks: requires people to know LaTeX, and I am unsure how many people would learn LaTeX in order to typeset on Dreamwidth. Not that many people want to typeset math on their journal.

Other ways to accomplish decent math/science typesetting: ... ... ...

LaTeX is pretty much the only game in town when it comes to typesetting math. While one <em>can</em> typeset in HTML, it is inelegant and time-consuming.

Poll #5997 LaTeX Support
Open to: Registered Users, detailed results viewable to: All, participants: 59


This suggestion:

View Answers

Should be implemented as-is.
12 (20.3%)

Should be implemented with changes. (please comment)
4 (6.8%)

Shouldn't be implemented.
7 (11.9%)

(I have no opinion)
34 (57.6%)

(Other: please comment)
2 (3.4%)

[personal profile] faithofone 2011-02-14 08:36 am (UTC)(link)
I'm confused about how this would work. I get what the point of LaTeX is, but how does it generally work when used on the web? Would this content be displayed graphically or styled via HTML?
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)

[personal profile] pauamma 2011-02-14 09:00 pm (UTC)(link)
/me seconds the question. (In addition, I'm not sure I want to got hrough another "how to prevent annoying fpage formatting breakage" learning curve. )

[personal profile] faithofone 2011-02-14 10:01 pm (UTC)(link)
If it weren't for the fact that we've got this new awesome ability to make style=light persistent, I'd have my reading page broken almost daily by someone posting an image that's just too darn big. Given my very small screen resolution, a need for large font sizes and feeling really guilty if I don't provide at least some sort of side-bar navigation for visitors who are actually viewing the page in it's default style, I have about 525px of horizontal space for content to display there.

I'm not going to be having any math-heavy stuff on my reading page, but I imagine using anything that sets specific sizes like this could create a ton of issues with content not being readable for people with differing screen resolutions, font sizes etc.
matgb: Artwork of 19th century upper class anarchist, text: MatGB (Default)

[personal profile] matgb 2011-02-14 11:12 pm (UTC)(link)
In case it helps, due to persistent large image posters kciking around (I primarily use a 1024*600 netbook of my phone), I put this in my CSS:

.contents img {max-width:99%;}

No image can then display at above the width of the main column, it's working fine for me and might help you: caveat, my layout is entirely bespoke, and I use %ages to set my main column, so it might not work for the normal layouts, LMK if it doesn't and you want it fixed as I'd like to know it works well for everyone.

[personal profile] faithofone 2011-02-14 11:24 pm (UTC)(link)
I'd throw that in there, but I know that there's issues with it and IE6, and I just can't bring myself to screw things over for those folks. Not that Dw's main page isn't broken in IE6 already, but at the moment my journal is still readable in IE6. IE6 doesn't know what to do with max-width and renders it as a normal width.
matgb: Artwork of 19th century upper class anarchist, text: MatGB (Default)

[personal profile] matgb 2011-02-14 11:30 pm (UTC)(link)
But how many people using IE6 will be looking at your reading page? And regardless, if it doesn't know how to do with it, it does nothing, so they don't get hurt, right?

It's possible to do it so it only works for you when you're logged in if you want to make it very specific, I don't tend to do that in CSS but it is doable, I'd need to dig out some older test code I was playing with (I made my layout look terrible just for [personal profile] miss_s_b for a few days, very silly...)

[personal profile] faithofone 2011-02-15 12:20 am (UTC)(link)
I'm not sure what the stats are for how many people still use IE6, but I know a few people that still use it (hell, it's the only version of IE I have).

But in answer to the other question, it would be wonderful if when IE didn't understand something it did nothing with it, but unfortunately it tries to guess what to do. If I'm remembering correctly (which I could be completely not remembering correctly), it renders max-width attributes as if they were width attributes. So instead of getting it maxing out at 99% of the parent, or rendering at 100% of normal, it renders at 99% of the parent attribute *all* the time.

Of course, I could be full of crud at this point, because I haven't tested it recently, but I remember having several sites I was working on for people break horribly when viewed in IE because they'd used max-width attributes.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2011-02-15 12:25 am (UTC)(link)
Over the past year, IE represents 13.08% of DW's traffic (on the pages we use web analytics for, which are site-skinned pages outside of journal space -- so anything that starts with www.dreamwidth.org, not username.dreamwidth.org). IE6 represents 5.61% of that total. There have only been 26,081 visits to site pages using IE6 in the past year.

Just FYI!

[personal profile] faithofone 2011-02-15 12:41 am (UTC)(link)
I'm probably a horrible person for it, but every time I see an IE stat that small it makes me grin like an idiot. Freedom of browser choice is something I care a lot about, but it doesn't stop me from almost snoopy dancing when I see IE traffic stats that low. Thanks for pulling numbers for us.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2011-02-15 12:43 am (UTC)(link)
NP! (I have the same reaction. *G*) More detailed numbers go to [site community profile] dw_design from time to time. (Read: whenever I remember and feel like digging them out of the analytics account.)
matgb: Artwork of 19th century upper class anarchist, text: MatGB (Default)

[personal profile] matgb 2011-02-15 12:30 am (UTC)(link)
Ah. If it reads it as width:99% then that would be a problem, of rather interesting nature. I've asked Denise if she can dig it out of the stats (link) but I know it's a small number (1 of my 62 IE visits in the last month are IE6). But like you say, not something you need so we're good anyway.

I might redo my code to make it only work on my reading and network pages though, as while I always try to define image sizes properly it might still mess up on my entries.
marahmarie: (M In M Forever) (Default)

[personal profile] marahmarie 2011-02-16 02:14 am (UTC)(link)
You could always set max-width at n%, then use an IE6 hack to set an override for IE6 - not saying it's clean, pretty or good coding, nor that anyone should, but if you're comfortable doing so and there's no other good answer...

.entry-content img {max-width: 99.5%;}
*html.entry-content img {width: npx!important; /* where n=max pixels the entry-holder can comfortably support */}
Edited 2011-02-16 02:15 (UTC)

[personal profile] faithofone 2011-02-15 12:22 am (UTC)(link)
Oh, I could put it in my user-content.css and be done with it. But I think I like using style=light better anyway. I appreciate the ideas though.
tree: text: dreamwidth, in blue on a blue and green background ([else] dreamwidth sheep)

[personal profile] tree 2011-02-14 09:57 am (UTC)(link)
I am unsure how many people would learn LaTeX in order to typeset on Dreamwidth.

*raises hand* i would find an excuse! that looks awesome.
kerravonsen: Buffy facing a mirror image of herself: "Shadow Self" (shadow-self)

[personal profile] kerravonsen 2011-02-14 10:03 am (UTC)(link)
I can understand why you would want LaTeX to be able to typeset math, but using it to control line-spacing etc would be overkill, considering that whatever you do would have to be translated into HTML somehow, and you'd probably end up losing all that precious formatting. I've wrestled with LaTeX-to-HTML translators and they can be a real pain. I figure it would only be worthwhile for dealing with math, not anything else. And even then it would probably only look good if it was converted into images.

So I'm confused and uncertain about this suggestion.

[personal profile] faithofone 2011-02-14 09:49 pm (UTC)(link)
This is exactly what I was thinking. If the whole thing comes down to embedding an image, there's issues I see with that.

Right now Dreamwidth doesn't offer image hosting for anybody. I'm unsure of how fair it is to designate math content as special and therefore more worthy of getting to have images hosted on-site.

So if the images aren't being hosted on Dreamwidth, then you're going to have to use some third-party service to get them on the net anyway. Are there already third-party tools for LaTeX to png or something? If so, I think it is rather silly to use Dreamwidth as a converter and then host the images offsite.

If and when Dreamwidth offers image hosting, I have no issue with providing this as Dreamwidth specific-code. Doing it like the polls or something where the data for it is not actually stored within the entry but instead replaced with <latex id="23432" /> or something.

However I think that the idea posted lower down in the comments about using MathML is a better choice. But I am not a math person, and wouldn't use it either way, so I have no idea how the differences between MathML and LaTeX would affect those who want to describe complex equations.
andrewducker: (Default)

[personal profile] andrewducker 2011-02-14 10:51 am (UTC)(link)
If your target audience are running Firefox then you can use MathML:
http://www.mozilla.org/projects/mathml/start.xhtml
http://www.w3.org/Math/testsuite/mml2-testsuite/TortureTests/Complexity/complex1.xml

Not sure how well DW would cope with this though.
andrewducker: (Default)

[personal profile] andrewducker 2011-02-14 10:53 am (UTC)(link)
Aha - apparently Chrome/Safari will support that soon too:
http://en.wikipedia.org/wiki/MathML#Embedding_MathML_in_HTML5_files
axiom_of_stripe: DC Comics: Impulse with a batmug, captioned "Daydream Boy" (Sweet dreams are made of this)

[personal profile] axiom_of_stripe 2011-02-14 01:52 pm (UTC)(link)
Not that I've had occasional to use LaTeX since before I've had a blog, but it would be awesome to know that there was a platform that would support it if I wanted it!

[personal profile] rho 2011-02-14 02:09 pm (UTC)(link)
I think that full LaTeΧ support is overkill, and also an implementation nightmare, but I would love better and easier mathematical typesetting. Something along the lines of ASCIIMathML, perhaps?
deborah: the Library of Congress cataloging numbers for children's literature, technology, and library science (Default)

[personal profile] deborah 2011-02-14 05:20 pm (UTC)(link)
I think an investigation into whatever is the most widely supported implementation for math and science markup in HTML 5 would be a good way to go.
troisroyaumes: Painting of a duck, with the hanzi for "summer" in the top left (Default)

[personal profile] troisroyaumes 2011-02-14 05:03 pm (UTC)(link)
This would go a long way to encouraging me to keep up a proper science blog on DW...
melannen: Commander Valentine of Alpha Squad Seven, a red-haired female Nick Fury in space, smoking contemplatively (Default)

[personal profile] melannen 2011-02-15 02:49 am (UTC)(link)
I like this in theory, but I have the same reservations as the above about compatibility/accessibility/readability issues.

If DW could parse LaTeX into standards-compliant html, though, I am all for it!
exor674: Computer Science is my girlfriend (Default)

[personal profile] exor674 2011-02-17 12:29 pm (UTC)(link)
conditional as-is: if intended for math only. possibly some limit to keep people from putting something too outrageous in there without limiting use for vert hard math.
kaz: "Kaz" written in cursive with a white quill that is dissolving into (badly drawn in Photoshop) butterflies. (Default)

[personal profile] kaz 2011-08-10 03:27 pm (UTC)(link)
Adding stuff because I just suggested something similar.

Having at least mathematical formulae support would make a massive difference. I'm a maths PhD student and occasionally play with the idea of doing some "maths for the layperson"-esque post, possibly on topics like "a basic introduction to groups" or "why does 0.999... not equal 1" or whatever. As it stands, it's impossible because I can't use LaTeX, meaning I pretty much can't use formulae at all (HTML is so not an adequate substitute. And no, as far as I can tell there is no way to do this myself via MathML or whatever. The only option I can see is to find some browser plug-in that will turn LaTeX code into displayed maths and then just write the code and ask people to install that plug-in if they want to read the post, which is so not optimal.) So, you know, for all the people going "why is this important?" - it's not necessary unless you want to talk about certain subjects, which it's next to impossible to talk about without.

As it happens, there's been a lot of work done in the maths/science online community for LaTeX support for formulae. One I see a lot, and have in fact used myself on another site, is MathJax (MathJax website here.) This seems to be the de facto standard, although I don't know if there are any issues that would lead to this being impossible to implement in DW. It also claims to be screenreader-friendly (haven't spoken to a screenreader-user so I don't know for sure) and I *think* handles a lot of the objections that have come up here although I don't know for sure, but in any case I think this is probably a good place to start if you'd be wanting to implement it. jsMath is another one, although that seems to have been generally succeeded by MathJax. There may be other ones or subtleties I don't know about, though.

Also, the way I'd imagine this working would be to have it be optional, and maybe get an additional tag a la <latex> or something like that for "parse this bit but not the others" - LaTeX commandeers a lot of standard symbols (\ and $ are two, for instance) that would make it infeasible to "add onto" everyone's entry.

ETA: since I voted for "implement with changes", I don't really care about the formatting elements of LaTeX and people have brought up good arguments against. I do however *really* want to see the formula typesetting elements of LaTeX.
Edited 2011-08-10 16:04 (UTC)
azurelunatic: Vivid pink Alaskan wild rose. (Default)

[personal profile] azurelunatic 2011-08-13 07:27 am (UTC)(link)
Some of my friends, [twitter.com profile] scatterbeams are screenreader users who love testing.

Direct link to the MathJax accessibility thingy: http://www.mathjax.org/resources/articles-and-presentations/accessible-pages-with-mathjax/