# JHEP template: Changing font size in the table of content

I am using the JHEP template to write my dissertation. This is how the table of contents presently looks,

In the document code, I wanted the section font to be bigger and hence I added \Large to the section definition. For example:

\section{\Large Introduction}.


From some online lecture notes written in JHEP template, I am aware that it is possible to have different font sizes for section names within the document and in the table of contents.

• Welcome to TeX.SX! If you’re required to use a template to write your dissertation, then I don’t think it’s a good idea to change the design of the template (Are you sure you want to impose your own taste on your university’s requirement?). – Ruixi Zhang Jul 28 '18 at 16:36
• @RuixiZhang I am not required to use any particular template. I chose JHEP as find its format pretty good. But, JHEP is for academic articles while I am writing a thesis. Hence, I would like to have titles of chapters with bigger font sizes which lead to the above problem. – Rajath Krishna R Jul 28 '18 at 16:39
• I see. Please put your code fragment into a compilable document, starting with \documentclass{...} and ending with \end{document}. Using JHEP3.cls or using jheppub.sty may need different solutions. You can have a look at this guide for how to prune your code for this purpose. – Ruixi Zhang Jul 28 '18 at 17:45
• Just modify \section by etoolbox's \patchcmd or with titlesec, and remove the manual \Large. – Jhor Jul 28 '18 at 18:44
• Thank you everyone for your suggestions. My problem got solved. – Rajath Krishna R Jul 28 '18 at 20:03

\usepackage{jheppub}


\usepackage{xpatch}
\xpatchcmd\section{\large}{\Large}{}{}
%\xpatchcmd\subsection{\normalsize}{\normalsize}{}{}
%\xpatchcmd\subsubsection{\normalsize}{\normalsize}{}{}


This code replaces \large by \Large in all section titles. If you want to change also the size of sub-sections and sub-sub-sections, uncomment the corresponding line and replace the second \normalsize by the new size.

Don't add the font size \Large to the section title itself, since then the size command will be used everywhere the section title is used, including in the table of contents.

As an example, modify the preamble of jhepexample.tex (the sample file coming with the jhep style) to look like

\usepackage{jheppub} % for details on the use of the package, please
% see the JHEP-author-manual
\usepackage{xpatch}
\xpatchcmd\section{\large}{\Large}{}{}
\usepackage[T1]{fontenc} % if needed


(without modifying anything else!). Then the document will start like that:

For comparison, here is the output of the unmodified document: