Text FormattingBold symbol in a title but normal in the table fof contents

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Clement-Justin
Posts: 2
Joined: Fri Aug 10, 2012 9:25 pm

Bold symbol in a title but normal in the table fof contents

Post by Clement-Justin »

Hi,

I would like to know if it is possible to get a bold mathematical symbol in a section title but that looks normal in the table of contents. Here is my code :

Code: Select all

    \documentclass{11pt, a4, article}

    \usepackage[utf8]{inputenc}
    \usepackage[french]{babel}
    \usepackage{amsmath}
    \usepackage{amsfonts}
    \usepackage{amssymb}
    \usepackage{graphicx}
    \usepackage[T1]{fontenc}
    \usepackage[babel=true]{csquotes}
    \usepackage{tabularx}
    \usepackage{multirow}
    \usepackage{psfrag}
    \usepackage{sistyle}
    \usepackage{eurosym}
    \usepackage[table]{xcolor}
    \usepackage{feynmp}

    \begin{document}

        \tableofcontents
        \section{$\boldsymbol{\gamma}-ray detection}

    \end{document}
And what comes out is bold symbol \gamma in the section title and a bold symbol \gamma in the table of contents. The problem is that I tried to have a bold symbol in the section title because the section title is normal by default. But now there is 'formate conflict' in the table of contents...

Tell me if it is not clear !
Last edited by Stefan Kottwitz on Sat Aug 11, 2012 1:12 pm, edited 2 times 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

Bold symbol in a title but normal in the table fof contents

Post by Stefan Kottwitz »

Hi Clement-Justin,

welcome to the board!

It's very good that you posted a complete example. If I see that, I'll always test it to find a solution!

Some additional tips:
  • Test your own example. The code above has errors, it cannot work.
  • Try to keep it minimal. You could remove irrelevant packages.
  • The best way is usually to create the example from a copy of your problematic document, reduced as much as possible - it's often better than to create a new, different example.
The solution here is to use the optional argument of the \section command: the optional argument, which is in square brackets, goes to the table of contents. The mandatory argument, which is in curly braces, goes to the text, and only to the table of contents if there's no optional argument given. The Infominimal working example:

Code: Select all

\documentclass[11pt, a4]{article}
\usepackage{amsmath}
\begin{document}
\tableofcontents
\section[$\gamma$-ray detection]{$\boldsymbol{\gamma}$-ray detection}
\end{document}
Stefan
LaTeX.org admin
Clement-Justin
Posts: 2
Joined: Fri Aug 10, 2012 9:25 pm

Re: Bold symbol in a title but normal in the table fof conte

Post by Clement-Justin »

Well, thank you very much, I did'nt know that the \section function had optional parameters!

See you!
Post Reply