Book Image

LaTeX Cookbook

By : Stefan Kottwitz
Book Image

LaTeX Cookbook

By: Stefan Kottwitz

Overview of this book

LaTeX is a high-quality typesetting software and is very popular, especially among scientists. Its programming language gives you full control over every aspect of your documents, no matter how complex they are. LaTeX's huge amount of customizable templates and supporting packages cover most aspects of writing with embedded typographic expertise. With this book you will learn to leverage the capabilities of the latest document classes and explore the functionalities of the newest packages. The book starts with examples of common document types. It provides you with samples for tuning text design, using fonts, embedding images, and creating legible tables. Common document parts such as the bibliography, glossary, and index are covered, with LaTeX's modern approach.You will learn how to create excellent graphics directly within LaTeX, including diagrams and plots quickly and easily. Finally, you will discover how to use the new engines XeTeX and LuaTeX for advanced programming and calculating with LaTeX. The example-driven approach of this book is sure to increase your productivity.
Table of Contents (19 chapters)
LaTeX Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Designing a curriculum vitae


Tabular layouts are very common today for the Curriculum Vitae (CV). When applying for a job, inform yourself about the typical requirements of the content of a CV. You can then create a simple document with tables, consistently and clearly readable.

If it needs to be made quickly or if you would like to base it upon a proven modern layout, you can use a template. In this recipe, we will use the moderncv class and its template to quickly produce a CV.

Getting ready

If it's not already installed on your computer, download and install moderncv from CTAN (http://ctan.org/tex-archive/macros/latex/contrib/moderncv).

If your TeX installation provides a package manager, use it for the installation.

There's a directory of examples, containing templates which you can use. Either locate it in the documentation branch of your TeX directory tree, or visit the preceding CTAN link for downloading.

How to do it...

We will start using a sample file provided by the moderncv package. Perform these steps:

  1. Copy the file template.tex, into your document directory and rename it. Choose any name you like. I named it as MyCV.tex.

  2. Open that document, that is, MyCV.tex, and look around to understand the template. Luckily, it is full of comments on how to use it. Compile it to ensure that this document works.

  3. Review and edit the class and package options in MyThesis.tex.

  4. Remove the filler text and type in your own data. At the beginning, your document may look like this:

    \documentclass[11pt,a4paper,sans]{moderncv}
    \moderncvstyle{classic}
    \moderncvcolor{blue}
    \usepackage[scale=0.75]{geometry}
    \name{John}{Doe}
    \title{CV title}
    \address{street and number}{postcode city}{country}
    \phone[mobile]{+1~(234)~567~890}
    \phone[fixed]{+2~(345)~678~901}
    \email{[email protected]}
    \homepage{www.johndoe.com}
    \photo[64pt][0.4pt]{ctanlion.pdf}
    \begin{document}
    \makecvtitle
    \section{Education}
    \cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}%
      {Description}
    \cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}%
      {Description}
    \section{Experience}
    \subsection{Vocational}
    \cventry{year--year}{Job title}{Employer}{City}{}%
      {General description\newline{}Detailed achievements:%
    \begin{itemize}%
      \item Achievement 1;
      \item Achievement 2, with sub-achievements:
        \begin{itemize}%
        \item Sub-achievement (a)
        \item Sub-achievement (b)
      \end{itemize}
    \item Achievement 3.
    \end{itemize}}
    \cventry{year--year}{Job title}{Employer}{City}{}
      {Description line 1\newline{}Description line 2}
    \subsection{Miscellaneous}
    \cventry{year--year}{Job title}{Employer}{City}{}{Description}
    \section{Languages}
    \cvitemwithcomment{Language 1}{Skill level}{Comment}
    \cvitemwithcomment{Language 2}{Skill level}{Comment}
    \end{document}
  5. Compile and take a look at the following result:

How it works...

We loaded the moderncv package. We used 11 pt as the base font size; 10 pt and 12 pt are also supported. We selected A4 paper; other paper size options are a5paper, letterpaper, legalpaper, and executivepaper. You can also add the landscape option. We chose a sans serif font, which is fine for such lists; alternatively, you could write Roman alphabets for a serif font.

We selected the classic style. Other available styles are casual, oldstyle, and banking.

Our color style is blue. Other color options are orange, green, red, purple, gray, and black.

We loaded the geometry package with a scaling factor for reducing the margins.

Using macros such as the \name and \address, we entered our personal data.

The \photo command includes our photo; the size options are the height to which it is scaled and the thickness of the frame around the photo. In this recipe, we used the CTAN lion drawn by Duane Bibby for the photo.

The document body is divided into sections and subsections, just with a special design.

Then, the \cventry command makes a typical resume entry for job or education. Use it as follows:

\cventry[spacing]{years}{job title}
  {employer}{localization}{detail}{job description}

Otherwise, you can use the following:

\cventry[spacing]{years}{degree}
  {institution}{localization}{grade}{comment}

You can leave the last four arguments empty if you don't need them.

A simpler line is created using \cvitem, as follows:

\cvitem[optional spacing length{header}{text}

The \cvitemwithcomment command works in a similar way, just with another argument that is printed at the right.

If you are looking for deeper information beyond this quick start guide, some more commands and options are explained in the very well-documented template.tex file, as well as in the class file moderncv.cls itself.

See also

The template file contains a letter template that you can use for an application. Another approach is explained in the next recipe.