Skip to main content
Share Your Experience: Take the 2024 Developer Survey
16 votes
Accepted

Is it possible to index an exclamation point?

The characters !, @, and | need to be escaped in an indexing context. For makeindex to understand you mean to mention them rather than use them, you must 'quote' them with a ". The following should do ...
jon's user avatar
  • 22.4k
15 votes
Accepted

Use xindy to sort by bible book instead of ABC – or: How to add custom letter groups?

The easiest solution is to use Klingon: change the line \makeindex[options = -M index-style -C utf8] in your TeX file to \makeindex[options = -M index-style -C utf8 -L klingon] This produces a PDF ...
ShreevatsaR's user avatar
  • 45.6k
13 votes
Accepted

Can I introduce a special environment which will reappear at the end?

Minimal changes from my answer at Collect the input of all \TODO commands used in the document at the end. I called the stuff "cross-refs" only because that was a tag in your question. You can call ...
Steven B. Segletes's user avatar
13 votes
Accepted

Example of contentsline

If you want to add a specific entry to your ToC at the chapter level, you should use \addcontentsline{toc}{chapter}{Prefazione} in your example. The page will be the current page (so the page this ...
Skillmon's user avatar
  • 61k
12 votes
Accepted

How to generate an automatic index (concordance) in a large file?

The output file should look like this: http://www.gurt-der-wahrheit.org/files/konkordanz_schlachter_1951_A4.pdf Sure, it is possible. How about this? The complete concordance, of which the above is ...
ShreevatsaR's user avatar
  • 45.6k
12 votes
Accepted

Indexing in partial decimal order, Luke 10:25 after Luke 1:5

\documentclass{article} \usepackage{imakeidx} \makeindex \newcommand\bindex[3]{\index{#1:\string\number\string\numexpr\the\numexpr1000+#2\relax-1000:\string\number\string\numexpr\the\numexpr1000+#3\...
David Carlisle's user avatar
11 votes

Suppressing comma in one index entry

Interesting question! \documentclass{book} \usepackage{imakeidx} \makeindex \newrobustcmd{\invertcomma}[2]{#2#1} \begin{document} Flamingo's ``knee''\index{flamingosknee@flamingo's ``knee\...
egreg's user avatar
  • 1.1m
11 votes
Accepted

How to determine how much "save space" I am using

How do I determine how much save space was used form the log file? At the end of the log file: 87i,19n,130p,10511b,4441s stack positions out of 5000i,500n,10000p,200000b,80000s it is the fifth ...
Heiko Oberdiek's user avatar
11 votes

Problem with indices in the Polish language

You can't do it with makeindex because it cannot sort correctly other languages than English. Change to xindy. Also polski is not compatible with LuaLaTeX, use babel. Run with -shell-escape enabled, ...
egreg's user avatar
  • 1.1m
9 votes

How to say to latexmk to use makeindex with special parameter (-s -g)

In the latexmk manual [1, page 26], there is a configuration variable which can change the makeindex-command: $makeindex ["makeindex %O -o %D %S"] The indexprocessing program. The value in ...
Markus's user avatar
  • 450
9 votes

Example of contentsline

The \contentsline macro should never be used directly in a document. It's LaTeX's duty to write such macro with the appropriate arguments in the .toc file or other auxiliary files for the various ...
egreg's user avatar
  • 1.1m
9 votes
Accepted

TikZ: Get colour from an array and use it for drawing

As suggested, using the array functionality of TikZ you can get: \documentclass{standalone} \usepackage{tikz} %\usepackage{arrayjob} %\newarray\colours %\readarray{colours}{red&orange&yellow&...
vi pa's user avatar
  • 3,404
8 votes

Can I introduce a special environment which will reappear at the end?

Several variations are possible, but here's a start. \documentclass{article} \usepackage{environ} \usepackage{lipsum} % just for the example \newcounter{repeatatend} \makeatletter \def\repeat@at@...
egreg's user avatar
  • 1.1m
8 votes
Accepted

How to use different formatting for multiple indices with imakeidx and .ist files?

Ok, I think I've found the answer. My thanks go to Gilu, whose info led me to the following solution. Here is the MWE (a little expanded to better see how it works). \documentclass[openany]{book} \...
niesen's user avatar
  • 251
8 votes
Accepted

Using a parameter reference as the optional argument of a macro

This kind of “self-reference” is easy to obtain with xparse: \documentclass{article} \usepackage{xparse} \usepackage{imakeidx} \NewDocumentCommand{\Index}{O{#2}m}{% \textit{#1}\index{#2@#1}% } \...
egreg's user avatar
  • 1.1m
8 votes
Accepted

\DeclareSourceMap does not work

There are two issues here. Non-empty fields are not overwritten unless overwrite is explicitly specified. (Empty fields are fine, though, this'll come in handy soon.) You probably do not want to ...
moewe's user avatar
  • 177k
8 votes
Accepted

Equations: Why does formula symbol index notation "ff" cause such big letter spacing?

You can make this italic—but use \mathit{eff}. Never use the default math italic for multi-letter identifiers. That is designed to make adjacent letters look like a product of variables, not a word. ...
David Carlisle's user avatar
7 votes
Accepted

Printing index in 2 columns with starting letter before every section

Just add the starting lines exactly like in the following example: %%%% A simple MakeIndex style \begin{filecontents*}{\jobname.mst} headings_flag 1 heading_prefix "{\\textbf{" heading_suffix "}}\\...
egreg's user avatar
  • 1.1m
7 votes
Accepted

How to put $!$ into index

The character ! is special for Xindy and MakeIndex: it serves for making subindex entries (unless modified with a style file for those programs). In index context " is the escape char so use \index{*...
daleif's user avatar
  • 54.9k
7 votes
Accepted

Explain like I'm five: "see" index entries

First the easy part: \indexentry should never be used in a document; it's not generally defined and is only used for writing to the .idx file that makeindex will convert to an .ind file that LaTeX can ...
egreg's user avatar
  • 1.1m
7 votes

How to determine how much "save space" I am using

The save stack usage is shown in the line 87i,19n,130p,10511b,4441s stack positions out of 5000i,500n,10000p,200000b,80000s so 4441 in this case. the TeXBook says You can figure out what TeX ...
David Carlisle's user avatar
7 votes
Accepted

newcommand for index inserts unwanted spaces when using {}

LaTeX's \index reads its argument as a verbatim argument to prevent the expansion of commands. If \index is used in the argument of another macro, then the argument of \index is already read and the ...
Heiko Oberdiek's user avatar
7 votes
Accepted

Highlighting a page in an index

On your main page: \index[Persone]{My Entry|textbf} will print the page number in the index in bold, whereas on other pages \index[Persone]{My Entry} will print a normal page number.
Peter Wilson's user avatar
  • 28.2k
6 votes
Accepted

babel and index both redefine \markboth and \markright

Edit 2023 In the meantime the LaTeX kernel has changed the \markboth and \markright command (to support extended mark options). That means that the check from index.sty fails regarding in any case, ...
Ulrike Fischer's user avatar
6 votes

Make a Index for a report

I suggest making it with xindy, which has the advantage to understand utf8 if you have accented letters. Loading the imakeidx package, you obtain the index in one compilation. You need two commands: ...
Bernard's user avatar
  • 272k
6 votes
Accepted

What is the recommended indexing package?

There's no 'best'. Really, the best choice is the one which enables you to work most efficiently and effectively. Which this is depends on your specific needs - not just languages, but encodings, ...
cfr's user avatar
  • 202k
6 votes
Accepted

Change index "see also" and "see" format

SECOND EDIT (I don't know what is the usual practice. I have left the initial answer and edit at the bottom and the new one here at the start). To fullfill all the requirements, instead of ...
Raoul Kessels's user avatar
6 votes
Accepted

How create multiple indices with imakeidx?

You get a warning: Package imakeidx Warning: Remember to run (pdf)latex again after calling (imakeidx) `splitindex' and processing the indices. which tells you exactly what you need ...
egreg's user avatar
  • 1.1m
6 votes
Accepted

How get hyperref to make entire index entry a link?

No, hyperref does not have an option to make index terms to links. A link can only have one target. But it is quite common that index terms can have more than one page.
Heiko Oberdiek's user avatar
6 votes
Accepted

printindex and tikzexternalize won't create a pdf-file for the tikz-image

The externalize library redefines \makeindex and related commands in a way that's incompatible with imakeidx. You can fix the wrong definitions by changing them (to be no-op, of course) in the ...
egreg's user avatar
  • 1.1m

Only top scored, non community-wiki answers of a minimum length are eligible