2

In one instance in my document I have the following:

\section{\large Multi-worded section heading }

Currently in the table of contents, it appears larger than all of the other titles (no doubt because that's what I've instructed LaTeX to do). How do I change this such that it is the same as the other titles?

  • 3
    Use \section[Multi-worded section heading]{\large Multi-worded section heading } – user11232 Oct 1 '14 at 2:09
  • @HarishKumar Answer, I suppose? I think the question title should be generalized somewhat, though. – Sean Allred Oct 1 '14 at 3:12
  • 1
    Why no use titlesec? – skpblack Oct 1 '14 at 4:10
  • 1
    Related/duplicate: Small caps in section but not in ToC – Werner Oct 1 '14 at 4:56
  • @skpblack. The OP wants to do it for just one section, I suppose. – user11232 Oct 1 '14 at 6:49
2

I understood this as: you want to change fonts only in one/few of the section titles (not for all). The easiest way is to use the optional argument of \section like

%\section[optional content]{regular content }    
\section[Multi-worded section heading]{\large Multi-worded section heading }

so that optional unformatted content is used for running headings and toc. Here is the MWE with article class (you didn't tell which class!)

\documentclass{article}
\begin{document}
\tableofcontents
\section{Some section}
\section[A section]{\Huge A section}
\subsection{A subsection}
\subsubsection{A subsubsection}
\section{Some section again}
\end{document}

enter image description here

which certainly looks ugly with a smaller section number. A better way is to define a new command like:

\makeatletter
\newcommand\mysection{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\Huge\bfseries}}    %%<-- \Large replaced by \Huge
\makeatother

and use it as below:

\documentclass{article}
\makeatletter
\newcommand\mysection{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\Huge\bfseries}}
\makeatother
\begin{document}
\tableofcontents
\section{Some section}
\mysection{A section}
\subsection{A subsection}
\subsubsection{A subsubsection}
\section{Some section again}
\end{document}

enter image description here

If you want to apply these changes to all the sections, you may better use sectsty (as linked by Werner: Small caps in section but not in ToC or use titlesec package (titleformat*{\section}{\Huge}).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.