# Some tips to use in latex

## Help

If you have the standard latex installation, you probably have the texdoctk package. Just type texdoctk on a command shell and you will get a nice little program with help on all topics. It should give you this window:

## Pdflatex with eps figures

• If you want to use pdflatex instead of latex just put this in the preamble:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifx\pdfoutput\undefined
\usepackage[dvips]{graphicx}
\else
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\usepackage[plainpages=false,pdfpagelabels]{hyperref}
\pdfcompresslevel=9
\fi
% if using pdflatex, we must use our .pdf images instead of .(e?)ps
\ifx\pdfoutput\undefined
\else
\DeclareGraphicsExtensions{.pdf,.gif,.jpg} % the formats we have images in
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

You will need to have the epstopdf.sty installed and the it will convert the .eps graphics to pdf on the fly. If you use hyperref, the final pdf will have links to the citations and equations. You will need to use your pdflatex command with the option: pdflatex -shell-escape

## Presentations

For presentations in LaTex, you can use the ''prosper'' package. Here is the source of the presentation shown in my main page:

## Citations

If you need citations or references in your legend look at this: Captions

Captions usually appear under Figures and Tables, but you might be able to use them in more adventurous places (Equation Captions?). Plain old captions like this are easy to produce:

\begin{figure}
...
\caption{In this 2-dimensional model, two rays of light from a galaxy at
{\bf S} orbit the deflecting mass {\bf M} and recombine at observer
{\bf O}.  The observer sees two images {\bf `S'} at locations projected
back along the geodesics.}
\label{example-fig}
\end{figure}
But that's just too easy, right? Here's some other things you can do:

• Different captions (usually shorter) in the List of Figures
• References to equations, figures, authors, etc. inside the caption

#### Different entries in the List of Figures

When you include the line \listoffigures in your source, you get a nice List of Figures with the Figure number, its caption, and the page it appears on. If your captions are long and complicated, this List of Figures might stretch on for pages...You can put different captions in the List of Figures by including an optional argument of the \caption command:
\begin{figure}
...
...     |<-----  optional argument of \caption  ----->|
\caption[This is what shows up in the List of Figures.]{Here is the text
that appears under the Figure itself.  This text is often very long and
complicated, and is only useful when you've got the Figure sitting right
there in front of you.  It won't mean much to anyone just reading the
List of Figures.}
\label{example-fig}
\end{figure}

#### References in the caption

Now let's suppose you want to reference an equation or another Figure or cite an author inside the caption. Just sticking in
\caption{ ...from equation (\ref{some-eqn}) we can see ... }
won't work. To quote Jim, LaTeX blows chunks. Who knows? Maybe you're just asking too much! There are two ways get references (and maybe cites, too?) inside a caption. One is a pure kludge, one works the way it's supposed to:

• The Kludge Use \caption[]{ ...\ref{some-eqn}...} with empty square brackets out front. Of course, then you can't have different captions in the List of Figures.
• The Way that Always Works It turns out \ref's are fragile (Hey! that's Lamport's word; it doesn't mean they always get picked last on the ball team...) and must be protected. This property is clearly elucidated in Lamport's manual. (That's a math "clearly" by the way, which means "Ha! No way you can see it, you loser. I, on the other hand, have a Ph.D.") A bunch of other things are fragile, too, mostly things that get changed when LaTeX processes the file the second time. Anyway, the command \protect "protects" the very next word in the source. So to get fragile stuff like equation references in the caption, try this:
\begin{figure}
...
\caption{The graph of the function given in (\protect \ref{some-eqn}).}
\end{figure}
Notice that to get parentheses around the number, like "(7)", the \protect statement has to go inside the ().

## Colours

* For colours: (taken from here)

Use colour with discretion Six primary colours Enable colour by putting into the preamble.

* \usepackage[dvips]{color} if using ordinary LaTeX;
* \usepackage{color} if using pdfLaTeX.
The following, along with black and white, are the primary colours. They are switched in by the command \color{name} with a scope delimited by braces or by the current environment.

* red * green * blue * cyan * yellow * magenta

Sixty-six colours Make the following 66 colours available using options in the request for the color package:

[usenames,dvips] for ordinary LaTeX;
[usenames,dvipsnames] for pdfLaTeX.
See src/mystyle.sty for example. These are X11 colours; note: the case is important in the names. GreenYellow, Yellow, Goldenrod, Dandelion, Apricot, Peach, Melon, YellowOrange, Orange, BurntOrange, Bittersweet, RedOrange, Mahogany, Maroon, BrickRed, Red, OrangeRed, RubineRed, WildStrawberry, Salmon, CarnationPink, Magenta, VioletRed, Rhodamine, Mulberry, RedViolet, Fuchsia, Lavender, Thistle, Orchid, DarkOrchid, Purple, Plum, Violet, RoyalPurple, BlueViolet, Periwinkle, CadetBlue, CornflowerBlue, MidnightBlue, NavyBlue, RoyalBlue, Blue, Cerulean, Cyan, ProcessBlue, SkyBlue, Turquoise, TealBlue, Aquamarine, BlueGreen, Emerald, JungleGreen, SeaGreen, Green, ForestGreen, PineGreen, LimeGreen, YellowGreen, SpringGreen, OliveGreen, RawSienna, Sepia, Brown, Tan, Gray Three final notes

1. At the time of writing there are some glitches that may appear when using colour in pdf documents; avoid these glitches by getting and using \usepackage{pdfcolmk} (as in Src/mystyle.sty)
1. The color package is disabled by using the option monochrome in its request.
2. Lastly, see the grfguide document in the LaTeX Graphics package for loads more information.

## Logo on the title page

From here

A logo in the header or footer for textclass komascript, a logo in the upper right

for all classes with fancyhdr, an example for a footer:
\usepackage{fancyhdr}
\newsavebox{\mylogo}
\savebox{\mylogo}{\includegraphics[width=mm]{/..the path.../logo}}
\cfoot{\rm\thepage~\usebox{\mylogo}}
with the picture environment
\begin{picture}(0,0)(-150,-200)
\includegraphics[scale=2]{Logo.eps}
\end{picture}
the values (-150,-200) have to correct, so that the eps-file is in the right upper corner.

Current Tags:
create new tag
, view all tags
Topic attachments
I Attachment Action Size Date Who Comment
png Latexhelp.png manage 38.8 K 2007-10-22 - 09:53 JuanUribe latex help screenshot
tex elliptic_relaxation.tex manage 13.8 K 2007-10-22 - 10:34 JuanUribe internal seminar presentation source
Topic revision: r3 - 2008-08-19 - 15:17:00 - JuanUribe
Main Web
20 Jul 2018

Manchester CfdTm
Code_Saturne

ATAAC
KNOO

DESider
FLOMANIA