[OS X TeX] Chapter toc: Right Alignment

Alain Schremmer schremmer.alain at gmail.com
Tue Jul 1 12:16:34 EDT 2014


Here is yet another---unimportant but vexing---problem I can't solve:

(TeXLive-2013, TeXShop 2.47 under 10.5.8 on a PPC.)

1. The strange alignment on the right:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ChapterToc.pdf
Type: application/pdf
Size: 28975 bytes
Desc: not available
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20140701/1ff985fc/attachment.pdf>
-------------- next part --------------



2. The relevant part of the preamble.

	\usepackage[dotinlabels]{titletoc}%a companion to the titlesec  
package which does Chapter Tocs

%===============================================ChapterToc
%This is the construction of the ChapterToc command---which I built by  
trial and error and so do not really understand:

\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]
		\printcontents[chapters]{p-}{1}{}
		\vspace{10mm}
	}%End definition
  %==================================================================

Hopeful regards
--schremmer



More information about the MacOSX-TeX mailing list