12
\$\begingroup\$

The current LaTeX escapes of $ ... $ need to be changed.

Several questions/answers have two dollar signs in the text somewhere. E&R has a number of questions with prices, and we usually use USD, represented by the $ character, as the monetary unit. This has lead to a number of broken questions and comments with the new LaTeX syntax.

Here are some examples of questions, answers, and comments:

I just compiled this list by searching for the word "Costs" with the Stackexchange search box. There are almost certainly more.

MathJax can be configured to use other characters, like $$...$$, \[...\] and/or \(...\) as delimiters. In fact, the documentation goes so far as to recommend against using single dollar signs for delimiters: https://docs.mathjax.org/en/latest/tex.html

Note in particular that the $...$ in-line delimiters are not used by default. That is because dollar signs appear too often in non-mathematical settings, which could cause some text to be treated as mathematics unexpectedly. For example, with single-dollar delimiters, ”... the cost is $2.50 for the first one, and $2.00 for each additional one ...” would cause the phrase “2.50 for the first one, and” to be treated as mathematics since it falls between dollar signs.

I understand that single dollar signs may be a good choice for some other stack exchange sites, where pricing is rarely if ever discussed. However, on E&R, the use of $ ... $ is a bug.

\$\endgroup\$
7
  • \$\begingroup\$ can you point to specific examples of this? Also, the processing has changed, so be sure to edit (no-op edit, enter a space) and save the questions if they are very old. \$\endgroup\$
    – Jeff Atwood Mod
    Commented Mar 10, 2011 at 1:01
  • \$\begingroup\$ @Jeff - There's 12 examples for you. Also, I tried to do a no-op edit as you described, and it registered. \$\endgroup\$ Commented Mar 10, 2011 at 4:00
  • \$\begingroup\$ @Jeff - And here is a brand new one. They used $\$$ to get a TeX dollar sign (based on this chat). \$\endgroup\$ Commented Mar 10, 2011 at 17:02
  • \$\begingroup\$ Is it possible to turn on MathJax only for the pages that actually use it? (I agree that single-dollar-delimiters is making a bunch of pages look wierd, and the delimeter should be changed back to what the documentation recommends). \$\endgroup\$
    – davidcary
    Commented Mar 12, 2011 at 19:49
  • \$\begingroup\$ How do we get this fixed? It's breaking a lot of old questions. \$\endgroup\$
    – endolith
    Commented May 18, 2011 at 15:37
  • \$\begingroup\$ @endolith: We edit questions that don't escape their dollar signs. Jeff Attwood's comment way at the bottom: we don't want different basic usage of MathJax across the network; that would be like Markdown changing essentials like "how to bold" on a site by side basis. basically means that we're stuck with the current delimiters. \$\endgroup\$
    – Kevin Vermeer Mod
    Commented May 19, 2011 at 14:08
  • \$\begingroup\$ @reemrevnivek: But isn't the usage here inconsistent with the way MathJax is used everywhere else? Who is in control of the delimiters used? \$\endgroup\$
    – endolith
    Commented May 19, 2011 at 14:26

4 Answers 4

11
\$\begingroup\$

OK, we made it so that the only inline math delimiter supported here is \$ from the default of $

