[PATCH 1/2] virtio: LaTeX: add dot lines for chapters in the TOC

From
Michael S. Tsirkin <>
Date
2013-11-19T13:56:00+00:00
ID
Thread
[PATCH 1/2] virtio: LaTeX: add dot lines for chapters in the TOC
On Tue, Nov 19, 2013 at 12:06:24PM +0000, Pawel Moll wrote: > ... making them black on the way. >
> Warning! This is a hack and it depends on the hyperref
> package version. >
> Signed-off-by: Pawel Moll <> > ---  I applied this, but one minor nit: Appendix numbers in TOC are now A B C and not Appendix A etc
> I must say this one almost defeated me :-) >
> It's very simple to add the page number (on the right) to the link > (it's just a hyperref option as I mentioned) and I expected to the
> same for the section/chapter numbers (on the left). As it turned
> out it's not something the TOC inventors considered and the level
> when the TOC is being assembled, the leading number is integral
> part of the section name... Thus the "clever" trick (partially
> stolen from people much more clever than me ;-) of patching the
> hyperref package with custom version of the contentsline macro,
> taking advantage of the way macros are defined in TeX to split
> the line into two parts... >
> Note that although it depends on the hyperref package version,
> it should have no negative side effects if they don't match.
> The leading number will simply stay a part of the link then.
> Not something I want to loose more time on ;-) >
>  virtio-v1.0-csd01.tex
7 +++++++
>  1 file changed, 7 insertions(+) >
> diff --git a/virtio-v1.0-csd01.tex b/virtio-v1.0-csd01.tex
> index 96f2b41..b5f8ac4 100644 > --- a/virtio-v1.0-csd01.tex > +++ b/virtio-v1.0-csd01.tex > @@ -36,6 +36,7 @@
>  usepackage{tocloft}
>
enewcommand{cftdot}{
ormalfont.}
>
enewcommand{cftchapdotsep}{4.5} > +usepackage{etoolbox}
>  setmainfont[Mapping=tex-text]{Arial}
>  setromanfont{Arial}
>  setmonofont{Courier New} > @@ -72,5 +73,11 @@
>  	itleformat{paragraph}[hang]{color{oasis1}
ormalfont
ormalsizefseries}{color{oasis1}	heparagraph}{1em}{#1}
>  	itleformat{subparagraph}[hang]{color{oasis1}
ormalfont
ormalsizefseries}{color{oasis1}	hesubparagraph}{1em}{#1} >
> +% hyperref toc hack - do not include the chapter/section number in the link > +makeatletter > +defprocess@contentsline#1#2{#1{#2}hyper@linkstart{link}{Hy@tocdestname}} > +patchcmd{contentsline}{hyper@linkstart{link}{Hy@tocdestname}{#2}}{process@contentsline#2}{}{} > +makeatother > + >  % main document
>  input{main.tex} > --
> 1.8.3.2 >