Cognitionis
The little I know

LaTeX


LaTeX (pronounced /ˈleɪtɛk/ or /ˈlɑːtɛk/) is a document markup language and document preparation system. It was originally written in the early 1980s by Leslie Lamport (LamportTeX) at SRI International. It has become the dominant method for using TeX typesetting program (Donald Knuth) —few people write in plain TeX anymore. The current version is LaTeX2e. LaTeX is widely used by scientists and engineers in academic documents and publications because of the quality of typesetting achievable by TeX.

LaTeX logo

Latex installation

Unix

Tex

Latex is installed by default under the vast majority of Linux distribution. Anyway you can install the package downloading it on the Latex project page or using apt-get command in Debian distributions

texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended lmodern

ERROR
Error: The current version is texlive (TeX-Live). Ver como se instala….
ERROR

To be able to write in catalan or spanish languages using accents and all this stuff you will need to install through synaptic: texlive-latex-extra and latex-ucs. As well as include in your documents:

usepackage[spanish]{babel}
usepackage{ucs}
usepackage[utf8]{inputenc} %

Latex editor

There are several Latex editors. The one I use and I recommend is Kile (also available using apt-get).
TIP1: If you want to write accents or lenguage specific chars in Kile you have to install: sudo apt-get install kile-i18n-es and sudo apt-get install kile-i18n-ca. If don’t work go System->Administration->Language support and enable complex char support. reboot. If not try: vim /etc/default/locale and remove “valencia” and do sudo dpkg-reconfigure locales.
TIP2:If you want to use spell correctors you can install ispell using apt-get (ispell ispanish, ispell icatalan…)

Windows

Tex

Latex is not installed by default. The most common Tex implementation for Windows is Miktex.

Latex editor

The most common Latex editor for Windows is TeXnic-Center.

Latex Basis

da da da…

For more information read the Latex Basic Kit.

Latex presentations with Beamer

Beamer is a LaTeX class for creating slides for presentations. It works together with pdflatex, dvips and LyX. The name is taken from the German word “Beamer”, a pseudo-anglicism for video projector.

The Beamer class is not the first LaTeX class for creating presentations, and like many of its predecessors, it has special syntax for defining ’slides’ (known in Beamer as ‘frames’). Slides can be built up on-screen in stages as if by revealing text that was previously hidden or covered. This is handled with PDF output by creating successive pages that preserve the layout but add new elements, so that advancing to the next page in the PDF file appears to add something to the displayed page, when in fact it has redrawn the page.

Beamer provides the ability to make ‘handouts’, that is a version of the output suitable for printing, without the dynamic features, so that the printed version of a slide shows the final version that will appear during the presentation.

(Latex Beamer Basic Kit).

Always have the official Beamer user guide.

A good tutorial is plagatux one:

See a tutorial at plagatux Intro and Example.

Some tricks:

#compilar con PDFLatex (pdflatex), el dvi puede dar errores

documentclass[hyperref={pdfpagelabels=false}]{beamer} # Avoid warning

# handout mode for print&study your presentation

usepackage[T1]{fontenc}

My personal Beamer style is cognitionis.

Latex Bibliography

BiBTeX

BibTeX is a tool for formatting lists of references. The BibTeX tool is typically used together with the LaTeX document preparation system. BibTeX was created by Oren Patashnik and Leslie Lamport in 1985. BibTeX makes it easy to cite sources in a consistent manner, by separating bibliographic information from the presentation of this information. This same principle of separation of content and presentation/style is used by LaTeX itself.

BibTeX uses a style-independent text-based file format for lists of bibliography items, such as articles, books, theses. BibTeX bibliography files usually end in .bib.

Bibliography entries each contain some subset of standard data entries:

  • address (Only for books and articles): Publisher’s address (usually just the city, but can be the full address for lesser-known publishers)
  • author: The name(s) of the author(s) (in the case of more than one author, separated by and)
  • booktitle: The title of the book, if only part of it is being cited
  • chapter: The chapter number
  • crossref: The key of the cross-referenced entry
  • edition: The edition of a book, long form (such as “first” or “second”)
  • editor: The name(s) of the editor(s)
  • ISBN: International Standard Book Number (10 Digits)
  • journal: The journal or magazine the work was published in
  • key: A hidden field used for specifying or overriding the alphabetical order of entries (when the “author” and “editor” fields are missing). Note that this is very different from the key (mentioned just after this list) that is used to cite or cross-reference the entry.
  • location (only for inproceedings): city which the conference is held.
  • month: The month of publication (or, if unpublished, the month of creation)
  • number: The “number” of a journal, magazine, or tech-report, if applicable. (Most publications have a “volume”, but no “number” field.)
  • pages: Page numbers, separated either by commas or double-hyphens. For books, the total number of pages.
  • publisher: The publisher’s name
  • series: The series of books the book was published in (e.g. “The Hardy Boys“)
  • title: The title of the work
  • volume: The volume of a journal or multi-volume book
  • year: The year of publication (or, if unpublished, the year of creation)

