4

How can I create an index with the memoir document class? I always get an error message.

\documentclass[10.5pt,a4paper,oldfontcommands]{memoir}

\usepackage[polutonikogreek, latin, english, french, ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage[dvips]{graphicx}
\usepackage{times}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{latexsym}
\usepackage{stmaryrd}
\usepackage{enumerate}
\usepackage{nicefrac}
\usepackage[all]{xy}
\usepackage{tabularx}
\usepackage{pst-plot,pstricks}
\usepackage{varwidth}
\usepackage{thmtools}
\usepackage{enumitem}
\usepackage{geometry}
\usepackage{float}
\usepackage{siunitx}
\usepackage{natbib} 
\usepackage{graphicx,xcolor}
\usepackage{epstopdf}
\usepackage{pdfpages}
\usepackage{epsfig}
\usepackage{filecontents}
\usepackage{transparent}
\graphicspath{{img/}}
\usepackage{pgfplots}
\def\FunctionF(#1){(#1)^3- 3*(#1)}%
\usepackage{url}



\floatstyle{boxed} 
\restylefloat{figure} 


\renewcommand{\listfigurename}{Abbildungen}

\usepackage[breaklinks=true,colorlinks=true, linkcolor=black,urlcolor=black,citecolor=black, bookmarks=true,bookmarksopenlevel=2]{hyperref}

\usepackage{geometry}
\geometry{total={210mm,297mm},
left=20mm,right=20mm,
bindingoffset=10mm, top=20mm,bottom=20mm}

\OnehalfSpacing

%%% CHAPTER'S STYLE
\chapterstyle{lyhne}

%%% STYLE OF SECTIONS, SUBSECTIONS, AND SUBSUBSECTIONS
\setsecheadstyle{\Large\bfseries\sffamily\raggedright}
\setsubsecheadstyle{\large\bfseries\sffamily\raggedright}
\setsubsubsecheadstyle{\bfseries\sffamily\raggedright}

%%% STYLE OF PAGES NUMBERING
\pagestyle{plain}
\makepagestyle{plain}
\makeevenfoot{plain}{November 2016}{}{\thepage}
\makeoddfoot{plain}{November 2016}{}{\thepage}
\makeevenhead{plain}{\underline{Schweizer Jugend Forscht}}{}{\underline{Potz Blitz - Gewitter in Theorie und Praxis}}
\makeoddhead{plain}{\underline{Schweizer Jugend Forscht}}{}{\underline{Potz Blitz - Gewitter in Theorie und Praxis}}
\maxsecnumdepth{subsection} % chapters, sections, and subsections are numbered
\maxtocdepth{subsection} % chapters, sections, and subsections are in the Table of Contents


\begin{document}
Hello
\end{document}
lockstep
  • 250,273
paris
  • 81

2 Answers2

3

Simple example for generating an index with class memoir:

\documentclass{memoir}
\makeindex

\begin{document}
Hello\index{hello} world\index{world}!

\printindex
\end{document}

Then run LaTeX, makeindex, and LaTeX.

Result (page 3):

Result, page 3

The documentation of class memoir explains the index stuff in section "17.2 Index".

Heiko Oberdiek
  • 271,626
1

As @Heiko Oberdiek pointed out, even if you had everything else working, you did not initiate the index creation with \makeindex, insert and indexed\index{index} term, or use the \printindex command to create the index. Then you still have to go through the process of running LaTeX, makeindex and LaTeX again.

The other problem you may be having is a preamble that is simply too big. I have encountered this problem before on some of the documents I created with a large number of packages and customized styles. The solution was to move the information I did not plan on changing, especially the stylistic information, into a *.sty file. This excellent question has a lot of information about *.sty files. The nice thing is that the coding is the same, you just put all the preamble into another file and include it in your main document—both files are cleaner and work better as a result.

Tavrock
  • 565
  • You don't mean to suggest that having 'too big' a preamble will cause your attempt to index to fail, do you? As for the first paragraph, I think this may work better as a comment. – jon Nov 05 '16 at 03:17
  • I have had documents fail to process because the preamble, especially the style definition changes, exceeded the limit for a *.tex file. That would explain the OP statement of the file not processing at all. – Tavrock Nov 05 '16 at 03:42
  • I'm very surprised to hear that, and I can't help but wonder if it wasn't rather due to some other problems, such as (e.g.) loading packages twice with conflicting options. – jon Nov 05 '16 at 04:07