LyX ⇒ Customizing an index with Lyx
-
- Posts: 4
- Joined: Sat Apr 06, 2013 12:28 am
Customizing an index with Lyx
Is there an easy way to alter the layout of the index when using Lyx? I just want to change the number of columns from 2 to 3. Thanks!
NEW: TikZ book now 40% off at Amazon.com for a short time.

Customizing an index with Lyx
Hi techwriter,
Welcome to the LaTeX community.
It is actually quite easy with the imakeidx package by Enrico Gregorio. Just add
to the document preamble (via Document > Settings > LaTeX preamble).
Regards
Welcome to the LaTeX community.
It is actually quite easy with the imakeidx package by Enrico Gregorio. Just add
Code: Select all
\usepackage{imakeidx}
\makeindex[columns=3]
Regards
site moderator & package author
-
- Posts: 4
- Joined: Sat Apr 06, 2013 12:28 am
Re: Customizing an index with Lyx
Wow, thank you! I used your example code, and it worked.
I noticed that Lyx was originally willing to start the index on an even-numbered page (the left side of a book), but after using imakeidx, it will insert a blank page so that the index starts on an odd-numbered page. Is there any way to disable the page insertion? Thanks again.
I noticed that Lyx was originally willing to start the index on an even-numbered page (the left side of a book), but after using imakeidx, it will insert a blank page so that the index starts on an odd-numbered page. Is there any way to disable the page insertion? Thanks again.
Customizing an index with Lyx
Yes: addtechwriter wrote:I noticed that Lyx was originally willing to start the index on an even-numbered page (the left side of a book), but after using imakeidx, it will insert a blank page so that the index starts on an odd-numbered page. Is there any way to disable the page insertion?
\indexsetup{noclearpage}
after \usepackage{imakeidx}
. You may want to have a look at the 
Regards
site moderator & package author
-
- Posts: 4
- Joined: Sat Apr 06, 2013 12:28 am
Customizing an index with Lyx
I inserted the \indexsetup{noclearpage} command, so that part of the preamble looks like this:
But the program still inserts a page after the appendix and then prints the index (I have only 1 index). The "noclearpage" setting didn't seem to have any effect. Perhaps I am doing something wrong?
Code: Select all
\usepackage{imakeidx}
\makeindex[columns=3]
\indexsetup{noclearpage}
Customizing an index with Lyx
Difficult to say... perhaps you can attach a sample document which shows this behaviour?techwriter wrote:[...] the program still inserts a page after the appendix and then prints the index (I have only 1 index). The "noclearpage" setting didn't seem to have any effect. Perhaps I am doing something wrong?
Regards
site moderator & package author
-
- Posts: 4
- Joined: Sat Apr 06, 2013 12:28 am
Customizing an index with Lyx
I created a sample document and just copied the source. The sample has three pages of text and then an index. A blank page is inserted before the index despite the use of "noclearpage."
Sorry about all of the commands at the beginning of the sample, but I thought one of them might be causing the problem, so I included them.
Code: Select all
\RequirePackage{fix-cm}
\documentclass[12pt,english]{book}
\usepackage{fourier}
\usepackage{helvet}
\renewcommand{\ttdefault}{cmtt}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=0.5in,bmargin=0.5in,lmargin=0.5in,rmargin=0.5in}
\setcounter{secnumdepth}{5}
\setlength{\parskip}{\bigskipamount}
\setlength{\parindent}{0pt}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{makeidx}
\makeindex
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\usepackage{enumitem} % customizable list environments
\newlength{\lyxlabelwidth} % auxiliary length
\numberwithin{table}{section}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{imakeidx}
\makeindex[columns=3]
\indexsetup{noclearpage}
\makeatother
\usepackage{babel}
\begin{document}
blah\index{blah}
\newpage{}
halb
\newpage{}
halb
\printindex{}
\end{document}