From: ben Date: Sat, 1 Aug 2015 17:19:20 +0000 (+0200) Subject: Improve the index rendering with a smaller font and compact items X-Git-Tag: edition-2015-10-10~361^2~3 X-Git-Url: https://pere.pagekite.me/gitweb/text-free-culture-lessig.git/commitdiff_plain/99f0d8d08f1abdfefb078bcba001d8705d82f5c7?ds=inline;hp=-c Improve the index rendering with a smaller font and compact items --- 99f0d8d08f1abdfefb078bcba001d8705d82f5c7 diff --git a/myclass.cls b/myclass.cls index 3723fdc..985da17 100644 --- a/myclass.cls +++ b/myclass.cls @@ -21,13 +21,22 @@ \let\setcounter\stdsetcounter } +% Divide by 2 the index item indentation (10pt -> 5pt) +\makeatletter +\renewcommand\@idxitem{\par\hangindent 20\p@} +\renewcommand\subitem{\@idxitem \hspace*{10\p@}} +\renewcommand\subsubitem{\@idxitem \hspace*{15\p@}} +\makeatother + % Put the index in the TOC \makeatletter \let\stdindex=\theindex \let\endstdindex=\endtheindex \renewenvironment{theindex}{ - \newfontfamily\indexfont[Scale=0.5]{DejaVu Serif} \begin{stdindex} + % Use a smaller font except for the letter heading which is bold + \newfontfamily\indexfont[Scale=0.7, + BoldFeatures={Scale=1}]{Crimson Text} \@ifundefined{chapter}{}{ % To not have the number, replace by: % \addcontentsline{toc}{chapter}{\numberline{}\indexname} @@ -42,6 +51,9 @@ \addcontentsline{toc}{chapter}{\indexname} \fi } + % Adapt the vertical sizes to the smaller font + \setlength{\baselineskip}{0.7\baselineskip}% + \setlength{\parskip}{0.2\baselineskip}% \indexfont }{ \end{stdindex}