tea.mathoverflow.net - Discussion Feed (Russell's paradoxon for MathJax) 2018-11-04T23:18:37-08:00 http://mathoverflow.tqft.net/ Lussumo Vanilla & Feed Publisher Andrew Stacey comments on "Russell's paradoxon for MathJax" (12403) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12403#Comment_12403 2011-01-07T03:12:52-08:00 2018-11-04T23:18:37-08:00 Andrew Stacey http://mathoverflow.tqft.net/account/4/ True, I was just pedantically pointing out minor details. I suspect that the chance of this being used as a weapon against MO is very slight. What worries me more is the probability of someone ... True, I was just pedantically pointing out minor details. I suspect that the chance of this being used as a weapon against MO is very slight.

What worries me more is the probability of someone copying over all their basic macros and making the site slow to an absolute crawl for the rest of us.

Another thing also just occurred to me about these definitions. Heading on over to faketestsite, I see that I'm not the only one to think of this: http://faketestsite.stackexchange.com/questions/151/let-me-test-mathjax. To save people the bother of clicking on the link, it appears that \newcommands are global. That means that the \newcommands on one part of the page will affect what happens in another. Since the order matters, and the order can change (it can even be different for different users as some will order the entries by date, some by reputation), this is potentially quite a serious issue.

]]>
Anton Geraschenko comments on "Russell's paradoxon for MathJax" (12402) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12402#Comment_12402 2011-01-07T02:31:42-08:00 2018-11-04T23:18:37-08:00 Anton Geraschenko http://mathoverflow.tqft.net/account/2/ Yes, it would, but you'd have to earn enough rep to comment first. Yes, it would, but you'd have to earn enough rep to comment first.

]]>
Andrew Stacey comments on "Russell's paradoxon for MathJax" (12401) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12401#Comment_12401 2011-01-07T02:05:10-08:00 2018-11-04T23:18:37-08:00 Andrew Stacey http://mathoverflow.tqft.net/account/4/ What if you put it in a comment on the original question? Wouldn't that appear above any answer? What if you put it in a comment on the original question? Wouldn't that appear above any answer?

]]>
Anton Geraschenko comments on "Russell's paradoxon for MathJax" (12400) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12400#Comment_12400 2011-01-07T01:22:33-08:00 2018-11-04T23:18:37-08:00 Anton Geraschenko http://mathoverflow.tqft.net/account/2/ @Mariano: \renewcommand is implemented as an exact synonym of \newcommand, and \def is also basically a synonym, but with slightly different syntax. I don't think it's worth worrying about this too ... @Mariano: \renewcommand is implemented as an exact synonym of \newcommand, and \def is also basically a synonym, but with slightly different syntax. I don't think it's worth worrying about this too much until it occurs in the wild, at which point we'll probably be able to handle it by simply getting angry with the perpetrator. You can only cause trouble with \renewcommand if you can get your posts to appear above some worthwhile post. This is not something a troll can easily do, and certainly not something that can be done by a script.

]]>
Mariano comments on "Russell's paradoxon for MathJax" (12399) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12399#Comment_12399 2011-01-06T23:48:59-08:00 2018-11-04T23:18:37-08:00 Mariano http://mathoverflow.tqft.net/account/61/ Allowing \renewcommand, for example, is just asking for trouble. See http://faketestsite.stackexchange.com/questions/151/let-me-test-mathjax I wonder if there is a sensible subset that could be ... Allowing \renewcommand, for example, is just asking for trouble. See http://faketestsite.stackexchange.com/questions/151/let-me-test-mathjax I wonder if there is a sensible subset that could be allowed in public fora...

]]>
Anton Geraschenko comments on "Russell's paradoxon for MathJax" (12397) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12397#Comment_12397 2011-01-06T21:44:55-08:00 2018-11-04T23:18:37-08:00 Anton Geraschenko http://mathoverflow.tqft.net/account/2/ The fix is now running on MO. You're welcome to go type $\newcommand{\x}{\x}\x$ in and see what happens (though you should clear your cache first, and it would really be better for you to run such ... The fix is now running on MO. You're welcome to go type $\newcommand{\x}{\x}\x$ in and see what happens (though you should clear your cache first, and it would really be better for you to run such experiments at faketestsite). I've brought MAXMACROS down from 10000 to a more conservative 50. If this ever turns out to be too small, we can make it bigger.

One thing that wasn't clear to me before was the meaning of MAXMACROS. It's the cap on the maximum number of macros that will be expanded in any given formula. So you might exceed the cap of 50 as follows:

$\newcommand{\Z}{\mathbb Z}
\newcommand{\Zp}{\Z/p\Z}$

Consider the 11-tuple of groups $(\Zp,\Zp,\Zp,\Zp,\Zp,\Zp,\Zp,\Zp,\Zp,\Zp,\Zp)$

Each \Zp results in five macro expansions:
one to convert \Zp in to \Z/p\Z,
two more to convert \Z/p\Z into \mathbb Z/p\mathbb Z, and
two more to conver \mathbb Z/p\mathbb Z into {\bbFont Z}/p{\bbFont Z}