(if you are wondering why we don't like the other "defaults" from MathJax such as \( and \[ try typing them yourself in the answer box below to see why. Hint: Markdown.)

So now

This is $20 and that is $30

This is $20 and that is $30

should be unaffected while

This is \$20 and that is \$30

This is \$20 and that is \$30

should trigger inline math notation as before.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ AWESOME!!! Will get an edit party started soon to fix all the hacks that are now triply broken, but this should put us in the clear going forward. \$\endgroup\$
    – Kevin Vermeer Mod
    Commented Jun 1, 2011 at 4:20
11
\$\begingroup\$

I recommend following MathJax's recommendations and using $$ and \[ \]. It was a large mistake for MathJax to have been deployed ever using the single $ delimiter.

I recommend actually making all sites consistent, and on Math.SE running some script to basically replace $ with $$ as there is rarely a need for prices there. Here, you can do the same thing, but make a list of each post modified and publish it. This would let us go through the list, correcting it. It would also mean that less of these stupid mistakes keep happening. I see at least one MathJax mistaken post per day.

\$\endgroup\$
-1
\$\begingroup\$

Disregarding the load time issues.

The $ delimiter is an annoyance, our users seem to agree. This is not a large annoyance and if we changed the delimiter the sites would have an inconsistency. I think that changing old posts to cope with this will be worth the consistency between SO sites.

Just changing misuse will not be hard to fix in new posts either.

\$\endgroup\$
12
  • \$\begingroup\$ The $\$$ itself looks inconsistent in the normal text :P \$\endgroup\$
    – Nick T
    Commented Mar 18, 2011 at 4:11
  • \$\begingroup\$ @nickT, the fully released site will use serif font, this will make the TEX look at home. \$\endgroup\$
    – Kortuk Mod
    Commented Mar 18, 2011 at 4:27
  • \$\begingroup\$ Users shouldn't be required to jump through the hoops of learning a new language just to put a normal dollar sign in their posts. \$\endgroup\$
    – endolith
    Commented May 19, 2011 at 14:28
  • \$\begingroup\$ @endolith, I would prefer the use of a different delimiter. I was just explaining a different stance, no one voted for it, so our community is feeling a bit selfish. \$\endgroup\$
    – Kortuk Mod
    Commented May 19, 2011 at 14:35
  • \$\begingroup\$ @Kortuk: One person voted for it and I voted against it. :) How is it "selfish" to want a good experience for our users? Consistency is nice, but only because it improves the user experience. If blindly chasing after consistency is making the user experience worse, then someone's lost sight of the actual goal. \$\endgroup\$
    – endolith
    Commented May 19, 2011 at 15:42
  • \$\begingroup\$ @endolith, it depends on how you define selfish. I am saying that we want it our way because it will suit completely new users. Only a bit selfish, because we are not worried about the SE community continuity, making it harder for users from other sites to come over. I agree still, $ is not ideal for us. \$\endgroup\$
    – Kortuk Mod
    Commented May 19, 2011 at 19:32
  • \$\begingroup\$ @Kortuk: The default delimiters improve the site for everybody, not just new users. How many other SE sites have MathJax enabled? \$\endgroup\$
    – endolith
    Commented May 19, 2011 at 19:38
  • \$\begingroup\$ @endolith, i know of 2 only. But I think they have used it heavily, like math.SE, so it would be an inordinate amount of work to change. \$\endgroup\$
    – Kortuk Mod
    Commented May 19, 2011 at 20:41
  • \$\begingroup\$ @Kortuk: Assuming they don't listen to our community and force us to use the non-standard delimiters, is it possible to go back and edit all the questions, answers, and comments that have dollar signs in them to escape them? \$\endgroup\$
    – endolith
    Commented May 30, 2011 at 14:55
  • \$\begingroup\$ @endolith, seems it will have to be. \$\endgroup\$
    – Kortuk Mod
    Commented May 30, 2011 at 14:58
  • \$\begingroup\$ @Kortuk: I'm asking if it's even possible. Can comments be edited? \$\endgroup\$
    – endolith
    Commented May 30, 2011 at 15:03
  • \$\begingroup\$ @endolith, I can edit comments, You just need to link me to the question where the edit is or flag the comment asking me to fix it. \$\endgroup\$
    – Kortuk Mod
    Commented May 30, 2011 at 15:06
-7
\$\begingroup\$

In my opinion, the problem is that Tex (MathJax) is enabled here at all.

Can you make a case that MathJax is necessary on a plurality of questions?

Otherwise I am inclined to turn it off because

  1. It is an insanely heavy requirement on a site, upwards of 500kb per page load

  2. It can cause formatting problems, as you noted

