In a report that I am co-authoring, we have sections, subsections and
subsubsections. We also have a table of contents which we include after
the abstract with the \tableofcontents command. The style of the
section titles that appear in the table of contents gives boldface
titles for sections but no boldface for subsections and subsubsections.
This is the way I like it. In the body of the report, all section,
subsection, and subsubsection titles are in boldface. Again, this is good.
Now, here is the problem. The math (in math mode) in the section titles
does NOT appear in boldface. The usual workaround is to put the math
inside a \boldsymbol{...}, which certainly does the trick. But then,
the table of contents looks weird with all math in boldface in the
subsection and subsubsection titles, but no boldface for the non-math
mode stuff.
Is there any way to have the math appear boldface in all section,
subsection and subsubsection titles in the body of the report, but for
the subsection and subsubsection titles in the table of contents to
remain un-boldfaced (even with math in the titles)?
Thanks for any suggestions.
Howard Haber
\phantomsection\addcontentsline{toc}{subsubsection}{Your line symbols}
\subsubsection*{Your line \boldsymbols{}}
Obviously this works for any hierarchy of the toc.
Paul
\section[<toc-entry>]{<section title>}
\subsection[<toc-entry>]{<section title>}
should do the trick. this way you can even make your table of
contents seem like it was meant for some other article/book (if you
wanted to).
memoir's even better:
\section[<toc-entry>][<header title>]{<section title>}
(if you use only one optional argument the toc and header will be the
same.)
cheers,
jon.
You can redefine the commands typesetting section titles in the body and
in the table of contents to make them use the bold variant of the maths
fonts (by the \boldmath macro), e.g. putting the following code in your
preamble:
\makeatletter
\renewcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries\boldmath}} % \boldmath added
\renewcommand*\l@section[2]{%
\ifnum \c@tocdepth >\z@
\addpenalty\@secpenalty
\addvspace{1.0em \@plus\p@}%
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries \boldmath % \boldmath added
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\endgroup
\fi}
\makeatother
In this way, you don't need to specify different variants of titles to
appear in the body and in the TOC.
Note that emboldening maths in headers might not always be a good idea,
since the bold typeface is usually reserved for vectors/matrices etc.,
so by typesetting a scalar in bold you risk confusion of your readers.
Hope this helps,
Wojciech Śmigaj
Can I use the above code for other class than memoir, e.g., book class
of LaTeX?
Regards,
--
Hongyi Zhao <hongy...@gmail.com>
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
not the code \section[toc][header]{title}, which is memoir specific.
all the other stuff is common to latex standard classes (and works in
memoir too).
--
Robin Fairbairns, Cambridge
--Howard