Text FormattingCustom toc entry

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
bgeorge
Posts: 7
Joined: Thu Oct 29, 2009 2:13 pm

Custom toc entry

Post by bgeorge »

Hi all,

I'll try and explain my problem. I'm creating a document, and in this I'd like to have headings that have math mode symbols. I've found that I have to use the {\bf } environment to ensure that they appear bold in the document section headers, for example:

Code: Select all

\section{$^{{\bf 99}} {\bf Tc}^{\bf m}$}
The problem is that this creates bold text in the table of contents.

I know that you can use the \section*{} command to stop entries appearing in the toc and then use \addtocontents{} to add a custom entry (without the bold type), but this stops the section being numbered in the document (which I would like).

What is the best way to solve this issue?

Thanks,

Ben George.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Custom toc entry

Post by Stefan Kottwitz »

Hi Ben,

welcome to the board!
You could use the optional parameter of \section:

Code: Select all

\section[text for toc]{text for document}
Btw. \bf is obsolete, use \textbf{text} or \bfseries instead, see LaTeX2e font selection.

Stefan
LaTeX.org admin
bgeorge
Posts: 7
Joined: Thu Oct 29, 2009 2:13 pm

Re: Custom toc entry

Post by bgeorge »

Thank you, that is perfect. Such a simple solution, surprised I haven't come across it before.

Ben
Post Reply