Text FormattingItalicising entries in content page

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
-Z-MAN
Posts: 3
Joined: Mon May 03, 2010 1:38 am

Italicising entries in content page

Post by -Z-MAN »

Hi all,

I'm new to these forums, and fairly new to LaTeX and thus, experiencing some problems. So far, I've been able to solve pretty much any problem, except for what I am now going to describe! I've searched these forums and elsewhere, but to no avail. If the solution was in front of my eyes the whole time, then I apologise for taking your time.

Basically, I want to italicise the 3rd-level entries on my table of contents. So the chapter (X) appears normal, the section (X.X) appears normal, but the subsection (X.X.X) needs to be in italic. I want this to be the case in my contents only, and not anywhere else in the doc. Any suggestions? Thank you in advance.
Last edited by -Z-MAN on Thu May 06, 2010 4:12 pm, 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.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Italicising entries in content page

Post by gmedina »

Hi,

the tocloft package can do the job; a little example:

Code: Select all

\documentclass{book}
\usepackage{tocloft}

\renewcommand\cftsubsecfont{\itshape}

\begin{document}
\tableofcontents

\chapter{Test chapter one}
\section{Test section one one}
\subsection{Test subsection one one one}
\subsection{Test subsection one one two}
\section{Test section one two}
\subsection{Test subsection one two one}
\chapter{Test chapter two}
\section{Test section two one}
\subsection{Test subsection two one one}

\end{document}
You forgot to mention the document class used; the proposed solution might not work if you are using, for example, one of the AMS document classes. If this is the case, let us know.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
-Z-MAN
Posts: 3
Joined: Mon May 03, 2010 1:38 am

Re: Italicising entries in content page

Post by -Z-MAN »

Wow, what a quick response! Sorry, the document class is report. I just tested this and it works perfect. Thank you very much.

On another note, to what extent is LaTeX used beyond academia? I enjoy using it and love the output LaTeX gives, but have nearly finished my report so I can't see where or when I would be using this again...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Italicising entries in content page

Post by localghost »

-Z-MAN wrote:[...] On another note, to what extent is LaTeX used beyond academia? I enjoy using it and love the output LaTeX gives, but have nearly finished my report so I can't see where or when I would be using this again [...]
There's almost no document leaving my machine that isn't done with LaTeX (application, CV, letter, ...). Some inspiration might come from the TeX Catalogue [1]. It lists many classes and packages that help you to prepare documents beyond science.

As soon as your problem is solved, lease mark the topic accordingly by editing your initial post and choosing the green checkmark from the icon list.

[1] The TeX Catalogue Online, Topic Index


Best regards and welcome to the board
Thorsten
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Italicising entries in content page

Post by gmedina »

-Z-MAN wrote:...On another note, to what extent is LaTeX used beyond academia? I enjoy using it and love the output LaTeX gives, but have nearly finished my report so I can't see where or when I would be using this again...
Just like localghost, I write everything (academic or not) using LaTeX. For a nice collection of Humanities books typeset with TeX, you can take a look at this site:

http://www.tsengbooks.com/
1,1,2,3,5,8,13,21,34,55,89,144,233,...
-Z-MAN
Posts: 3
Joined: Mon May 03, 2010 1:38 am

Re: Italicising entries in content page

Post by -Z-MAN »

Thank you both for the help and welcome. I'll check the links out.
Post Reply