The single formula with 11 instances of \Zp results in 55 macro expansions, so that formula breaks.

]]>
Anton Geraschenko comments on "Russell's paradoxon for MathJax" (12377) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12377#Comment_12377 2011-01-04T15:11:52-08:00 2018-11-04T23:18:37-08:00 Anton Geraschenko http://mathoverflow.tqft.net/account/2/ Yes, they're tunable. I agree that 20 is probably a sufficiently big number for MAXMACROS. Yes, they're tunable. I agree that 20 is probably a sufficiently big number for MAXMACROS.

]]>
Mariano comments on "Russell's paradoxon for MathJax" (12376) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12376#Comment_12376 2011-01-04T14:50:14-08:00 2018-11-04T23:18:37-08:00 Mariano http://mathoverflow.tqft.net/account/61/ Are those tunable by sites? I am pretty sure that anything with 20 macro substitutions in an equation in MO is evil... Are those tunable by sites? I am pretty sure that anything with 20 macro substitutions in an equation in MO is evil...

]]>
Anton Geraschenko comments on "Russell's paradoxon for MathJax" (12375) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12375#Comment_12375 2011-01-04T13:19:21-08:00 2018-11-04T23:18:37-08:00 Anton Geraschenko http://mathoverflow.tqft.net/account/2/ Davide has implemented a limit on the number of macro substitutions and a limit on the size of the string after substitution: MAXMACROS: 10000, // maximum number of macro substitutions per ... Davide has implemented a limit on the number of macro substitutions and a limit on the size of the string after substitution:

MAXMACROS: 10000,    // maximum number of macro substitutions per equation
MAXBUFFER: 5*1024    // maximum size of TeX string to process

Faketestsite is currently running the branch with the fix, but MO is not. I invite you all to go experiment on Faketestsite to see if you can cause trouble of find unexpected behavior.

I've noted at the issue tracker one way to still cause a fair amount of trouble with \newcommand.

]]>
Mariano comments on "Russell's paradoxon for MathJax" (12267) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12267#Comment_12267 2010-12-28T09:25:54-08:00 2018-11-04T23:18:37-08:00 Mariano http://mathoverflow.tqft.net/account/61/ A limit on stack length during expansion should not be that hard to implement, and would not impair essentially no sensible latex expression on MO. (If we could limit the scope of definitions to an ... A limit on stack length during expansion should not be that hard to implement, and would not impair essentially no sensible latex expression on MO.

(If we could limit the scope of definitions to an answer, for example, we could all start pasting our favorite latex prologue when writing an answer... :) )

]]>
Anton Geraschenko comments on "Russell's paradoxon for MathJax" (12266) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12266#Comment_12266 2010-12-28T09:22:31-08:00 2018-11-04T23:18:37-08:00 Anton Geraschenko http://mathoverflow.tqft.net/account/2/ I've created an issue on the MathJax issue tracker. I'm not sure there's a good solution to this problem aside from simply disabling \newcommand and \def. This problem will also crash LaTeX (at least ... I've created an issue on the MathJax issue tracker. I'm not sure there's a good solution to this problem aside from simply disabling \newcommand and \def. This problem will also crash LaTeX (at least the implementation I have installed right now).

What is the scope of a definition? The whole html page?

I think it's everything on the page below where the definition is made.

]]>
Mariano comments on "Russell's paradoxon for MathJax" (12261) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12261#Comment_12261 2010-12-28T05:51:46-08:00 2018-11-04T23:18:37-08:00 Mariano http://mathoverflow.tqft.net/account/61/ What is the scope of a definition? The whole html page? What is the scope of a definition? The whole html page?

]]>
darijgrinberg comments on "Russell's paradoxon for MathJax" (12260) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12260#Comment_12260 2010-12-28T05:33:51-08:00 2018-11-04T23:18:37-08:00 darijgrinberg http://mathoverflow.tqft.net/account/478/ I *have* tried it and it worked. Have deleted the "question", of course. There is also \def .MathJax probably has never been developed with a forum in view... MathJax probably has never been developed with a forum in view...]]> Kevin Buzzard comments on "Russell's paradoxon for MathJax" (12259) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12259#Comment_12259 2010-12-28T05:19:53-08:00 2018-11-04T23:18:37-08:00 Kevin Buzzard http://mathoverflow.tqft.net/account/65/ Although I'm no fan of security through obscurity, the moment Anton told me on some other meta thread that I could use \newcommand in answers (to save me from having to type \mathbf a lot) I realised ... darijgrinberg comments on "Russell's paradoxon for MathJax" (12258) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12258#Comment_12258 2010-12-28T05:00:55-08:00 2018-11-04T23:18:37-08:00 darijgrinberg http://mathoverflow.tqft.net/account/478/ The fun thing: \newcommand{\bla}{\bla} \bla The bad thing: It works.(A troll friend of mine used this to kill a chat channel which was running MathJax.) The bad thing: It works.
(A troll friend of mine used this to kill a chat channel which was running MathJax.)]]>