| 1 |
\ProvidesFile{hypertoc.tex}[2011/01/27 documenting hypertoc.sty] |
| 2 |
\title{\textsf{hypertoc.sty}\\---\\Decent Links |
| 3 |
in Tables of Contents\thanks{This |
| 4 |
document describes version |
| 5 |
\textcolor{blue}{\UseVersionOf{\jobname.sty}} |
| 6 |
of \textsf{\jobname.sty} as of \UseDateOf{\jobname.sty}.}} |
| 7 |
% \listfiles |
| 8 |
{ \RequirePackage{makedoc} \ProcessLineMessage{} |
| 9 |
\MakeJobDoc{18}% %% 2011/01/23 |
| 10 |
{\SectionLevelOneParseInput} } |
| 11 |
\documentclass{article}%% TODO paper dimensions!? |
| 12 |
\input{makedoc.cfg} %% shared formatting settings |
| 13 |
\usepackage{color} %% readprov in makedoc.cfg 2011/01/23 |
| 14 |
\sloppy |
| 15 |
\begin{document} |
| 16 |
\maketitle |
| 17 |
\begin{abstract}\noindent |
| 18 |
'hypertoc.sty' changes macros for the table of contents |
| 19 |
so that colored frames to indicate links look acceptable. |
| 20 |
In the present version, this is achieved by inserting struts |
| 21 |
and only addresses \LaTeX's standard 'article.cls'. |
| 22 |
\end{abstract} |
| 23 |
|
| 24 |
\tableofcontents |
| 25 |
|
| 26 |
\section{Why} |
| 27 |
By default, the 'hyperref' package highlights sectioning titles |
| 28 |
as printed in the table of contents (TOC) by red-framed boxes. |
| 29 |
It looks horrible, because of |
| 30 |
(\textit{i})~the aggressive color and |
| 31 |
(\textit{ii})~the irregular, ``random" shapes of the boxes. |
| 32 |
|
| 33 |
To avoid this, it seems to be standard to use 'hyperref''s |
| 34 |
package option `[colorlinks]'. I don't like this either. |
| 35 |
It is confusing as to how the printed output will look like, |
| 36 |
the chosen color doesn't create a much more pleasant look; |
| 37 |
indeed, the publisher's graphical designer may have chosen |
| 38 |
colors for printing the table of contents---this design |
| 39 |
then is spoiled. |
| 40 |
|
| 41 |
Therefore I prefer (\textit{a})~choosing a more decent color |
| 42 |
and (\textit{b})~using struts so that the boxes have a more |
| 43 |
regular shape. |
| 44 |
|
| 45 |
In a publisher's package I even have found the idea |
| 46 |
to make a box for the entire TOC entry, including the page number. |
| 47 |
Then the frames look regular indeed, and you need less precision |
| 48 |
in moving the mouse for clicking at an entry. |
| 49 |
It would be nice if this could be integrated here later. |
| 50 |
|
| 51 |
\section{Usage} |
| 52 |
The file 'hypertoc.sty' is provided ready, installation only requires |
| 53 |
putting it somewhere where \TeX\ finds it |
| 54 |
(which may need updating the filename data |
| 55 |
base).\urlfoot{ukfaqref}{inst-wlcf} %% 2011/01/27 |
| 56 |
|
| 57 |
Below the `\documentclass' line(s) and above `\begin{document}', |
| 58 |
you load 'hypertoc.sty' (as usually) by |
| 59 |
\begin{verbatim} |
| 60 |
\usepackage{hypertoc} |
| 61 |
\end{verbatim} |
| 62 |
|
| 63 |
This controls the \emph{shapes} of the frames. |
| 64 |
The \emph{color} must be chosen by the 'hyperref' package option |
| 65 |
`[linkbordercolor]', I have used |
| 66 |
\[`linkbordercolor={1 .9 .7},'\] |
| 67 |
---cf.~`makedoc.cfg'. |
| 68 |
|
| 69 |
\section{The Package File} |
| 70 |
The package essentially has just \emph{six} code lines at present. |
| 71 |
|
| 72 |
\input{hypertoc.doc} |
| 73 |
\end{document} |
| 74 |
|
| 75 |
VERSION HISTORY |
| 76 |
|
| 77 |
2011/01/23 for v0.1, very first |
| 78 |
2011/01/24 \ProvidesFile date corrected |
| 79 |
2011/01/27 uses \urlfoot |