I use the following command below to make my list of nomenclature to look like the list of contents, but I am a bit disturbed by the fact that the dots between the text belonging to a symbol in the list and the page on which to find the definition is aligned to the left, and not to the right as they seem to be in the table of contents. The question is thus if it is possible to modify the script below, or a dotfill command in general, to align the dots to the right instead of to the left, which seems to be default.
\makeatletter
\newcommand \Dotfill {\leavevmode \cleaders \hb@xt@ .75em{\hss .\hss }\hfill \kern \z@}
\makeatother
\usepackage[refpage, noprefix]{nomencl}
\renewcommand*{\pagedeclaration}[1]{\unskip\Dotfill \makebox[6mm][r]{\hyperpage{#1}}}
My list of nomenclature now looks like this (I added the green line to make it easier too se that the points are aligned to the left):
Best Answer
\leaders
If you need vertically aligned dots, then you need
\leaders
. It is also used by\@dottedtocline
from the table of contents. There is a kind of invisible fixed grid of leader boxes (horizontal positions are fixed) and\leaders
select the boxes whose width fits entirely in the wanted space.\cleaders
The leader boxes are tightly packed in the middle of the space, available space (smaller than the width of a leader box) is distributed at the left and right side. Example from "The TeXbook" with leader box of width
10pt
and the available space of56pt
:\xleaders
The "extensible" leaders divides the available space in as many slots as possible and the leader boxes are put horizontally centered inside the slots. Example from "The TeXbook" with leader box of width
10pt
and the available space of56pt
:\xleader
to another.Summary
If vertical alignment is needed (table of contents, nomenclature, ...), then
\leaders
is the right command.