\$\endgroup\$
16
  • 5
    \$\begingroup\$ Some kind of mathematical markup is needed, as electrical engineering is a kind of math. TeX is the best and most widely-known math markup, so it is a good choice. But single dollar signs are also widely used, because about 70% of electronics design is shopping. \$\endgroup\$
    – markrages
    Commented Mar 11, 2011 at 6:26
  • 1
    \$\begingroup\$ 500 kB per page load? Not browser-cached? How could each page require 50 kB of different data? I clearly have no idea how MathJax works. \$\endgroup\$
    – markrages
    Commented Mar 11, 2011 at 6:27
  • \$\begingroup\$ @markrages see yuiblog.com/blog/2007/01/04/performance-research-part-2 "40-60% of Yahoo!’s users have an empty cache experience and ~20% of all page views are done with an empty cache. To my knowledge, there’s no other research that shows this kind of information." essentially, you are crushing the experience of every new user that visits your site. Which is fine, if you can make a case that, say, 60% or more of all posts need this kind of math markup like on the math site. \$\endgroup\$
    – Jeff Atwood Mod
    Commented Mar 11, 2011 at 6:32
  • 1
    \$\begingroup\$ @markrages to be clear, I think MathJax is great but it is the Great White Whale of Enormous Browser Download Dependencies -- absolutely not something you turn on unless you're deadly serious about needing it everywhere. \$\endgroup\$
    – Jeff Atwood Mod
    Commented Mar 11, 2011 at 6:36
  • 4
    \$\begingroup\$ @JeffAtwood, this was a requested feature, and one that was celebrated by most of the active community. Electronics has its heart in differential equations, and robotics has its heart in electronics(the way we approach it). This leads to a greatly improved experience if we have the ability to display well formatted equations. \$\endgroup\$
    – Kortuk Mod
    Commented Mar 11, 2011 at 9:15
  • 4
    \$\begingroup\$ @JeffAtwood, Also, on that note, it may take a moment longer to load, which I have noticed in posts which have a large amount of Tex(the post where we had sandbox use), but the greatly improved quality of the available information when someone displays an equation in gorgeous readable form can easily set apart this site from many other sites on the internet. When I am trying to find the answer to a question and a forum post has someone attempting to write it using a standard keyboard it is my bane. Seeing a well formatted question and an answer that has been well formatted is priceless. \$\endgroup\$
    – Kortuk Mod
    Commented Mar 11, 2011 at 9:17
  • 4
    \$\begingroup\$ @JeffAtwood, I do not think that 60% of our posts will need it. It would be dishonest for me to say otherwise, but showing that this forum allows high quality and readable answers is something that will be a longer term boon to the site. I look forward to hearing back from you. \$\endgroup\$
    – Kortuk Mod
    Commented Mar 11, 2011 at 9:20
  • 3
    \$\begingroup\$ Out of curiosity, is there a way to have an interactive Latex editor (like MathJax) that would only be called when needed, and that would generate an image that could be referenced? A black and white PNG would be a lot smaller than 500kB... \$\endgroup\$
    – W5VO
    Commented Mar 13, 2011 at 17:16
  • 3
    \$\begingroup\$ @Jeff - The current implementation flouts the recommendations of MathJax. Leaving the delimiters in this state and using "It can cause formatting problems" as a reason for turning it off is unreasonable. \$\endgroup\$ Commented Mar 15, 2011 at 14:57
  • 2
    \$\begingroup\$ @Jeff - As a humble user of your service, I'd appreciate it if you'd take the page load dependency out of this answer. I'd welcome a separate question about whether the page load dependency is causing the site to be too slow, but this question is about the delimiters. \$\endgroup\$ Commented Mar 15, 2011 at 14:59
  • 1
    \$\begingroup\$ @Jeff - I fear that your inactivity on this bug and the TeX that's been used with the $...$ delimiters in the past week will become an argument against changing the delimiters. I'm offering to personally go through and fix every question which uses the non-recommended delimiters if you'll simply remove the line tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}from your config.js file to remove this argument. \$\endgroup\$ Commented Mar 15, 2011 at 15:03
  • 1
    \$\begingroup\$ @Kevin we don't want different basic usage of MathJax across the network; that would be like Markdown changing essentials like "how to bold" on a site by side basis. \$\endgroup\$
    – Jeff Atwood Mod
    Commented Mar 16, 2011 at 0:00
  • 1
    \$\begingroup\$ @JeffAtwood, I think this provides a valid reason. I think the SE consistence is more then worth than the small annoyance. I am making an answer for this. \$\endgroup\$
    – Kortuk Mod
    Commented Mar 16, 2011 at 7:41
  • 5
    \$\begingroup\$ @Jeff Atwood: I agree that it would be nice if "how to bold" in Markdown were consistent on every site on the internet. Therefore, I agree with reemrevnivek that E&R should use the default delimiters recommended by the MathJax documentation, consistent with every other site on the internet that follows MathJax recommendations. \$\endgroup\$
    – davidcary
    Commented Mar 19, 2011 at 23:43
  • \$\begingroup\$ @david unfortunately, there are deep conflicts with Markdown in the MathJax defaults; the characters used are escapes in Markdown. Try them yourself to see why. \$\endgroup\$
    – Jeff Atwood Mod
    Commented May 31, 2011 at 8:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .