これは技術的に間違っていることはわかっていますし、やろうとすることすらすべきではありません...それでも、セクションヘッダーのサイズが次のように設定されているドキュメントがありLarge
、どこでも正常に動作します。を除外する1つのセクションが長すぎるので、フォントサイズを変更したいですそのセクションのタイトルのみ見た目を良くするため(他のセクションのタイトルのサイズと一致しない場合でも)
サイズを変更できた唯一の方法は地元ですることで
\section{\large{My very long section title}}
ただし、これにより、フォントも変更されるため、ヘッダーと目次が乱れます。
minipage
セクション コマンドを使用したりラップしたりしてみました\begin{small}--\end{small}
が、セクション タイトルのサイズが別の場所で定義されているため、何も変わりません...
ここに 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}
答え1
以下を使用できます。\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}
答え2
次のように、グループ内\titleformat*
からコマンドを使用します。titlesec
\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}