Use latex !


For Windows I recommend using MikTeX distribution, and TeXnicCenter which is an excellent latex editor (keyboard shortcuts etc).

With Linux I use TeTex distribution, and a normal text editor (Scite or Kate) or Kile which is a good latex editor (integrated compilation).


To have all references as hyperlinks (table of contents, references, URLs) … You can also fill title and author fields of the pdf file.

\usepackage[colorlinks=true,urlcolor=blue,pdftitle={My report},pdfauthor={Cyril}]{hyperref}
\href{}{Google's website}

Include PDF documents

Compile with pdflatex.

\includepdf[pages=-]{pdf_filename_without_extension} % all pages

Highlight syntax in your code

% this is not mandatory (customization), after begin{document} :
language=[ANSI]C++, % default language
numbers=left, numberstyle=\tiny, stepnumber=5, numbersep=5pt,
for(int i = 0; i < 10; i++)
  cout << i << " " << endl;
<foo bar=value>
\lstinputlisting{matlab.m} % include the file


\bibliographystyle{plain} % before begin{document}
\nocite{*} % to print all references in the biblio without citing them

In a file biblio.bib :

  author = {Stuart Russel and Peter Norvig},
  publisher = {Pearson Education},
  title = {Artificial Intelligence},
  year = {2006}
  author = {P. Gaussier, C. Joulain, J.P. Banquet, S. Leprêtre, A. Revel},
  title = {The visual homing problem},
  year = {1999}
  title = {C++ FAQ Lite},
  author = {Marshall Cline},
  note = {Available on the Internet :}

Then for compilation :

  1. [pdf]latex file.tex
  2. bibtex file
  3. [pdf]latex file.tex
  4. [pdf]latex file.tex


To add some text that is viewed on the screen, but not printed.

The online version of this document contains additional information at
the end of this paragraph.
\pdfannot width 10em depth 50mm
  { /Subtype /FreeText
    /Contents (Hello, world!)}


Multirow entries in a table


For example :

short & still short\\
oh, short & \parbox[t][0.5cm]{4cm}{Oh this is really a very long sentence that I have to write in that cell now}\\

Number subsubsections with letters

\setcounter{secnumdepth}{3} % to number subsubsections
\renewcommand\thesubsubsection{\alph{subsubsection}} % to number them with just a letter
\renewcommand\p@subsubsection{\thesubsection.} % to reference them with chap.sec.ssec.sssec



When doing a texhash :

texhash: /usr/local/share/texmf/ls-R lacks magic string. Skipping...

The magic string is :

% ls-R -- filename database for kpathsea; do not change this line.

You must add it as the first line of the file /usr/local/share/texmf/ls-R

EDIT by cJ : You're sure of this ? I'm generating my ls-R with ls -R so I don't have this line, and kpathsea never complained … EDIT by cyril : all I know is that I had this error, there was no magic string, and after adding it texhash didn't complain anymore …

programming/latex.txt · Last modified: 2013/09/19 16:40 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki