# Specific Latex commands for user's account

I think it would very useful to permit every user to add to their profile a list of Latex command, so that they are readily at disposal.

For instance, in all of my .tex files I add in the preamble

 \newcommand{\AND}{\quad\text{and}\quad}


which is handy to put an 'and' in the middle of the equation environment.

Don't you think it would be nice to add such a feature in the StackExchange network?

## EDIT:

I tried to put a command in my "about me" section. The result is that, whenever I am in a page where my avatar is showed (e.g. a question I posted or a question I replied to) and I hover on it to let my description appear, then the command works in the preview. So I guess it should be very easy to add this feature!

• Did you try searching for previous feature requests and discussions on the topic? – Asaf Karagila Dec 3 '13 at 11:12
• Yes but I didn't find anything related – Abramo Dec 3 '13 at 11:17
• I think it has been described somewhere here that: 1) you can define macros in any post, but 2) those macro definitions then persist throughout the thread, i.e. affect all the other answers that come after yours. A consequence of this may be that: the list of other affected posts would depend on how the viewer prefers to sort them (or how their relative order changes due to up/downvotes). IOW, unless I'm mistaken, MathJax cannot make those macro definitions local to your answer(s) only. – Jyrki Lahtonen Dec 3 '13 at 11:25
• @Abramo: you just didn't search hard enough :-) meta.math.stackexchange.com/questions/6443/… – Willie Wong Dec 3 '13 at 11:29
• @JyrkiLahtonen: that is not true. StackExchange could, in principle, force the use of the begingroup extension. See my comment above. That could solve the problem of localising personal TeX definitions. – Willie Wong Dec 3 '13 at 11:30
• The main objection that I have seen raised previously with regards to this is that this reduces portability of MathJax code for the site. If I were to want to quote something that you wrote, I can usually just view the source of your post (by clicking the "edit" button) and copy the passage I want to quote. If certain MathJax commands depend on non-visible definitions, this makes copying and quoting mathematics a lot harder on this site. – Willie Wong Dec 3 '13 at 11:33
• Ok, so I was mis/uninformed. Thanks, Willie. – Jyrki Lahtonen Dec 3 '13 at 12:20
• This seems like a duplicate: meta.math.stackexchange.com/questions/8834/… – Martin Sleziak Dec 3 '13 at 12:46
• @JyrkiLahtonen I guess you meant this post (or some of the posts linked there): meta.math.stackexchange.com/questions/4130/… – Martin Sleziak Dec 3 '13 at 12:54
• @Abramo See my answer. – user93957 Jan 10 '14 at 21:44

There are some problems with this suggestion: (1) it makes sources of posts less readable (/portable); (2) what should happen when one user edits other user's post? (3) including a lot of command definitions in all user's posts certainly won't make processing of MathJax faster.

Somehow this feature request reminds me of the Tower of Babel.

• Why the Tower of Babel? Please expand, I'm curious ;-) – Abramo Dec 3 '13 at 17:51
• Some comments from a MathJax perspective. It would be possible to resolve 1) offering a "basic" source option (that would resolve macros). We don't offer this right now but if Stackexchange asked, we could look into it. 3) is a non-issue -- the main bottlenecks are downloading of components and the actual (MathML) rendering; TeX processing and conversion is very fast (of course evil looping macros could slow things down but MathJax caps looping). Of course that leaves 2) which seems less of a technical issue. – Peter Krautzberger Dec 4 '13 at 3:22
• @PeterKrautzberger Resolving macros would probably have to be done server-side, so that the sources are available for mass download (which is one of basic SE concepts). E.g., one should be able to use the SE Data Explorer to download 50,000 posts that satisfy certain criteria, and put them up elsewhere. – Post No Bulls Dec 4 '13 at 5:23
• @PostNoBills it's not for me to say what requirements SE might or might not have. I was merely pointing out what MathJax could do. – Peter Krautzberger Dec 5 '13 at 6:41

## One own posts:


This is the same procedure Felix Marin uses... I guess.

You also have to introduce all the \newcommand in the very top of your answer\question so that they get loaded.

To resolve point $\1$ made by Grigory M, add a text with a tiny size on the bottom of your text indicating that you have used some new commands.

Point $\2$, well I don't think that someone who know how to deal with newcommands and all that stuff would ever make a mistake that would need an edit.

Point $\3$ is not a problem, unless you still use $\color{grey}{\text{IE$\,$6}}$ and you have a Pentium $3$.

$\tiny{\text{this post uses}\textit{ new commands.}}$

## Edits:

It is highly recommended to not introduce new commands when editing, even if it is time saving (like for example a post where there lot of $log$, adding a new command \newcommand{log}{\log} to display them correctly), since there is a much better alternative: Copy the content of the post, then use the Find\Replace command in your text editor to replace the log s for example with \log.