Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm currently trying to add an index to my .tex file but it never appears in my pdf document.

\documentclass[11pt]{book}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{dsfont}
\usepackage[dutch]{babel}

\usepackage{cases}
\usepackage{color}


\newtheorem{stell}{Stelling}[section]
\newtheorem{gev}{Gevolg}[section]
\newtheorem{lemm}{Lemma}[section]
\theoremstyle{definition}
\newtheorem{defn}{Definitie}[section]
\newtheorem{vb}{Voorbeeld}[section]

\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}

\usepackage{makeidx}
\makeindex

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\nouppercase{\leftmark}}
\fancyfoot[C]{\thepage}


\title{Book}

\begin{document}
\maketitle
\tableofcontents
\chapter{First chapter}
\section{First section}\index{first section}

\printindex
\end{document}

Edit I had forgotten to add the `\printindex' in my message. But it was allready in my tex-file.

share|improve this question
1  
where do you print the index? There is no \printindex command –  daleif Sep 13 '13 at 7:16
    
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  Heiko Oberdiek Sep 13 '13 at 7:31
1  
Expanding on daleif's comment: LaTeX can't know where you want your index, so a \printindex command is necessary in the location. Don't forget to run MakeIndex. –  egreg Sep 13 '13 at 8:50
    
egreg: how can I run my MakeIndex, I don't see such a file in my directory? –  Anne O'Nyme Sep 13 '13 at 9:03
1  
it is called makeindex and it is a part of your LaTeX instalaltion. In most cases you will have a makeidnex button in your editor somewhere. Otherwise you need to run makeindex file.idx manually. This creates the index ready for LaTeX to include –  daleif Sep 13 '13 at 9:27
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.