[OS X TeX] Re: Mini Toc

Alain Schremmer schremmer.alain at gmail.com
Fri Jul 17 17:56:55 CEST 2009


I have now been using titletoc for a good while and it was worth the  
hassle as it makes my life a lot easier because I move stuff a lot.

However, I am discovering that I do have, after all, some  
typographical sensitivities: while the left side of the chapter toc  
is at the left margin, the right side of the chapter toc is both  
ragged and at least half an inch short of the right margin.

I was so happy to get it to work that I thought I surely could live  
with that. But now it is beginning to bother me a bit. However, I  
can't figure out from

http://www.tex.ac.uk/tex-archive/macros/latex/contrib/titlesec/ 
titlesec.pdf ,

starting on page 17, what, if anything, controls the right margin.  
(Indeed, as the author warns, "this is not a package for the casual  
user")

Each (included) chapter starts with

	\chapter{Whatever}
	\ChapterToc%defined in the preamble below

Hopeful regards
--schremmer


%=========================================
\titlecontents{chapter}%Type of sectioning command is CHAPTER
	[6pc]%Indentation from the left margin. NOT AN OPTIONAL ARGUMENT
	{%begin code to be executed before entry is typeset
		\addvspace{1pc}%Vertical space
		\bfseries%Affects the title
%		\titlerule[2pt]
		\filright%
	}%end code to be executed before entry is typeset
	{%begin format numbered entries---in horizontal mode
		\contentslabel%The number of the entry
		[%
			\chaptername%
			\ %this slash puts a space between Chapter and number
			\thecontentslabel%
		]%
		{6pc}%Space between entry number and entry title
	}%end format numbered entries---in horizontal mode
	{%begin format numberless entries---in horizontal mode
	}%end format numberless entries---in horizontal mode
	{%begin dotted line and page number
		\hfill%
		\contentspage%
	}%end  dotted line and page number
	[%
	\addvspace{2pt}%Vertical space between entry and list of subentries
	]%

\newcommand\xquad
{\hspace{0.4em plus .2em minus .2em}}

\titlecontents*{p-section}%Type of sectioning command is SECTION
	[0pt]%Indentation from the left margin. NOT AN OPTIONAL ARGUMENT
	{%begin code to be executed before entry is typeset
		\filright%
		\small
	}%end code to be executed before entry is typeset
	{%begin format numbered entries---in horizontal mode
	}%end format numberless entries---in horizontal mode
	{%begin format numberless entries---in horizontal mode
	}%end format numberless entries---in horizontal mode
	{%begin dotted line and page number
	, %~%this tilde puts a space after the comma
	\thecontentspage
	}%end dotted line and page number
	[%begin
	\xquad%
	--
	\xquad
	]%end
	[%begin
	.
	]%end
%	[%begin
%	]%end

\newcommand{\ChapterToc}%
	{%Begin definition
		\startcontents[chapters]%Indicates where the chapter toc is to start
		\printcontents[chapters]{p-}{1}{}%Prints the chapter toc
		\vspace{10mm}
	}%End definition
%=========================================




More information about the macostex-archives mailing list