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

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

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.


12

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


11

I'm not certain exactly what you are looking for. There are a few ways which I can see interpreting what you're asking for. How to implement it, or what to use, is going to depend on what you want and what's comfortable for you. Bookmarklet(s) Your code currently replaces the content of the text area with the text you've put in the bookmarklet. Personally, ...


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 ...


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 ...


8

$\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) ...


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.


5

You can define macros in MathJax. As far as I can tell, you cannot use numbers in macro names. For example, this defines a macro called \Rsq which then types $\newcommand{\Rsq}{\mathbb R^2}\Rsq$. $\newcommand{\Rsq}{\mathbb R^2}$ $\Rsq$ Macros can also use parameters. For example, the macro define below can be used as $\newcommand{\Map}[3]{{#1}\colon{#2}\to{...


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 ...


3

To make my comments into an answer: Firstly, you can define it manually, so \operatorname{sech}(x) renders as $\operatorname{sech}(x)$. A more fancy way is to put \DeclareMathOperator{\sech}{sech} somewhere in your post, and then \sech will work everywhere in the post. For example, I'll declare the operator (invisibly) here: $\DeclareMathOperator{\sech}{...


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