The polymath blog

How to use LaTeX in comments

WordPress has the ability to insert LaTeX math displays (e.g. \int_{-\infty}^\infty e^{-\pi x^2}\ dx = 1) into both posts and comments. The format for this is “$latex [Your LaTeX code]$”. See this announcement for details.

There used to be a number of quirks with the WordPress LaTeX plugin, but they have now largely been fixed. If you find any problems, please report them at this page.

WordPress also supports a certain amount of HTML. As a consequence, be careful with using the < and > signs in a comment, they may be misinterpreted as HTML tags! You can use &lt; and &gt; instead. (Inside of a LaTeX environment, you can use \lt and \gt.)

In case a comment really gets mangled up by formatting errors, contact one of the moderators of the polymath project, so that he or she can manually correct it.

The comments to this post will serve as the LaTeX help forum and LaTeX sandbox for this blog.  If you want to test out some LaTeX code in the comments below, you may wish to first describe the code without the “latex” symbol in order to show other readers what you are doing.  For instance: “Here is a LaTeX test: $a^n+b^n=c^n$ becomes a^n+b^n=c^n“. (Note that one can also mouse over a compiled LaTeX image to recover the original LaTeX source.)

33 Comments »

  1. [...] to have an environment where I could discuss Math. As documented by WordPress and used by the polymath blog Ah! I believe it now works. Alas, I should figure out something worthwhile to do with this [...]

    Pingback by math and latex test « Josh's Trial Blog — August 26, 2009 @ 4:11 pm | Reply

  2. Let’s see if this works, I’m going to try entering $x^2 + x – 1 = 0$

    x^2 + x - 1 = 0

    Comment by Asdquefty — November 20, 2009 @ 7:12 pm | Reply

  3. Awesome, so it works. Does this come with WordPress by default?

    Comment by Asdquefty — November 20, 2009 @ 7:13 pm | Reply

  4. Simply testing some latex: $e^{i\pi}-1=0$ e^{i\pi}-1=0

    Comment by Corey Brady — February 7, 2010 @ 1:19 am | Reply

  5. i\hbar\frac{\partial}{\partial t}\left|\Psi(t)\right>=H\left|\Psi(t)\right>
    \LaTeX

    Comment by jhgf — April 30, 2010 @ 11:46 am | Reply

  6. \int x\,dx

    Comment by meme — June 9, 2010 @ 4:27 pm | Reply

  7. \displaystyle \int x\,dx

    Comment by meme — June 9, 2010 @ 4:28 pm | Reply

  8. 2^2

    Comment by Anonymous — July 8, 2010 @ 4:55 pm | Reply

  9. for test,

    $
    \int f \prime (x) dx
    $

    Comment by Anonymous — July 10, 2010 @ 6:35 pm | Reply

  10. sorry for test
    $ \int f \prime (x) dx $

    Comment by Anonymous — July 10, 2010 @ 6:35 pm | Reply

  11. from helpless,
    $ a^n – ln(x) = 0$

    Comment by Anonymous — July 10, 2010 @ 6:36 pm | Reply

  12. helpless
    \int f \prime (x)dx

    Comment by Anonymous — July 10, 2010 @ 6:37 pm | Reply

  13. [\sum_1^n k^3]”.

    Comment by wb — August 14, 2010 @ 7:56 am | Reply

  14. Hi Terry,

    Another beautiful example of duality comes from optimization theory, in the form of the Fenchel dual to a function. The Fenchel dual has the following physical interpretation, which nicely illustrates your theme of “dual intrinsic/extrinsic” descriptions of an object:

    “A particle in a convex potential well F(z) can be pushed to any desired equilibrium point x by applying an appropriate force p. There is a bijective map relating x and p: the forward map is \nabla F, while the inverse is \nabla F^*, where F^* is the Fenchel dual to F.”

    To be more formal, given a nice convex function F : \mathbb{R} \rightarrow \mathbb{R}, we can interpret it as a potential function that a particle rolls around in.

    Let (a,b) denote the inner product. Then the Fenchel dual to F is defined as

    F^*(p) = \max_z (p,z) - F(z).

    Let x be the point where the max is achieved. The point x can be interpreted as the equilibrium position of a particle in potential F when this particle is subjected to a constant “applied force” p. The function

    F_p(z) = F(z) - (p,z)

    can be interpreted as an effective potential induced by the applied force, and the Fenchel dual is implicitly finding x, the equilibrium point where this potential is minimized. With a little calc and algebra we find

    \nabla F(x) = p
    F^*(p) = -F_p(x).

    (The negative is taken simply because the duality is clearer if $F^*$ is convex rather than concave.) A little calculus shows that

    (*) \nabla F^*(p) = x

    completing the justification of the physical interpretation at the top of this post.

    The derivation of this fact is intriguing in itself; by applying the multivariate chain rule to differentiate

    F^*(p) = g(x,p) = (x,p) - F(x)

    with respect to p, we find

    \nabla F^*(p) = (p - \nabla F(x)) + x = 0 + x = x.

    The fact p - \nabla F(x) = 0 is known from above, and arises from the fact that the particle is at equilibrium; thus the only change in the effective potential arises from the change in the “applied potential” with respect to p alone, holding x constant.

    Another interesting fact: a nonrigorous, geometric derivation of the Fenchel dual is possible by

    1. draw a contour plot of some nice F.
    2. draw a vector from 0 to a given equilibrium point x.
    3. draw the applied force p as a vector pointing from point x to x + p.

    Note that the two vectors drawn are now two sides of a parallelogram; the Fenchel dual is a function for which one can follow the exact same steps (1)-(3) again, but one uses the other two sides of the parallelogram and reverses the roles of p and x. After drawing this diagram, the involutive property of Fenchel duality becomes immediately obvious: taking the dual just means “flipping” the parallelogram over! :)

    Comment by Anonymous — August 18, 2010 @ 1:54 pm | Reply

  15. $\sum_{t=1}^{+\infty} \frac{1}{n^2}$

    Comment by Anonymous — August 7, 2011 @ 2:25 pm | Reply

  16. \sum_{t=1}^{+\infty}\frac{1}{n^2}

    Comment by Anonymous — August 7, 2011 @ 2:28 pm | Reply

  17. [...] learned I could add in at the Polymath blog but the WordPress announcement can be found here. GA_googleAddAttr("AdOpt", "1"); [...]

    Pingback by using LaTeX in Wordpress « Golbing — August 16, 2011 @ 4:54 pm | Reply

  18. $a^n+b^n=c^n$

    Comment by Anonymous — September 16, 2011 @ 2:06 pm | Reply

  19. a^n+b^n=c^n

    Comment by Anonymous — September 16, 2011 @ 2:07 pm | Reply

  20. $\frac{{ – b \pm \sqrt {{b^2} – 4ac} }}{{2a}}$

    Comment by Anonymous — September 30, 2011 @ 1:18 am | Reply

  21. \frac{{ - b \pm \sqrt {{b^2} - 4ac} }}{{2a}} > \sqrt {{b^2} - 4ac}

    Comment by Anonymous — September 30, 2011 @ 1:18 am | Reply

  22. \[\frac{{ - b \pm \sqrt {{b^2} - 4ac} }}{{2a}} > \sqrt {{b^2} - 4ac} \]

    Comment by Anonymous — September 30, 2011 @ 1:19 am | Reply

  23. Maxwell’s equations:

    $
    \vec{\nabla} \cdot \vec{\mathbf{E}} = \frac{1}{\epsilon_0}\,\rho \\
    \vec{\nabla} \times \vec{\mathbf{E}} = -\frac{\partial \vec{\mathbf{B}}{\partial t} \\
    \vec{\nabla} \cdot \vec{\mathbf{B}} = 0 \\
    \vec{\nabla} \times \vec{\mathbf{B}} = \mu_0\vec{mathbf{J}} + \epsilon_0\frac{\partial \vec{\mathbf{E}}{\partial t} \\
    $

    $latex[
    \vec{\nabla} \cdot \vec{\mathbf{E}} = \frac{1}{\epsilon_0}\,\rho \\
    \vec{\nabla} \times \vec{\mathbf{E}} = -\frac{\partial \vec{\mathbf{B}}{\partial t} \\
    \vec{\nabla} \cdot \vec{\mathbf{B}} = 0 \\
    \vec{\nabla} \times \vec{\mathbf{B}} = \mu_0\vec{mathbf{J}} + \epsilon_0\frac{\partial \vec{\mathbf{E}}{\partial t} \\
    ]$

    Comment by Mike — September 30, 2011 @ 8:19 pm | Reply

  24. OK, I guess that newlines are to be added with HTML tags (<br>)

    Maxwell’s equations:

    $latex[\vec{\nabla} \cdot \vec{\mathbf{E}} = \frac{1}{\epsilon_0}\,\rho ]$ <br>
    $latex[\vec{\nabla} \times \vec{\mathbf{E}} = -\frac{\partial \vec{\mathbf{B}}{\partial t} ]$ <br>
    $latex[\vec{\nabla} \cdot \vec{\mathbf{B}} = 0 ]$ <br>
    $latex[\vec{\nabla} \times \vec{\mathbf{B}} = \mu_0\vec{mathbf{J}} + \epsilon_0\frac{\partial \vec{\mathbf{E}}{\partial t} ]$ <br>

    $latex[\vec{\nabla} \cdot \vec{\mathbf{E}} = \frac{1}{\epsilon_0}\,\rho ]$
    $latex[\vec{\nabla} \times \vec{\mathbf{E}} = -\frac{\partial \vec{\mathbf{B}}{\partial t} ]$
    $latex[\vec{\nabla} \cdot \vec{\mathbf{B}} = 0 ]$
    $latex[\vec{\nabla} \times \vec{\mathbf{B}} = \mu_0\vec{mathbf{J}} + \epsilon_0\frac{\partial \vec{\mathbf{E}}{\partial t} ]$

    Comment by Mike — September 30, 2011 @ 8:25 pm | Reply

  25. Another try

    Maxwell’s equations:

    [\vec{\nabla} \cdot \vec{\mathbf{E}} = \frac{1}{\epsilon_0}\,\rho ] <br>
    [\vec{\nabla} \times \vec{\mathbf{E}} = -\frac{\partial \vec{\mathbf{B}}{\partial t} ] <br>
    [\vec{\nabla} \cdot \vec{\mathbf{B}} = 0 ] <br>
    [\vec{\nabla} \times \vec{\mathbf{B}} = \mu_0\vec{mathbf{J}} + \epsilon_0\frac{\partial \vec{\mathbf{E}}{\partial t} ] <br>

    \vec{\nabla} \cdot \vec{\mathbf{E}} = \frac{1}{\epsilon_0}\,\rho
    \vec{\nabla} \times \vec{\mathbf{E}} = -\frac{\partial \vec{\mathbf{B}}{\partial t}
    \vec{\nabla} \cdot \vec{\mathbf{B}} = 0
    \vec{\nabla} \times \vec{\mathbf{B}} = \mu_0\vec{mathbf{J}} + \epsilon_0\frac{\partial \vec{\mathbf{E}}{\partial t}

    Comment by Mike — September 30, 2011 @ 8:32 pm | Reply

  26. Me again. Could not handle the 2nd and 4th equations. Comparing those with the equations that worked, the only differences are with \times and \partial. Let’s test:

    $\vec{A} \times \vec{B} = \vec{C}$ and $\frac{\partial \phi}{\partial t} = \nabla \cdot \vec{A}$

    \vec{A} \times \vec{B} = \vec{C} and $\frac{\partial \phi}{\partial t} = \nabla \cdot \vec{A}$

    Comment by Mike — September 30, 2011 @ 8:40 pm | Reply

  27. oops…

    $\frac{\partial \phi}{\partial t} = \nabla \cdot \vec{A}$

    \frac{\partial \phi}{\partial t} = \nabla \cdot \vec{A}

    Comment by Mike — September 30, 2011 @ 8:43 pm | Reply

  28. $f(x)^2$

    Comment by Anonymous — October 17, 2011 @ 2:13 pm | Reply

  29. f(x)^2

    Comment by Anonymous — October 17, 2011 @ 2:14 pm | Reply

  30. the line \mathbf{R} v

    Comment by Anonymous — October 17, 2011 @ 2:15 pm | Reply

  31. the line \mathbb{R} v

    Comment by Anonymous — October 17, 2011 @ 2:17 pm | Reply

  32. \mathbb{R} v

    Comment by Anonymous — October 17, 2011 @ 2:18 pm | Reply

  33. The task is to find a vector \mathbf{w} which is not parallel to v, since then \mathbf{w} \times \mathbf{v} is orthogonal to \mathbf{v}.

    Clearly, any parameter-family which is not contained in the line \mathbb{R} \mathbf{v} will contain such a vector (this is just rephrasing the condition of being not parallel). Therefore, if we manage to find a one-parameter family which is not contained in any line through the origin then this construction will work for arbitrary vectors \mathbf{v}.

    The simplest such construction is to simply fix two of the three components of your vector with at least one of them being non-zero (i.e., to choose as your one-parameter family a one-dimensional affine space which does not contain the origin), e.g.,

    \mathbf{w} \in \begin{pmatrix}0\\w\\1\end{pmatrix}.

    Then given a specific vector \mathbf{v} we only need to choose w in such a way that the last two components of \mathbf{w} are not parallel to those of \mathbf{v}. Suppose that we had failed to do so and the two 2-vectors are in fact parallel. Then

    \mathrm{sign}(yz) = \mathrm{sign}(w).

    It follows that we can simply choose

    w = -\mathrm{sign}(yz)

    to ensure that the two vectors \mathbf{v} and \mathbf{w} are non-parallel (one quickly verifies that this also works for yz = 0 as long as one defines \mathrm{sign}(0) = 1).

    Comment by Anonymous — October 17, 2011 @ 2:41 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Clone this site at WordPress.com

Follow

Get every new post delivered to your Inbox.

Join 43 other followers