Text FormattingTable of contents problem

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
anurag1fundoo
Posts: 8
Joined: Thu Oct 13, 2011 2:23 am

Table of contents problem

Post by anurag1fundoo »

Hi,

I am trying to modify my table of contents to produce Bold face heading for section (or chapter heading) headings but not for subsection headings. Also, I want to introduce dots after each subsection heading till the page number to the right. Now, following is my preamble which generates dotted lines but not the boldface chapter or section headings which I want. Instead it generates everything in same font with dots. Could anyone please help me with this ? thanks.

Code: Select all

\documentclass[letterpaper,11pt]{article}
\usepackage{graphicx,subfigure}
\usepackage{amssymb}
\usepackage{enumerate}
\usepackage{upgreek}
\usepackage{float}
\usepackage[bf]{caption}
\usepackage{fullpage}
\usepackage{verbatim}
\usepackage{cite}
\usepackage{tocstyle}
\usepackage{microtype}
\renewcommand{\contentsname}{Table of Contents}

\setlength{\parskip}{1ex}
\parindent 0in
Last edited by Stefan Kottwitz on Sun Jan 22, 2012 12:01 am, edited 1 time in total.

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

Table of contents problem

Post by Stefan Kottwitz »

Hi,

if you don't load tocstyle, by removing this line

Code: Select all

\usepackage{tocstyle}
you would get bold section entries and dots for the subsection entries.

Stefan
LaTeX.org admin
anurag1fundoo
Posts: 8
Joined: Thu Oct 13, 2011 2:23 am

Re: Table of contents problem

Post by anurag1fundoo »

If I don't load tocstyle package then I get this error.

! Undefined control sequence.
l.3 \tocstyle@set@width
{unum}{toc}{}{19.46669pt}
?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Table of contents problem

Post by Stefan Kottwitz »

Compile another time, this should be caused by the .toc file which would be overwritten if you finished the first compiler run.

Or delete the .toc file, and compile again, two times.

Stefan
LaTeX.org admin
anurag1fundoo
Posts: 8
Joined: Thu Oct 13, 2011 2:23 am

Re: Table of contents problem

Post by anurag1fundoo »

Did the compilation but each time it gives the same error.

I also deleted the .toc file and tried compiling it. still same problem.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Table of contents problem

Post by Stefan Kottwitz »

Then remove the .aux file too, as there can still be the old tocstyle commands, and compile.

Stefan
LaTeX.org admin
anurag1fundoo
Posts: 8
Joined: Thu Oct 13, 2011 2:23 am

Re: Table of contents problem

Post by anurag1fundoo »

Thank you so much Stefan. It works now.
anurag1fundoo
Posts: 8
Joined: Thu Oct 13, 2011 2:23 am

Re: Table of contents problem

Post by anurag1fundoo »

I don't know how to close this post or let the users know that this post has already been taken care of. I request the moderators to please mark this post as read to benefit other users.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Table of contents problem

Post by Stefan Kottwitz »

Hi,

nice to see that you take care of proper marking as solved! This helps us to see the still open questions.

You almost made it the right way, choosing the checkmark as topic icon - but it's the icon of the first post, the question, which matters.

Just edit your first post in this thread (the question) and choose the checkmark symbol as topic icon.

Thanks!

Stefan
LaTeX.org admin
Post Reply