Basically same as Formatting Sandbox in meta.SO, but since this and Statistical Analysis are the only 2 sites (I know) supporting TeX formatting, I believe we also need one here for testing it.

share
1  
Theoretical computer science also supports $\mathrm{\TeX/\LaTeX}$ formatting. –  JeffE Jun 1 '12 at 7:29
 
@JeffE: You can use $\TeX$ and $\LaTeX$ (\Tex and \LaTeX) for the text. –  Asaf Karagila Jun 2 '12 at 21:09
 
@JeffE: In 2010 only 'stats' and 'math' support TeX formatting. Of course now there is also 'cstheory', 'cs', 'chemistry', 'quant', etc. –  KennyTM Jun 3 '12 at 6:25

22 Answers

up vote 13 down vote accepted

A suggestion: if you want to see you TeX previewed, pretend to type your question/answer. Then wait for 4 seconds. We have on the fly previewing for LaTeX here. This way we don't keep popping this question to the top of meta.

share
 
May be this (and the main sandbox) should be made special unbumpable question? –  Vi0 Aug 24 '12 at 15:06

$\hskip -3em \color{red}{\Rule{5em}{1em}{1em}}$. Testing of negative skips to overlap the buttons on the left.

$\rlap{\smash{\lower 3em{\color{red}{\Rule{5em}{2em}{0em}}}}}$Testing overlapping on the bottom. OK, both seem to be problems.

share
 
a comment with overlaps $\rlap{\color{red}{\Rule{10em}{1em}{0.5em}}}$ –  Davide Cervone Jun 14 '12 at 21:56
 
The extension linked to this answer can be used to improve the situation. –  Davide Cervone Jun 14 '12 at 22:00

This is a 1e1ea2ce-0342-4835-a7cc-ee70fbdfe27d
bug

share

Testing spoiler:

Without newlines:

$$\lim_{x \rightarrow \infty} \dfrac{\ln(x^2+4)}{\ln(x+\sqrt{1+x^2})} = \lim_{x \rightarrow \infty} \dfrac{\ln(x^2) + \ln(1+4/x^2)}{\ln(x) + \ln(1+\sqrt{1+1/x^2})}$$ $$ = \lim_{x \rightarrow \infty} \dfrac{\ln(x^2)}{\ln(x)} \dfrac{\left(1+\dfrac{\ln(1+4/x^2)}{\ln(x^2)} \right)}{\left(1 + \dfrac{\ln(1+\sqrt{1+1/x^2})}{\ln(x)} \right)}$$ $$ = \lim_{x \rightarrow \infty} 2 \dfrac{\ln(x)}{\ln(x)} \lim_{x \rightarrow \infty} \dfrac{\left(1+\dfrac{\ln(1+4/x^2)}{\ln(x^2)} \right)}{\left(1 + \dfrac{\ln(1+\sqrt{1+1/x^2})}{\ln(x)} \right)}$$ $$ = 2 \lim_{x \rightarrow \infty} \dfrac{\left(1+\dfrac{\ln(1+4/x^2)}{\ln(x^2)} \right)}{\left(1 + \dfrac{\ln(1+\sqrt{1+1/x^2})}{\ln(x)} \right)} =2 $$

With newlines:

! $$\lim_{x \rightarrow \infty} \dfrac{\ln(x^2+4)}{\ln(x+\sqrt{1+x^2})} = \lim_{x \rightarrow \infty} \dfrac{\ln(x^2) + \ln(1+4/x^2)}{\ln(x) + \ln(1+\sqrt{1+1/x^2})}\\ = \lim_{x \rightarrow \infty} \dfrac{\ln(x^2)}{\ln(x)} \dfrac{\left(1+\dfrac{\ln(1+4/x^2)}{\ln(x^2)} \right)}{\left(1 + \dfrac{\ln(1+\sqrt{1+1/x^2})}{\ln(x)} \right)}\\ = \lim_{x \rightarrow \infty} 2 \dfrac{\ln(x)}{\ln(x)} \lim_{x \rightarrow \infty} \dfrac{\left(1+\dfrac{\ln(1+4/x^2)}{\ln(x^2)} \right)}{\left(1 + \dfrac{\ln(1+\sqrt{1+1/x^2})}{\ln(x)} \right)}\\ = 2 \lim_{x \rightarrow \infty} \dfrac{\left(1+\dfrac{\ln(1+4/x^2)}{\ln(x^2)} \right)}{\left(1 + \dfrac{\ln(1+\sqrt{1+1/x^2})}{\ln(x)} \right)} =2 $$

