0

I know this is technically wrong and I shouldn't even be attempting to do it... Nevertheless, I have a document which has section header sizes set up as Large and works fine everywhere except for one section, which is too long. I would like to change the size of the font of that section title only to make it look prettier (even if inconsistent with the size of other section titles)

The only way I have managed to change the size locally has been by doing

\section{\large{My very long section title}}

However, this messes the headers and the table of contents, as the font is also changed there.

I have tried using minipage or wrapping the section command with \begin{small}--\end{small}, but since the section title size is defined somewhere else, nothing changes...

Here's a mwe:

\documentclass[12pt,twoside,a4paper]{report}

\usepackage{lipsum}
\usepackage{fancyhdr}   % To change header and footers
    \pagestyle{fancy}       % Turn on the style
    \fancyhf{}              % Clears everything in the header and footer
    \fancyfoot[CE,CO]{\thepage}         %Page number centered in all pages
    \fancyhead[LE]{\slshape\nouppercase{\leftmark}}     %Chapter title in the outer margin of even pages
    \fancyhead[RO]{\slshape\nouppercase{\rightmark}}    %Section title in the outer margin of odd pages

\begin{document}

\tableofcontents

\chapter{My chapter}
\lipsum[3-6]

\section{This title is great}
\lipsum[3-10]

\section{This title is  veryvery veryveryvery increadibly and mindblowingly very very superlong}
The title is 3 lines long! It would look much better if I could just very slightly reduce the font size, so that it fits in two lines.

\bigskip

\lipsum[3-2]

\section{Some other nice title}
\lipsum[3-8]

\section{\large{This title is  veryvery veryveryvery increadibly and mindblowingly very very superlong}}
Great! it is now 2 lines... but the header is huge! and look at the table of contents!!

\bigskip

\lipsum[3-2]

\end{document}

which results in something like: TOC

Too big

Messed-up header/TOC

0

You can use the following: \chapter[short title in header & TOC]{long title in document}

\documentclass[12pt,twoside,a4paper]{report}

\usepackage{lipsum}
\usepackage{fancyhdr}   % To change header and footers
    \pagestyle{fancy}       % Turn on the style
    \fancyhf{}              % Clears everything in the header and footer
    \fancyfoot[CE,CO]{\thepage}         %Page number centered in all pages
    \fancyhead[LE]{\slshape\nouppercase{\leftmark}}     %Chapter title in the outer margin of even pages
    \fancyhead[RO]{\slshape\nouppercase{\rightmark}}    %Section title in the outer margin of odd pages

\begin{document}

\tableofcontents

\chapter{My chapter}
\lipsum[3-6]

\section{This title is great}
\lipsum[3-10]

\section[This title is a bit shorter]{This title is  veryvery veryveryvery increadibly and mindblowingly very very superlong}
The title is 3 lines long! It would look much better if I could just very slightly reduce the font size, so that it fits in two lines.

\bigskip

\lipsum[3-2]

\section{Some other nice title}
\lipsum[3-8]

\chapter[This title is short]{\large This title is  veryvery veryveryvery increadibly and mindblowingly very very superlong}

Great! it is now 2 lines... but the header is huge! and look at the table of contents!!

\bigskip

\lipsum[3-2]

\end{document}

enter image description here

enter image description here

  • Thanks! this is technically the other way around, but helped me solve it... I used: \chapter[Long title for header & TOC]{\large{long title with smaller fontsize in document}} – Francisco Herrerias-Azcue Mar 15 at 12:13
0

Use the \titleformat* command from titlesec inside a group, like this:

\documentclass[12pt,twoside,a4paper]{report}

\usepackage{lipsum}
\usepackage{titlesec} 
\usepackage{fancyhdr} % To change header and footers
    \pagestyle{fancy} % Turn on the style
    \fancyhf{} % Clears everything in the header and footer
    \fancyfoot[CE,CO]{\thepage} %Page number centered in all pages
    \fancyhead[LE]{\slshape\nouppercase{\leftmark}} %Chapter title in the outer margin of even pages
    \fancyhead[RO]{\slshape\nouppercase{\rightmark}} %Section title in the outer margin of odd pages

\begin{document}

\tableofcontents

\chapter{My chapter}
\lipsum[3-6]

\section{This title is great}
\lipsum[3-10]

\section{This title is veryvery veryveryvery increadibly and mindblowingly very very superlong}
The title is 3 lines long! It would look much better if I could just very slightly reduce the font size, so that it fits in two lines.

\bigskip

\lipsum[3-2]

\section{Some other nice title}
\lipsum[3-8]

{
\titleformat*{\section}{\Large\bfseries\itshape}
\section{This title is veryvery veryveryvery increadibly and mindblowingly very very superlong}}
Great! it is now 2 lines... but the header is huge! and look at the table of contents!!

\bigskip

\lipsum[3-2]

\section{Some other nice title}

\end{document} 

enter image description here

enter image description here

  • Thanks Bernard, although your answer could also work, I found Superuser27's answer easier to implement... given no new packages are needed, and no need to change back to original format either. – Francisco Herrerias-Azcue Mar 15 at 12:16

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.