Friday, March 30, 2012

How to embed fonts in your document

Sometimes you need font types embedded into your document, here is a good solution:

http://mohamednabeel.blogspot.pt/2009/10/fixing-font-not-embedded-issue-to-pass.html

Since I personally use kile to edit LaTeX documents, I process normally to create the .dvi, and then I use the commands

> dvips -Ppdf -G0 -tA4 file.dvi

> ps2pdf -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress file.ps file.pdf

Monday, March 26, 2012

How to link webpages from latex

Use the hyperref package as:
 
\documentclass{article}
\usepackage{hyperref}
\begin{document}

Here's a link to \href{http://webpage.com}{text}.

\end{document}
 
See at http://www.johndcook.com/blog/2008/11/24/link-to-web-pages-from-latex-pdf/
 or
 http://en.wikibooks.org/wiki/LaTeX/Hyperlinks

How to create matrices

Generally the easiest way is:
$
  L = \left[
    \begin{array}{cc}
       x & y \\
       z & w
    \end{array} \right]
$
A good reference about the topic can be found here:

http://www.rizauddin.com/2009/05/how-to-create-a-matrix-in-latex/

An even easier way to do this is to use pmatrix as
$
  \begin{pmatrix}
     x & y \\
     z &  w
  \end{pmatrix}
$
 However this latter will always put the matrix inside round  parenthesis.

Tuesday, March 20, 2012

write 1st, 2nd, ... nth correctly

Using the nth package as

\usepackage[super]{nth}

 ...

 \nth{<number>}

super is only needed if you want the "th" in superscript, this is the English preferred format, so I usually use as this

or alternatively

 k$^{\textnormal{th}}