share
 
I was trying this here because of the problems the poster had with this answer. –  Martin Sleziak Jun 1 '12 at 9:51

How does newcommand and renewcommand work?

$$\newcommand{\sin}{FOO} \sin x$$

$$\sin y$$

$$\renewcommand{\nonexistent}{QUX} \nonexistent$$

share

And now what does it look like to another user who doesn't suspect that the command has been redefined?

$$\sin x$$

Very interesting.

share
 
Oh wow - that is interesting. How does one clear newcommands? –  mixedmath Jun 1 '12 at 7:07
 
@mixedmath: See meta.math.stackexchange.com/questions/4130/… –  Nate Eldredge Jun 1 '12 at 13:17

you may also go to MathURL and write your formula there; just remember the dollar signs before putting it here.

share

Let me try if there is a difference between single dollar signs $\sum_{i = 0}^n k^i$ and double dollar signs $$\sum_{i = 0}^n k^i$$

share
 
You can always use this: $\sum\limits_{i = 0}^n k^i$ –  Quixotic Sep 19 '11 at 20:12

Can we do pictures?

\begin{picture}(2,2) \put(0,0){\line(1,0){1}} \put(0,0){\line(0,1){1}} \end{picture}

\begin{math} 2 \end{math}

aw dang..

share
1  
See here –  t.b. Sep 18 '11 at 22:10
 
@TheoBuehler: Aw, dang. Thanks for the link. –  Mehrdad Sep 18 '11 at 22:28

$ (\not \in \notin) 1 \times 2 \in S \implies S \notin S$

$$ \lim_ {k\to\infty}^{\diamond \circ \square \sum \int} \sum_{j=1}^k {j^{2^j_k}_3}_{x_i} \int_2^3x\ dx $$

$C3^\#_\flat\natural\colon$ musical stuff!

$$¡^IGNORE\ \ M_e!$$

$$¡^IGNORE\ \ M_e!$$

