5
$\begingroup$

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?

enter image description here

$\endgroup$
  • $\begingroup$ 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$)." $\endgroup$ – lhf Oct 14 '13 at 13:50
  • $\begingroup$ I have edited the post and removed the macro causing the problems. $\endgroup$ – Martin Sleziak Oct 14 '13 at 14:02
  • 1
    $\begingroup$ Why would anyone want to use base-10 logarithms in the first place? The very thought makes me shudder with horror.... $\endgroup$ – Gerry Myerson Oct 15 '13 at 11:34
8
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ I had no idea you could do this here...I am not sure how to use this knowledge for good though... $\endgroup$ – user1729 Oct 14 '13 at 14:34
  • 1
    $\begingroup$ @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}}$ $\endgroup$ – Willie Wong Oct 14 '13 at 14:47
  • $\begingroup$ Moreover there are both $\log$ and $\lg$ operators in MathJax, so the whole choice of macro'ing was weird to begin with. $\endgroup$ – Asaf Karagila Oct 14 '13 at 16:07
  • $\begingroup$ @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.) $\endgroup$ – Martin Sleziak Oct 14 '13 at 16:14
8
$\begingroup$

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

$\endgroup$
  • $\begingroup$ \cos $\newcommand{\cos}{\text{Ah, very clever!}}$ $\Rightarrow\cos$ $\endgroup$ – user1729 Oct 14 '13 at 14:53
  • $\begingroup$ @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. $\endgroup$ – Willie Wong Oct 14 '13 at 14:56
  • $\begingroup$ But it can be undone, yeah? $\newcommand{\sin}{\operatorname{sin}}$ \sin$\Rightarrow\sin$. $\endgroup$ – user1729 Oct 14 '13 at 14:59
  • $\begingroup$ @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...) $\endgroup$ – Willie Wong Oct 14 '13 at 15:06
  • 1
    $\begingroup$ 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. $\endgroup$ – user1729 Oct 14 '13 at 15:11

You must log in to answer this question.

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