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

Wednesday, May 23, 2012

How to use multiple .bib files

Bibtex files are countaining references. In some cases we would like to use multiple .bib files, these we can simple enumerate in the  \bibliography command
as

\bibliography{file1,file2}
where file1.bib and file2.bib contain the references

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.

How to write mathematical symbols

A fairly good description about the topic can be found here:
http://amath.colorado.edu/documentation/LaTeX/Symbols.pdf

Write normal (gaussian) distribution in LaTeX

To imply that a random variable v is distributed according to the normal distribution with mean m and covariance sigma^2 write

\usepackage{amssymb}

$v \sim \mathcal{N} (m,\sigma^2)$

note that the package amssymb is needed in order to use \mathcal

Friday, May 4, 2012

Collaborative editing

My first guess for collaborative editing was googledocs with latexlab as described here.
But this in my opinion has serious privacy issues.

Some other ideas are text tracking systems, like svn or git as back-end. A collection of possible methods can be found here.

However this topic is still unresolved.

Update: there are two main alternatives for online collaborative editing:
  • Sharelatex
  •  Overleaf