0

I'm using hyperref for my dissertation's TOC and have subsection titles italicised using \emph{}. Is there a way I can retain the title formatting in the text, but make them appear unformatted in the table of contents?

For reference, I've tried what is suggested in the replies to this post, and the following options using tocloft before the \tableofcontents command:
a) \renewcommand{\cftsubsecfont}{\upshape}
b) \renewcommand{\cftsubsecfont}{\normalfont}
c) \renewcommand{\cftsubsecfont}{\textnormal{}}
d) \renewcommand{\cftsubsecfont}{\textup{}}

They work fine to add formatting, but none of these help with removing the italics from the text. Any help appreciated!

  • Welcome to TeX.SE. – Mico Apr 12 '22 at 06:46
  • Please provide more information about "[I] have subsection titles italicised using \emph{}". E.g., do provide a couple of examples of actual \subsection directives. Please also tell us which document class you employ. – Mico Apr 12 '22 at 06:47
  • Use titlesec to have subsection titles italicized, with \titleformat*{\subsection}{\itshape} in the preamble. – Bernard Apr 12 '22 at 08:23
  • @Mico I'm using the "report" class. Let's see if I've understood your question: I have 3 levels of titles - \chapter{X. Chapter Title} -> \section{X.1. Section} -> \subsection{X.1.1. Subsection}. – tex-mex-editor Apr 12 '22 at 11:05
  • @tex-mex-editor - Thanks for these pieces of information. The most important question remains: How exactly are you rendering the subsection-level headers in italics? – Mico Apr 12 '22 at 11:15
  • @Mico - Apologies. Using \subsection{\emph{Subsection}}. – tex-mex-editor Apr 12 '22 at 11:19
  • @Bernard - This seems to have worked! Thank you! – tex-mex-editor Apr 12 '22 at 11:20
  • You're welcome! Always glad if I can help! – Bernard Apr 12 '22 at 11:30

1 Answers1

1

You may achieve your formatting goal without loading any packages by repeating the section header, without the \emph wrapper, in the optional argument of the \subsection directive.

enter image description here

\documentclass{report}
\begin{document}
\tableofcontents

\bigskip\hrule\bigskip \setcounter{chapter}{2} % just for this example \setcounter{section}{3}

\subsection[Hello World]{\emph{Hello World}}

\end{document}

Mico
  • 506,678