# log converted to lg?

I wrote the sentence below in a comment to Prove that $\log^25 + \log^27 > \log12$.:

I wonder whether $(\log_{10} x)^2 + (\log_{10} y)^2 > \log_{10}(x+y)$ always (or near $x=5$ and $y=7$).

Why is \log_{10} rendered as lg in this comment?

• Here it works fine: "I wonder whether $(\log_{10} x)^2 + (\log_{10} y)^2 > \log_{10}(x+y)$ always (or near $x=5$ and $y=7$)." – lhf Oct 14 '13 at 13:50
• I have edited the post and removed the macro causing the problems. – Martin Sleziak Oct 14 '13 at 14:02
• Why would anyone want to use base-10 logarithms in the first place? The very thought makes me shudder with horror.... – Gerry Myerson Oct 15 '13 at 11:34

Notice that the title of that question contains $\def\lg{\mathop{\rm lg}\nolimits}$. (Including a definition of a macro in the title is, in my opinion, very bad thing to do. It is also mentioned here.)

And also the body contains $\def\log{\mathop{\rm lg}\nolimits}$ which is the reason for the change in your comment.

It seems that this was added not by the OP, but by another user, who edited his post.

• I had no idea you could do this here...I am not sure how to use this knowledge for good though... – user1729 Oct 14 '13 at 14:34
• @user1729: in fact, this leads to exploits. That's why I really, really hope that we can have the begingroup extension enabled. $\renewcommand{\sin}{\text{Willie hacked this}}$ – Willie Wong Oct 14 '13 at 14:47
• Moreover there are both $\log$ and $\lg$ operators in MathJax, so the whole choice of macro'ing was weird to begin with. – Asaf Karagila Oct 14 '13 at 16:07
• @AsafKaragila It might have something to do with the fact that the OP used $\lg x$ to denote $\log_{10} x$ in his original post. But I am not sure. (The history of changes is rather long and confusing.) – Martin Sleziak Oct 14 '13 at 16:14

I really, really think we should have the begingroup extension enabled. Sometimes this can lead to exploits where mysterious replacements are slightly more difficult to track down. For example, here $\sin$ gives something quite different: $\sin$. And in this case this is just a tad harder to fix for the "average user".

• \cos $\newcommand{\cos}{\text{Ah, very clever!}}$ $\Rightarrow\cos$ – user1729 Oct 14 '13 at 14:53
• @user: yeah. Basically. But if you call \renewcommand in a comment it becomes harder for people to notice, and it does not show up in the edit logs, and so it potentially opens up an exploit where any user with 50+ reputation can basically silently deface any thread that uses math commands. – Willie Wong Oct 14 '13 at 14:56
• But it can be undone, yeah? $\newcommand{\sin}{\operatorname{sin}}$ \sin$\Rightarrow\sin$. – user1729 Oct 14 '13 at 14:59
• @user1729: yes, it can. For me the issue is less that average users cannot edit the post. For me the issue is that a malicious comment on any post can affect the output of all "subsequent posts" on the same page. If we enable the begingroup extension, and block each post (together with its comments) as one group, someone trying to do this kind of shenanigans will only be able to affect all the subsequent comments on the same post, significantly limiting the damage (yes, damage, did I mention that this can be done silently without bumping? Imagine someone inserting stray curse words...) – Willie Wong Oct 14 '13 at 15:06
• I just find it odd that this is allowed at all. But I suppose math.SE isn't the only user of mathjax so presumably someone will have a valid use for it. – user1729 Oct 14 '13 at 15:11