In addition, each entry contains a key that is used to cite or cross-reference the entry. This key is the first item in a BibTeX entry, and is not part of any field.

Entry Types

Bibliography entries included in a .bib are split by types. The following types are understood by virtually all BibTeX styles:

article
An article from a journal or magazine.
Required fields: author, title, journal, year
Optional fields: volume, number, pages, month, note, key
book
A book with an explicit publisher.
Required fields: author/editor, title, publisher, year
Optional fields: volume, series, address, edition, month, note, key, pages
booklet
A work that is printed and bound, but without a named publisher or sponsoring institution.
Required fields: title
Optional fields: author, howpublished, address, month, year, note, key
conference
The same as inproceedings, included for Scribe (markup language) compatibility.
Required fields: author, title, booktitle, year
Optional fields: editor, pages, organization, publisher, address, month, note, key
inbook
A part of a book, usually untitled. May be a chapter (or section or whatever) and/or a range of pages.
Required fields: author/editor, title, chapter/pages, publisher, year
Optional fields: volume, series, address, edition, month, note, key
incollection
A part of a book having its own title.
Required fields: author, title, booktitle, year
Optional fields: editor, pages, organization, publisher, address, month, note, key
inproceedings
An article in a conference proceedings.
Required fields: author, title, booktitle, year
Optional fields: editor, pages, organization, publisher, address, month, note, key
manual
Technical documentation.
Required fields: title
Optional fields: author, organization, address, edition, month, year, note, key
mastersthesis
A Master’s thesis.
Required fields: author, title, school, year
Optional fields: address, month, note, key
misc
For use when nothing else fits.
Required fields: none
Optional fields: author, title, howpublished, month, year, note, key
phdthesis
A Ph.D. thesis.
Required fields: author, title, school, year
Optional fields: address, month, note, key
proceedings
The proceedings of a conference.
Required fields: title, year
Optional fields: editor, publisher, organization, address, month, note, key
techreport
A report published by a school or other institution, usually numbered within a series.
Required fields: author, title, institution, year
Optional fields: type, number, address, month, note, key
unpublished
A document having an author and title, but not formally published.
Required fields: author, title, note
Optional fields: month, year, key

Styles

There are different styles to show and point references. A list of standar BiBTex styles are described and rendered in this pdf. Some examples are:

plain [number]

plainyr [number] (IMPORTANT: Sorts by chronological reverse order. The solution for CVs)

abbrv [number]

alpha [XxxYY] (X author first 3 chars, Y year last 2 digits)

apalike [author, year]

My favorite style is apalike.

BiBTeX Bibliography Managers

It is common to use a GUI to manage your bibliographies (”.bib” files). Some of that applications are:

BibTool, Bibi, Aigaion.

My favorite manager is Aigaion (My Aigaion Mod). You can follow this Aigaion Basic Kit.

Latex Extras

The basis by examples

Make a professional looking cv using latex.

How to install LaTeX Style Files (.sty) on Ubuntu, using TeTeX (Deprecaded) or Tex Live (Current)

One thing that makes LaTeX so powerful is the enourmous amount of extensions available. Some extensions, usually with the .sty filename extension, do not come with an installation tutorial. I consider that they do not come with a tutorial because it is assumed it is an easy task. Another reason for having no installation instructions might be because it is platform dependent (i.e., different installation directories).

The directory for installing LaTeX files, on Ubuntu, depends on the distribution you are using. If you are using TeTeX, it is:

/usr/share/texmf-tetex/tex/latex

If you are using TeX Live, it is:

/usr/share/texmf-texlive/tex/latex

To install a style file you have to create a directory for it and copy the contents there. Next you have to run the program mktexlsr as root.

This is an example on how to install the prooftree extension, using the TeTeX distribution:

  1. create a directory named prooftree on /usr/share/texmf-tetex/tex/latex
  2. copy the file prooftree.sty and the file prooftree.tex to the directory /usr/share/texmf-tetex/tex/latex/prooftree
  3. run sudo mktexlsr

Some Latex tricks.

Paquetes interesantes: longtable fancybox

Figures i taules: son objectes que apareixen en algun lloc del document que estan fora de la seqüència lineal del text. Son objectes flotants. S’identifiquen amb un peu o capcalera (numerat).

begin{table}[ubicació(tbph)]
cos de la taula
caption{llegenda}
label{etiqueta}
end{table}

Partir el document en varios fitxers. Es com un include de php (include{document1} o input{document1} %introduira document1.tex en include en una pagina nova i en input a continuació).

Graficos (con picture o un paquete adicional que es pictex) (o cualquier imagen en png (lo mejor, jpg…) con el paquete graphicx)

picture reserva espai, put (o multiput) posa objectes