6
$\begingroup$

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!

$\endgroup$
12
  • $\begingroup$ Did you try searching for previous feature requests and discussions on the topic? $\endgroup$
    – Asaf Karagila Mod
    Commented Dec 3, 2013 at 11:12
  • $\begingroup$ Yes but I didn't find anything related $\endgroup$
    – Abramo
    Commented Dec 3, 2013 at 11:17
  • $\begingroup$ 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. $\endgroup$ Commented Dec 3, 2013 at 11:25
  • 2
    $\begingroup$ @Abramo: you just didn't search hard enough :-) meta.math.stackexchange.com/questions/6443/… $\endgroup$
    – Willie Wong Mod
    Commented Dec 3, 2013 at 11:29
  • 2
    $\begingroup$ @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. $\endgroup$
    – Willie Wong Mod
    Commented Dec 3, 2013 at 11:30
  • 4
    $\begingroup$ 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. $\endgroup$
    – Willie Wong Mod
    Commented Dec 3, 2013 at 11:33
  • $\begingroup$ Ok, so I was mis/uninformed. Thanks, Willie. $\endgroup$ Commented Dec 3, 2013 at 12:20
  • $\begingroup$ This seems like a duplicate: meta.math.stackexchange.com/questions/8834/… $\endgroup$ Commented Dec 3, 2013 at 12:46
  • 1
    $\begingroup$ @JyrkiLahtonen I guess you meant this post (or some of the posts linked there): meta.math.stackexchange.com/questions/4130/… $\endgroup$ Commented Dec 3, 2013 at 12:54
  • 1
    $\begingroup$ but your "about-you"-feature doesn't work after reloading... $\endgroup$
    – draks ...
    Commented Dec 3, 2013 at 14:37
  • $\begingroup$ @Abramo See my answer. $\endgroup$
    – user93957
    Commented Jan 10, 2014 at 21:44
  • $\begingroup$ I have asked about solutions which could serve as a workaround if this is not implemented: Is there some way to include some default text quickly in a post? $\endgroup$ Commented Feb 14, 2020 at 16:17

2 Answers 2

9
$\begingroup$

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.

$\endgroup$
4
  • $\begingroup$ Why the Tower of Babel? Please expand, I'm curious ;-) $\endgroup$
    – Abramo
    Commented Dec 3, 2013 at 17:51
  • 3
    $\begingroup$ 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. $\endgroup$ Commented Dec 4, 2013 at 3:22
  • $\begingroup$ @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. $\endgroup$ Commented Dec 4, 2013 at 5:23
  • 1
    $\begingroup$ @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. $\endgroup$ Commented Dec 5, 2013 at 6:41
3
$\begingroup$

One own posts:

$\newcommand{\1}{\text{(1)}} \newcommand{\2}{\text{(2)}} \newcommand{\3}{\text{(3)}} \newcommand{\4}{\text{(4)}} \newcommand{\5}{\text{(5)}}$One option you can use is to write in a .txt file, all the commands you'll ever need, and save it in your Desktop. Whenever you log in into your Math.SE account, open it and if you want to answer, just copy/paste.

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.

$\endgroup$

You must log in to answer this question.

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