MakeIndex, Nomenclature, Glossaries and AcronymsIndex of Subjects and Symbols

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
Post Reply
melekzedek
Posts: 34
Joined: Sat Aug 08, 2009 1:05 pm

Index of Subjects and Symbols

Post by melekzedek »

Hello TeXnians,

I'm writing a book and need to make a subject index and a symbol index similar to the following one
Screen Shot 2013-11-20 at 20.28.30.png
Screen Shot 2013-11-20 at 20.28.30.png (54.64 KiB) Viewed 15535 times
The problem is that I tried to find some package to do this and I couldn't find. I'm using multind, but it is to old and the symbol index is very bad.

Can anyone help me with a minimal working example?

thank you in advance
Last edited by localghost on Thu Nov 21, 2013 8:04 pm, edited 2 times in total.
Using Ubuntu 13.10 under the hood and LaTeXing via Vim-LaTeX
ウンベルト

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Index of Subjects and Symbols

Post by localghost »

What about imakeidx or splitindex? Both support multiple indexes.


Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
melekzedek
Posts: 34
Joined: Sat Aug 08, 2009 1:05 pm

Re: Index of Subjects and Symbols

Post by melekzedek »

I tried to read the package documentation of both packags, but I was not able to find what I was looking for. I will give another look carefuly.

Thanks for the anwser
Using Ubuntu 13.10 under the hood and LaTeXing via Vim-LaTeX
ウンベルト
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Index of Subjects and Symbols

Post by localghost »

melekzedek wrote:[…] I will give another look carefuly. […]
Good decision. Take your time to read the manual for the package of your choice. The examples will give you a good starting point.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
melekzedek
Posts: 34
Joined: Sat Aug 08, 2009 1:05 pm

Index of Subjects and Symbols

Post by melekzedek »

I think what I want is not a feature in any package. Therefore it is necessary to tweak with some existing packages. I'll try to do the following, to obtain the end result that I want in the symbol index (if anyone knows how to do each step, please let me know):
  • I need to define multiple indexes, each based on the specific topic (e.g. Operators, Set theory, etc), I guess makeindex is sufficient for this purpose.
  • I need to print all the indexes in a continuous way, switching off the new page in each print index.
If I obtain the end result, I will let you know.

Thanks for the quick answer.
Using Ubuntu 13.10 under the hood and LaTeXing via Vim-LaTeX
ウンベルト
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Index of Subjects and Symbols

Post by localghost »

The proposed packages definitely support multiple indexes. MakeIndex alone does not.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

Index of Subjects and Symbols

Post by nlct »

You ought to mention when you crosspost. I've posted a reply to your question on TeX on StackExchange:

You can use glossaries to do this. I assume you either want to sort your symbols according to definition or to usage since symbols are difficult to sort alphabetically (and your sample isn't alphabetically sorted). With glossaries you can use the package option sort=def to sort in order of definition or sort=use to sort according to usage. In the example below, I've used sort=def (change \setglossarystyle to \glossarystyle if you are using a version of glossaries prior to version 4.0):

Code: Select all

\documentclass{report}

\usepackage{amsfonts}
\usepackage[nomain,section,sort=def]{glossaries}
\usepackage{glossary-mcols}

% (Pre glossaries v4.0 requires \glossarystyle rather than
% \setglossarystyle)
\setglossarystyle{mcolindex}
\renewcommand{\glspostdescription}{\dotfill}

\newglossary[op-glg]{operators}{op-gls}{op-glo}{Operators}
\newglossary[cn-glg]{constants}{cn-gls}{cn-glo}{Constants}

\makeglossaries

% Define a command to define operators
% Syntax: \newoperator[options]{label}{operator symbol}

\newcommand*{\newoperator}[3][]{%
  \newglossaryentry{#2}{type=operators,%
    name={$#3$},text={#3},description={},#1}%
}

% Similarly for constants

\newcommand*{\newconstant}[3][]{%
  \newglossaryentry{#2}{type=constants,%
    name={$#3$},text={#3},description={},#1}%
}

% Define operators

\newoperator{Mop}{\mathcal{M}}
\newoperator{Aalpha}{A_\alpha}
\newoperator{nablaOmega}{\nabla_\Omega}
\newoperator{T}{T}
\newoperator{I2}{I_2}
\newoperator{Jz}{J_z}
\newoperator{Gz}{G_z}

% Define constants

\newconstant{pdash}{p'}
\newconstant{jnu}{j_\nu}
\newconstant{Mcn}{\mathfrak{M}}
\newconstant{Dpq}{D_{p,q}}

\begin{document}
\chapter{Sample Chapter}

Some sample usage of constants:
\[
 \gls{pdash}, \gls{Mcn}, \gls{jnu}
\]

Some sample usage of operators:
\[
  \gls{Mop}, \gls{Aalpha}, \gls{nablaOmega}
\]

\newpage

More sample usage:
\[
\gls{T}, \gls{I2}, \gls{Jz}, \gls{Gz},
\gls{Mcn}, \gls{Dpq}, \gls{jnu}
\]

\chapter*{Index}

\printglossaries
\end{document}
In order to build the PDF you need to do:
  1. Run pdflatex
  2. Run makeglossaries
  3. Run pdflatex
The above example produces:

Page 1:
page3.png
page3.png (14.91 KiB) Viewed 13936 times
Page 2:
page2.png
page2.png (5.54 KiB) Viewed 13936 times
Page 3:
page1.png
page1.png (18.19 KiB) Viewed 13936 times
In your example image, you have some lines with multiple entries (for example, c, c_1, c_2[, \ldots, v_n). There are various ways to deal with these. You could designate the first in the list (e.g, c) as the main parent entry, and the remainder as sub-entries, and then define a glossary style that puts the sub-entry names after the parent entry name, but this will complicate the location list. However, I think the easiest solution is probably to define an entry with the specified list and then use \glsdisp or \glslink whenever you use it.

For example:

Code: Select all

\newconstant{c}{c, c_1, c_2, \ldots, v_n}
Then in the document:

Code: Select all

In-line: $\glslink{c}{c}$ or $\glslink{c}{c_1}$ or $\glslink{c}{c_2}$ etc.
Regards
Nicola Talbot
Last edited by Stefan Kottwitz on Fri Jan 08, 2016 12:50 pm, edited 1 time in total.
Post Reply