Showing posts with label equation. Show all posts
Showing posts with label equation. Show all posts

Sunday, October 29, 2017

Reference to equations

In my opinion, for equations the best is to use \eqref{}.

Friday, June 17, 2016

Tuesday, November 24, 2015

How to write nice equations in LaTeX beamer

The equations in the default beamer presentation slides are rather unattractive.
In my opinion this is merely because of the fonts used for equations.

You can change it by changing the font-theme for equations.

 \usefonttheme[onlymath]{serif}

 This will result equations like in the articles in your beamer presentation.

For further hints check out this post.

Tuesday, April 14, 2015

Horizontal distances in equations

I was wondering for a while how to set the horizontal distances inside the equations.
Well, here is a fairly goo description. See the original source here.


Monday, December 15, 2014

Maple output to LaTeX

Maple can produce latex source using the ... wait for it ... latex( . ) command :-D




latex(expr, options)

latex(expr, filename, options)

See here for more details.
Works on Windows and Linux as well, no experience with OSX (yet).

Wednesday, March 5, 2014

Numbering equations like 1a and 1b

use align end subequations instead of eqnarray or equation

\begin{subequations}
    \begin{align}
        p(w) &\sim \mathcal{N}(0, Q)\\
        p(v) &\sim \mathcal{N}(0, R)
    \end{align}
\end{subequations}
 See here.

Monday, December 16, 2013

How to number several equations with one number

\begin{eqnarray} 
 \begin{array}{rl}
    &x = foo \\
    & y = bar
 \end{array}
\end{eqnarray}
 I sometimes get that I should not use eqnarray that extensive, but it works for me.
Another solutions with equation and aligned environments here.

Monday, March 18, 2013

Fractions in latex

The easiest way to write fractions in an equation is to use the \frac command as
\frac{a}{b}

Tuesday, March 5, 2013

Write transpose of a matrix

Transpose of a matrix (switching rows with columns), I like to write with "T" in exponent, where the exponent is not italic, like 
$A^{\rm T}$

Monday, August 6, 2012

Avoid eqnarray

Some say, you should avoid eqnarray in multiline equations. There are several reasons why and how to do that, see here:
http://tug.org/pracjourn/2006-4/madsen/madsen.pdf

I personally used eqnarray a lot, and never had problems with that till now, when it just generated too much empty space before and after the equations, so I simply switched to array.

Thursday, June 21, 2012

How to make references to equations

To have correct references of the same form to the equations use the \autoref{} command from within the hyperref package. This will also creat hyperlinks within the document into the referred equations.

Tuesday, June 19, 2012

How to leave open parenthesis in equations

If you use \left( and \right) the syntax checker will not allow you not to close (or not to open) the parenthesis. To get your LaTeX code correct you have to use \left. or \right. to have it closed.

This is useful for instance when you want to add new lines with parenthesis open or write cases like 
$\left\{
   \begin{array}{l c l}
      x &\rightarrow& y \\
      z &\rightarrow& w
    \end{array}

\right.$

Monday, June 18, 2012

Sunday, June 17, 2012

Vertical spaces in equations

This might not be the most sophisticated way to do this, but it works:
simply escape the spaces using \ (backslash)
$x_{k+1}\ =\ x_k+w_k$

Thursday, May 31, 2012

How to write integral from minus infinity to plus infinity in LaTeX

Lower and higher limits to integrals can be set as
$ \int^{+\infty}_{-\infty} x \, dx $

How to write argmax and argmin

$ \operatorname{arg\,max}_a f(a) \operatorname*{arg\,max}_b f(b)$

Note that the first version is more for inline code, while the second is rather for equation. Naturally, arg min is written analogously. Don't forget to use the amsmath package

For more info see
http://en.wikibooks.org/wiki/LaTeX/Advanced_Mathematics

Monday, May 21, 2012

How to write different cases in equations

Many times we need to write different cases like      
a= {0.6 if t <= 100
      {0.9 it t > 100
The easiest, and most elegant way to do this is to use \case command, as
 $a = \begin{cases}
     0.6, & \textnormal{if } t\le100 \\
     0.9 & \textnormal{if } t>100
\end{cases}$

Thursday, May 17, 2012

How to write sum in the equations

The easiest way to write a sum of an expression (i=[1 .. n]) in equations is
$\sum_{i=1}^n expression$
Note that in inline code this will put lower and upper bound next to the sum sign, not over and under. To  display lower and upper bound under and over the sum sign use the \displaystyle command before the sum.

To specify directly that the upper and lower bound are over and under the sum symbol, simply write
$\sum\limits_{i=1}^n expression$

Wednesday, May 16, 2012

How to write fraction

I usually use the \frac command as

$x = \frac{numerator}{denominator}$

This will render numerator over the denominator, alternatively in inline codes \dfrac can be used instead from the amsmath package with the same syntax.