# TeX Delimiters should be changed

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. • 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. Mar 10 '11 at 1:01 • @Jeff - There's 12 examples for you. Also, I tried to do a no-op edit as you described, and it registered. Mar 10 '11 at 4:00 • @Jeff - And here is a brand new one. They used $$ to get a TeX dollar sign (based on this chat). Mar 10 '11 at 17:02 • 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). Mar 12 '11 at 19:49 • How do we get this fixed? It's breaking a lot of old questions. May 18 '11 at 15:37 • @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. May 19 '11 at 14:08 • @reemrevnivek: But isn't the usage here inconsistent with the way MathJax is used everywhere else? Who is in control of the delimiters used? May 19 '11 at 14:26 ## 4 Answers 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. • 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. Jun 1 '11 at 4:20 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. 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. • The \ itself looks inconsistent in the normal text :P Mar 18 '11 at 4:11 • @nickT, the fully released site will use serif font, this will make the TEX look at home. Mar 18 '11 at 4:27 • 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. May 19 '11 at 14:28 • @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. May 19 '11 at 14:35 • @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. May 19 '11 at 15:42 • @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. May 19 '11 at 19:32 • @Kortuk: The default delimiters improve the site for everybody, not just new users. How many other SE sites have MathJax enabled? May 19 '11 at 19:38 • @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. May 19 '11 at 20:41 • @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? May 30 '11 at 14:55 • @endolith, seems it will have to be. May 30 '11 at 14:58 • @Kortuk: I'm asking if it's even possible. Can comments be edited? May 30 '11 at 15:03 • @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. May 30 '11 at 15:06 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 • 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. Mar 11 '11 at 6:26 • 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. Mar 11 '11 at 6:27 • @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. Mar 11 '11 at 6:32 • @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. Mar 11 '11 at 6:36 • @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. Mar 11 '11 at 9:15 • @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. Mar 11 '11 at 9:17 • @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. Mar 11 '11 at 9:20 • 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... – W5VO Mar 13 '11 at 17:16 • @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. Mar 15 '11 at 14:57 • @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. Mar 15 '11 at 14:59 • @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. Mar 15 '11 at 15:03
• @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. Mar 16 '11 at 0:00
• @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. Mar 16 '11 at 7:41
• @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. Mar 19 '11 at 23:43
• @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. May 31 '11 at 8:11