Latex is a document preparation system. It is an amazing tool to edit texts, create presentations and much more allowing the author to concentrate on the contents, rather than on the formatting of a document. It works great out of the box, but sometimes it can lead to some headaches. To minimize these occurrences and to have a readily accessible list of howto, I am listing here some of the tips and tricks I've adopted to solve my problems. These solutions come from various sources freely available on the net or from manuals. For a (non exhaustive) list of sources, please check the links at the end of this page.
Add the following line in the preamble:
\usepackage{graphicx}
Then you can trim your figure as follows:
\begin{figure}[htbp]
\includegraphics[trim = left bottom right top, cliop]{file}
\end{figure}
Add the following line in the preamble:
\usepackage{paralist}
Then you can write your list as follows:
\begin{compactenum}[i.] %%sets the symbol to be used in the list.
\item{first item;}
\item{second item.}
\end{compactenum}
Add the following line in the preamble:
\def\thesection{\arabic{section}}
Add the following lines in the preamble:
\makeatletter
\renewcommand{\@dotsep}{500}
\makeatother
Add the following lines in the preamble:
\renewcommand{\footnoterule}{%
\kern -3pt
\hrule width \textwidth height 0pt
\kern 3pt
}
Add the following line in the preamble:
\usepackage{pst-all}
To generate the pdf file follow these steps:
1. move to the directory with yourdocument.tex;
2. latex yourdocument.tex;
3. dvips -Ppdf -G0 yourdocument.dvi;
4. ps2pdf yourdocument.ps
If you have also a bibtex file then run:
5. bibtex yourbibfile.bib
6. repeat steps 2 to 4.
If you use the NATBIB package, add the following line in the preamble:
\def\bibfont{\footnotesize} %%attributes the footnotesize to the bibliography font.
If you use the BIBLATEX package, add the following line in the preamble:
\renewcommand*{\bibfont}{\footnotesize} %%attributes the footnotesize to the bibliography font.
Add the following line in the preamble:
\usepackage{subcaption
}
\begin{figure}[h]%
\begin{subfigure}[h]{0.4\textwidth}
\includegraphics[width=\textwidth]{<the name of the first file>}
\caption{<The caption of the first figure>}
\end{subfigure}
\quad %%includes a vertical space between the two figures.
\begin{subfigure}[h]{0.4\textwidth}
\includegraphics[width=\textwidth]{<the name of the second file>}
\caption{<The caption of the second figure>}
\end{subfigure}%
\caption{<The caption of the overall figure>}
\end{figure}
Add the following lines in the preamble:
\newcommand{\nameofthecommand}% %%\newcommand{} allows to declare a new command. In braces put the name of the new command.
[3] % %%in the first square brackets declare the number of arguments to pass to the new command.
[i] % %%in the second square brackets eventually declare any default value for the first argument.
{\ensuremath{% %%in this case the command produces a mathematical symbol. The command \ensuremath{} takes care of the braces.
\Gamma^{#1#2}_{#3}} % %%finally, define the function the new command should perform.
}
Add the following line in the preamble:
\logo{\includegraphics[width=0.20\textwidth]{<your picture>}}
Add the following line in the preamble:
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{<your picture>}}
To set the picture for the background of a single slide:
Put the \usebackgroundtemplate{} command within a group including the frame environment:
{ \usebackgroundtemplate{\includegraphics[width=\paperwidth]{./gph/guess}} \begin{frame} put some content here \end{frame} }
Add the following line in the preamble:
\setbeamertemplate{footline}[frame number]
Add the following line in the preamble:
\setbeamertemplate{footline}[text line]{Add your text here!}
Add the following lines in the preamble:
\newcommand{\Ffootline}{% %%defines a new command called \Ffootline
\insertshortauthor %%puts the abbreviated form of the author's name in the left corner
\hfill
\insertshortinstitute %%puts the abbreviated form of the author's institution in the middle
\hfill
\insertframenumber/\inserttotalframenumber} %%includes the current slide number over the total slide number in the right corner
Finally, we inform latex to include the newly created command in the footline:
\setbeamertemplate{footline}{% %%sets the options for the footline
\usebeamerfont{structure} %%uses the same fonts adopted for the structure of the presentation
\Tiny\hspace*{4mm} \Ffootline \hspace{4mm} %%sets the size of the font to Tiny and includes the content of the \Ffootline
} %%command leaving a margin of 4mm to the right and left of the content.
Add the following lines in the frame:
\begin{columns} %%starts the column environment
\column{0.50\textwidth} %%sets the first column to 50% of the width of the text
content of the first column %%include text, images or charts here
\column{0.50\textwidth} %%sets the second column to 50% of the width of the text
content of the second column %%include text, images or charts here
\end{columns} %%closes the column environment
Note: you can include more than two columns in the same frame. Just make sure the width of columns
adds up to 100.
Add the following lines in the preamble: \usepackage[T1]{fontenc}
\usepackage{fontstyle} %%where fontstyle can be one of the following freely
%%available fonts:
lmodern %%Latin Modernmathptmx %%Times with Math style
mathpazo %%Palantino
charter %%Charterbookman %%Bookmannewcent %%New Century Schoolbook helvet %%Helvetica (Arial)cmbright %%CM-Brightavant %%Avantgardcourier %%Courierluximono %%Luxi Mono
http://en.wikibooks.org/wiki/Latex
http://latex-community.org/forum/