Thursday, November 13, 2014

How to write limit in latex

\operatorname*{lim}_{x\rightarrow \inf} f(x) = y

Tuesday, June 17, 2014

Writing today's date

Nothing could be more simple than writing the today's date, for instance into a title page. You only have to include:

\today


Spell check an entire project

It is not easy to deal with a large project including several .tex files. Sometimes I need to spell-check all files manually. Here is a solution, however it would be better to integrate this into an editor, like kile

https://paulbradley.org/aspell/

Monday, May 19, 2014

Missing abstract in scrreprt

I have just started writing my thesis, and I noticed that the title for the abstract is not spelled out. Well, as it seems, the abstract has to be explicitly switched on with scrreprt class using the abstracton option.
\documentclass[a4paper,10pt, abstracton]{scrreprt}

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.

Saturday, March 1, 2014

Making list / glossary of acronyms and abbreviations

The easiest way to write abbreviations is to make use of the acronym package, see
http://latexbestpractice.blogspot.pt/2013/08/writing-acronyms-and-abbreviations-in.html

To define the glossary (list of abbreviations), I define acronyms using
\acro{short}[short-to-appear]{full-definition} command. Then referring the abbreviations with \ac command. Note \acf, is for full description, even if it's not the first occurrence, and \acs for plural form.

\usepackage{acronym}

...

\subsection*{Abbreviations}
\begin{acronym}
    \acro{mse}[MSE]{Mean Squared Error}
    \acro{mmse}[MMSE]{Minimum Mean Squared Error}
    \acro{}[ODE]{Ordinary Differential Equation}
\end{acronym}

...
\ac{ode} ...
\ac{mse} ....
\acf{ode}

Monday, February 17, 2014

How to prevent figures and tables from floating

Many times I received messages like
 
  LaTeX Warning: `!h' float specifier changed to `!ht'.

resulting my figures / tables appearing on the top of the page, however I wanted to place the figure _exactly_ where at that position.
TThe solution I found here is to use the package float
 
\usepackage{float}
...
\begin{figure}[H]
...
\end{figure}

Tuesday, January 21, 2014

How to change fonts in beamer equations

For a long time it was really annoying that the default fonts for the beamer template is just not right. I wanted to have the default fonts back for the equations, that look the same as in articles. Then I found this:

http://tex.stackexchange.com/questions/41572/setting-math-fonts-in-beamer

The solution that was working best for me was:
\usefonttheme[onlymath]{serif}

Monday, December 16, 2013

how to write naiive

na\"\i ve

 Works for me

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.

Tuesday, October 15, 2013

diff LaTeX documents

This is a great stuff to diff latex docs:

http://www.ctan.org/tex-archive/support/latexdiff

you might also be able to install it for your ubuntu for instance using

$ sudo aptitude install latexdiff

Usage:

$ latexdiff old.tex new.tex > diff.tex

This will create a new file called diff.tex, which is a valid LaTeX document countaining the difference between the two, if old.tex and new.tex were also valid LaTeX docs, and you can proceed diff.tex as you normally would creating eps, pdf, html, etc ...

If you don't want to or can't install the tool, it's available online here:
http://3142.nl/latex-diff/

If you are using version control like svn or cvs, you might consider using the latexdiff-vc command, that actually makes the diff from the version in the version control. More resources about this you can find at the links below:

http://kwtrnka.wordpress.com/2010/11/28/latexdiff-version-control/  

http://www.jwe.cc/2012/02/workflow-with-subversion-and-latex/ 

For example I use

 $ latexdiff-vc --svn -r <oldversion> --pdf <mylatex.tex>
in order to generate pdf diff in one step

Tuesday, August 27, 2013

How to convert latex to M$ office / openoffice readeable

The easiest and best solution I found so far to do this (under linux) is the method on
http://ubuntuforums.org/archive/index.php/t-1033441.html
Using htlatex

latex foo.tex
latex foo.tex
latex foo.tex
htlatex foo.tex
 This then will create a relatively good looking html, that can be read under soffice for instance and convert to doc / docx, etc...
This converts the equations to figures, and the layout could be better, but it works fine.

Another option is to use the  tex2rtf package
http://www.ctan.org/pkg/tex2rtf
This one generates an .rtf file, but the result on my files were not that good, and the equations were a disaster, and can not handle eps figures (pslatex)...