The Stack Overflow podcast is back! Listen to an interview with our new CEO.
26

I don't think there exist general guidelines. However there are some characteristics of this site and of MathJax that together suggest, at least to me, a certain set of rules: The relevant characteristics of this site: The question is always on the top. Even if the answers are split over multiple pages, the question is on top of each page. Moreover, it is ...


22

As Mariano points out, this has been reported before. Because of that conversation, MathJax v2.0 includes an extension (the begingroup extension) that would allow you to isolate the effects of \def, \newcommand, etc. to a single question, answer, or comment, but it would require changes to the SE code to force that to be used. The changes would be to ...


20

It pains me to break this thread by fixing the issue, but here we are. :) We are now inserting \begingroup and \endgroup directives into post and comment bodies, so all command definitions should be scoped to individual posts. For now, I'm only enabling this on Math (and here on meta), but barring any issues this change will go live on all MathJax-enabled ...


15

While celtschk already mentioned this in their answer, I think this deserves highlighting: There is a way to use MathJax macros safely in SE posts: Add $\require{begingroup}\begingroup$ at the beginning of your question / answer. Add $\endgroup$ at the end. Use macros as much as you want in between. Any macros you define in your post after \begingroup ...


12

A linked question contained some malicious code in the title. I've removed it.


11

Proposal: Defining macros in the titles should be strongly discouraged and we should ask Stack Exchange to add them to blacklisted phrases in the titles.1 This would mean blacklisting: \DeclareMathoperator, \newcommand, \renewcommand, \def\ in the titles.2,3,4 Possibly also \let - as pointed out by Hagen von Eitzen in the comments. Here are some problems ...


11

Yes, this is possible. You can run a list of commands in the header of the documents that define a list of macros. I have that on my website, so I can always write \ZFC and produce $\mathsf{ZFC}$ in math-mode. Of course, in the context of your question this is only very theoretical. I don't see a community agreement happening anytime soon.


9

This answer will serve as a demonstration: $$\sin \pi = 0$$ What I typed was true (edit or view source), but what you see is false.


9

In my opinion, the obvious solution would be to gradually edit all and only those posts where you have redefined a predefined LaTeX-MathJax command. The reasons are as follows: If anyone wants to submit a new answer they might not understand why their LaTeX is not working. Worse still, it is possible that their accidental use of your redefined command might ...


7

One of the links from Greyes' question is: Simple trig problem- whose URL is actually math.stackexchange.com/questions/885521/renewcommand-tan-sin-renewcommand-arctan-arcsinsimple-trig-problem which looks suspicious but my HTML skills are limited so this might be a red herring.


7

$\require{begingroup} \begingroup$As discussed in the comments to Davide Cervone's answer, I have added a client-side fix to this bug to version 1.2. of the Stack Overflow Unofficial Patch. The fix works by injecting a special hidden TeX command (currently named \resetstack) at the beggining of each post, comment, snippet (as shown e.g. on the front page) ...


4

So if I understand your post correctly, the problem you see is that answering takes a long time and the reason is that you don't have macros automatically at your disposal. (Of course, for other users there might be other factors which slow them down - but it seems that you have singled out that this particular things as a problem for you.) If you have a ...


Only top voted, non community-wiki answers of a minimum length are eligible