XeTeXWeird ToC formatting error.

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
Post Reply
User avatar
skanda
Posts: 28
Joined: Sat May 16, 2009 6:32 pm

Weird ToC formatting error.

Post by skanda »

Hello Forum,
Hope you are all having a great Christmas vacation!

I use XeLaTeX and Octavo for typesetting my report.

I decided to use the titletoc package for styling my ToC. For my short timeframe., I ended up looking for a readymade example to use from either this, or some other TeX-y forums.

After a lot of searches, I found this example in a rather obscure discussion within the tex.stackexchange forum:

Code: Select all

\titlecontents{chapter}[0pt]
{\vskip15pt\llap{\makebox[2.5em]{\oldstylenums{\thecontentspage\hfill\thecontentslabel}}\hskip1em}
  \Large\vskip-\baselineskip}{}{}{}
\titlecontents*{section}[22pt]
{\upshape}{}{}
{, \oldstylenums{\thecontentspage}}[][\ \textbullet\ ][]
This was successful in producing a ToC, but like so:
Image
The image will last for 2-3 days tops. The link will expire afterwards. Apologies:
83 Here is one Chapter

97

/*------New---------Page------------Starts---------*/
Chapter Title is placed here
Section, 99 * Section, 100 * Section, 101
(*) nbsp is not working, so I am unable to add spaces. Sorry.
I must confess that I have not used titlesec in a long while, and I am currently reading up the memoir class documentation as well as the titlesec documentation to come back to speed. Meanwhile, this working example has kept me going (sort of)

Now here is my question, is there any way to force the page numbers and the ToC to line up together?

If people need a working example with lengthy ToC, I might try to cook up a lipsum one for your sandbox. Please let me know if you need one.

one more Question: Is there a way to move the page numbers to the right side, rather than the left side the way it is?

Best,
Skanda.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Weird ToC formatting error.

Post by Stefan Kottwitz »

Hi Skanda,
skanda wrote:The image will last for 2-3 days tops. The link will expire afterwards.
indeed, I did not see the image and it's gone. Next time just upload the image to the forum: click "Upload attachment" below the edit text field when writing.
skanda wrote:(*) nbsp is not working, so I am unable to add spaces. Sorry.
You coud use a code environment which is aware of spaces, note the Code button above the edit field.
skanda wrote:If people need a working example with lengthy ToC, I might try to cook up a lipsum one for your sandbox. Please let me know if you need one.
A code example, especially a complete (but short) compilable one which demonstrates a problem, is usually a guarantee to get a solution. Once a problem can be verified, it's nearly solved for an experienced user.

Stefan
LaTeX.org admin
Post Reply