$$!`^IGNORE\ \ M_e!$$

$$\unicode{xA1}^IGNORE\ \ M_e!$$

share
 
Hm... odd... ¡^IGNORE\ \ M_e! works in the preview. –  minitech Dec 3 '11 at 6:31
 
Okay, only one of three variants work... –  J. M. Dec 3 '11 at 6:53
 
Make that two.${}$ –  J. M. Dec 6 '11 at 14:23
 
Test: $\mathbb{R}^{n+1}$ –  Dan Moore Jul 12 '12 at 15:27

Can we enter nested math inside \text now, and have it saved? $$ \{\,p\mid\text{$p$ and $p+2$ are prime}\,\} $$ Edit: it seems we can.

share
 
But will Markdown respect it? $\text{This should not become a hyperlink: $test$}$ –  celtschk Jul 14 '12 at 10:28
 
The changes don't affect comments, only questions and answers. Comments seem to be processed quite differently. –  Davide Cervone Jul 14 '12 at 13:57
 
That's interesting. So $\text{does this $x^2$ also not work properly?}$ Well, it seems to work. –  celtschk Jul 14 '12 at 16:06
1  
MathJax properly handles nested dollars, but they are not protected from MarkDown when used in comments. They are when used in questions and answers. –  Davide Cervone Jul 14 '12 at 18:30

The preview recognizes $\rm\LaTeX$ environments and protects the contents from Markdown. Does that work once saved?

\begin{equation} x _1 = y_ 1 \end{equation}

Edit: It seems that it does!

share

Testing striking out:

math: text $a^2-b^2=(a-b)(a+b)$ text

tag: text text

url: text math.SE text

share
 
What about comments? math: <s> text $a^2-b^2=(a-b)(a+b)$ text </s> tag: <s> text tex text </s> url: <s> text math.SE text </s> –  Martin Sleziak Jun 20 '12 at 12:53
 
Any concave function $f\colon0,\infty)\to\mathbb R$ such that $f(0)=0$ is [subadditive. –  Martin Sleziak Jun 28 '12 at 14:10
 
Any concave function $f\colon[0,\infty]\to\mathbb R$ such that $f(0)=0$ is subadditive. –  Martin Sleziak Jun 28 '12 at 14:12
 
What about \left[\right)? Any concave function $f\colon\left0,\infty\right)\to\mathbb R$ such that $f(0)=0$ is [subadditive. –  Martin Sleziak Jun 28 '12 at 14:33
 
$\left[0,\infty\right)$ and [link](http://math.stackexchange.com) produces $\left0,\infty\right)$ and [link. –  Martin Sleziak Jun 28 '12 at 14:43
 
Do you mean that in one dimension the definition of a manifold with boundary is: "A topological space such that each point has a neighbourhood homeomorphic to an open subset of $(-\infty, 0]$ or $[0, \infty)"? Or do you mean you can define a one dimensional manifold with boundary as a topological space such that each point has a neighbourhood homeomorphic to an open subset of $(-\infty, 0]$, or equivalently, $[0, \infty)$? Surely you mean the latter as $\phi : [0, \infty) \to (-\infty, 0]$, $\phi(x) = -x$ is a homeomorphism. –  Martin Sleziak Oct 12 '12 at 13:36
 
What happens if I put here link to a cooment? –  Martin Sleziak Apr 5 at 17:19

Preview seems to "leak" macro definitions, even to before the macro is defined. Let's see what happens with saving.

This macro should be undefined here (and thus show the name in red): $\NobodyWouldCreateSuchALongMacroName$

So should this: $\AnotherRidiculouslyLongName$

Now start a local group. $\require{begingroup}\begingroup$

Define the first macro to $1$ $\def\NobodyWouldCreateSuchALongMacroName{1}$ and use it: $\NobodyWouldCreateSuchALongMacroName$ — This should display as $1$.

Now define the second one, this time using gdef, to the value $2$. $\gdef\AnotherRidiculouslyLongName{2}$ Again, use it: $\AnotherRidiculouslyLongName$ — This should show up as $2$.

Now end the group. $\endgroup$

Now the first macro should be undefined again: $\NobodyWouldCreateSuchALongMacroName$

The second macro, however, should still be defined (or I've misunderstood something): $\AnotherRidiculouslyLongName$

share
 
OK, so as soon as it's posted, obviously everything works as it should. –  celtschk Jul 12 '12 at 16:41
 
Tangentially related: The scope of \newcommand is the entire page. (But it is about \newcommand, not \def.) –  Martin Sleziak Jul 14 '12 at 6:46

$\varnothing$ -- porton says this does not work.

share
 
testing.......... –  Douglas S. Stones Jul 24 at 14:43
 
@DouglasS.Stones: hello –  Douglas S. Stones Jul 24 at 14:43
 
@DouglasS.Stones testing... –  Douglas S. Stones Jul 24 at 14:45

$\rm{\bf Hint}\:\ (p\!-\!1)^2\! \mid p^q\!-1 \!\iff\! p\!-\!1\ \bigg|\ \dfrac{p^q\!-1}{p\!-\!1} = p^{q-1}\! +\cdots\!+p\! +\! 1$ $\rm\equiv q\ (mod\ p\!-\!1)$

share

The following gives [Math Processing Error] on iOS Safari, but OK on iOS Chrome and on desktop browsers.

$ \newcommand{\ket}[1]{\left| #1 \right\rangle} \newcommand{\Psih}{\hat{\Psi}} \newcommand{\Psihd}{\hat{\Psi}^\dagger} \newcommand{\bx}{\mathbf{x}} \newcommand{\Hh}{\hat{H}} \newcommand{\Hsp}{\Hh_{\mathrm{sp}}} \newcommand{\cn}{\chi(\bx_1,\dots\bx_n)} $

$\frac12 \sum_{i,j} V(\bx_i-\bx_j)\cn$

$$\ket{\chi_n} = \int d\bx_1 \dots d\bx_n \cn\prod_k \Psihd(\bx_k)\ket{0}$$

$$\begin{align} \hat{V}\ket{\chi_n} &= \frac12 \int d\bx d \bx'd\bx_1 \dots d\bx_n V(\bx-\bx')\cn\Psihd(\bx) \Psihd(\bx') \Psih(\bx')\Psih(\bx)\prod_k \Psihd(\bx_k)\ket{0} \\ &= \frac12 \int d\bx d \bx'd\bx_1 \dots d\bx_n V(\bx-\bx') \sum_{i,j:i\ne j}\delta(\bx-\bx_i) \delta(\bx'-\bx_j) \cn\prod_k \Psihd(\bx_k)\ket{0}\\ &= \frac12 \int d\bx_1 \dots d\bx_n \sum_{i,j:i\ne j} V(\bx_i-\bx_j) \cn\prod_k \Psihd(\bx_k)\ket{0} \end{align} $$ which is the interaction we expect.

share

This was done in an attempt (so far unsuccessful) to replicate the problem mentioned in line breaks in incorrect places

However, when I was trying this, I stumbled upon some strange behavior of MathJax, which I can't explain. (And I am unable to spot a mistake in the TeX code below.)


Two separate formulas - they work fine:

$\|e^A\|=\|I+A+A^2/2!+A^3/3!+\ldots\|=\sup_{|x|=1}\|(I+A+A^2/2!+A^3/3!+\ldots)x\|=$ $\sup_{|x|}\|Ix+Ax+(A^2x)/2!+(A^3x)/3!+\ldots\|\leq \sup_{|x|}\|Ix\|+\sup_{|x|=1}\|Ax\|+\frac{\sup_{|x|}\|A^2x\|}{2!}+\frac{\sup_{|x|}\|A^3x\|}{3!}+\ldots$

Now without any changes they are put together and everything is broken: $\|e^A\|=\|I+A+A^2/2!+A^3/3!+\ldots\|=\sup_{|x|=1}\|(I+A+A^2/2!+A^3/3!+\ldots)x\|= \sup_{|x|}\|Ix+Ax+(A^2x)/2!+(A^3x)/3!+\ldots\|\leq \sup_{|x|}\|Ix\|+\sup_{|x|=1}\|Ax\|+\frac{\sup_{|x|}\|A^2x\|}{2!}+\frac{\sup_{|x|}\|A^3x\|}{3!}+\ldots$

This first part of the fromula still works ok: $\|e^A\|=\|I+A+A^2/2!+A^3/3!+\ldots\|=\sup_{|x|=1}\|(I+A+A^2/2!+A^3/3!+\ldots)x\|= \sup_{|x|}\|Ix+Ax+(A^2x)/2!+(A^3x)/3!+\ldots\|\leq$

When I add the next bit, it becomes weird: $\|e^A\|=\|I+A+A^2/2!+A^3/3!+\ldots\|=\sup_{|x|=1}\|(I+A+A^2/2!+A^3/3!+\ldots)x\|= \sup_{|x|}\|Ix+Ax+(A^2x)/2!+(A^3x)/3!+\ldots\|\leq \sup_{|x|}\|Ix\|+\sup_{|x|=1}\|Ax\|+$


$\|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| \|A\| \|B\| \|C\| $

$\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|+\|A\|+\|B\|+\|C\|$


I'm trying to prove this inequality:

$\|e^A\|\le e^{\|A\|}$, where $A$ is a matrix and $\|A\|:=\sup_{|x|=1} |Ax|$.

My attempt of solution:

Since $e^A:=I+A+A^2/2!+A^3/3!+\ldots$

we have

$\|e^A\|=\|I+A+A^2/2!+A^3/3!+\ldots\|=\sup_{|x|=1}\|(I+A+A^2/2!+A^3/3!+\ldots)x\|=$ $\sup_{|x|}\|Ix+Ax+(A^2x)/2!+(A^3x)/3!+\ldots\|\leq \sup_{|x|}\|Ix\|+\sup_{|x|=1}\|Ax\|+\frac{\sup_{|x|}\|A^2x\|}{2!}+\frac{\sup_{|x|}\|A^3x\|}{3!}+\ldots$

Am I right so far? I couldn't go further

I need help!

Thanks a lot.

share

Testing matrix environments - are multiple backslashes needed?

The following (with each line ending only with two backslashes) renders ok for me: $$\begin{pmatrix} 1/2 & 1/2 & 1/2 & 1/2 & 1/2 & 1/2 & 1/2 & 0 \\ 1/2 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1/2 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1/2 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1/2 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1/2 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1/2 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1/2 & 1 \end{pmatrix}$$

share
 
I've tried this because of this question. –  Martin Sleziak Jul 8 at 8:13

$$[Donkeys][1]$$

share

$\hskip 36em {\require{cancel}\require{cancelto} _\text{psst! over here!}\cancelto{\hspace{1pt}}{\hspace{20pt}}}$

share

This spot is free xxxxxxxxxxxx

share

You must log in to answer this question.

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