Feeds:
Posts
Comments

Posts Tagged ‘LaTex’

Natbib: change spacing in references

It happens that you would like to decrease the spacing in your references, e.g. for a thesis. Here, I found a simple way how to do it. Add the following to your preamble (the body of LaTEx program before \begin{document}):

\let\oldthebibliography=\thebibliography
\let\endoldthebibliography=\endthebibliography
\renewenvironment{thebibliography}[1]{%
\begin{oldthebibliography}{#1}%
\setlength{\parskip}{0ex}%
\setlength{\itemsep}{0ex}%
}%
{%
\end{oldthebibliography}%
}

It worked for me, so I hope works for you as well. If you do NOT use Natbib, you have to solve the problem differently.

Advertisements

Read Full Post »

Text color in Beamer presentations

Beamer is a LaTeX class for creating slides for presentations. It supports both pdfLaTeX and LaTeX + dvips. The name is taken from the German word Beamer, a pseudo-anglicism for video projector.

One can make beautiful and structured presentation using all power of LaTex. You can install it in Linux distributions from your package manager.

There are a few text color available by default like green, blue, and red.

To have a variety of text colors in your beamer presentation, simply include

\usepackage{xcolor}

in the heading of your Tex file and define your own colors.
I suggest the following:

\definecolor{olive}{rgb}{0.3, 0.4, .1}
\definecolor{fore}{RGB}{249,242,215}
\definecolor{back}{RGB}{51,51,51}
\definecolor{title}{RGB}{255,0,90}
\definecolor{dgreen}{rgb}{0.,0.6,0.}
\definecolor{gold}{rgb}{1.,0.84,0.}
\definecolor{JungleGreen}{cmyk}{0.99,0,0.52,0}
\definecolor{BlueGreen}{cmyk}{0.85,0,0.33,0}
\definecolor{RawSienna}{cmyk}{0,0.72,1,0.45}
\definecolor{Magenta}{cmyk}{0,1,0,0}

You can find many more on the web. A sample output is like this:

The above colors was created using this simple frame:

\begin{frame}
\textcolor{blue}{blue}
\textcolor{green}{green}
\textcolor{yellow}{yellow}
\textcolor{orange}{orange}
\textcolor{red}{red}
\textcolor{violet}{violet} \newline

\textcolor{BlueGreen}{bluegreen}
\textcolor{dgreen}{dgreen}
\textcolor{olive}{olive}
\textcolor{title}{title}
\textcolor{Magenta}{magenta} \newline
\textcolor{gold}{gold}
\textcolor{darkyellow}{darkyellow}
\textcolor{RawSienna}{rawsienna}
\end{frame}

good luck !

Read Full Post »

Texhash

In LaTex, after you have downloaded the necessary files (styles, …), you have to make these visible to TeX. This is accomplished by the following two steps.

Create a private tex hierarchy.
Under your home directory, create a subdirectory “texmf”, underneath that directory create another one called “tex”. and under this one create a “latex” directory. Thus, you should have a tree of the form

$HOME/texmf/tex/latex/

Place document class files (extension .cls), packages and any other custom style files for use by LaTeX (extensions .sty or .tex) into this directory.

If custom bibtex style files (extension .bst) have been provided, place these into a similar tree of the form

$HOME/texmf/bibtex/bst/

for *.bib files, create  a directory

$HOME/texmf/bibtex/bib/

and put .bib files there.

all *.fd files into the directory $TEXMF/tex/latex/

Run the “texhash” program. Simply type “texhash” at the prompt. This will create a database of files inside your texmf directory. The database file is called, appropriately enough, “ls-R”, and is located in the top level texmf directory, i.e., the file is $HOME/texmf/ls-R . The ls-R file is an ordinary text file and can be inspected with an editor or a pager like more or less. If the texhash run was successful, this file should contain a listing of all files under your private texmf directory.

Whenever you add new files to your texmf tree, be sure to run texhash. For efficiency reasons, TeX does not search for files, but only consults the ls-R database; if a (non-standard) file is not listed in this database, TeX will not find it.

Read Full Post »