I'm trying to customize my TOC with etoc in book class, but I'm failing to apply MakeUppercase to \etocname.
I'm using local TOCs, hyperref and fancyhdr in case that is relevant.
My main question:
- How do I make the
\etocnamerespectMakeUppercase? I already tried all sorts of with/without{ }combinations. I also tried this solution, but it messes up the\markbothcommand, that I need. This other solution works, of course, but I don't want to manually change all myparts,chaptersandsections. This option doesn't work for me because I already usetitlesecfor formatting the in-text appearances ofchapters, etc.
I also would like to know:
- Where can I find the etoc-like code for the standard styles in the
bookclass? I'm currently guessing the font sizes and{start},{finish}codes for each level in the\etocsetstyle. I couldn't find this in theetocdocumentation or elsewhere.
Here is a MWE with my try for changing the Part style in TOC:
\documentclass[a4paper]{book}
\usepackage{etoc}
\etocsetstyle{part}
{\parindent 0pt
\nobreak
\etocskipfirstprefix}
{\pagebreak[3]\bigskip}
{\large\MakeUppercase\bfseries
\etocifnumbered{\etocnumber{} \ \ \ \MakeUppercase \etocname}{}\nobreak\hfill \etocpage\par}
{}
\begin{document}
\tableofcontents
\markboth{contents}{} %I need the solution to work with this
\part{A Part}
\chapter{A Chapter}
\section{A Section}
\subsection{A subsection}
\end{document}
For reference, here is a pic of what I mean by "standard style", which is what I get if I load the MWE without any etocmodifications. 

29. Emulating the book classin etoc.pdf contains an answer which adds some features. Maybe you are using an old version whose documentation does not have this? – user691586 Aug 31 '23 at 06:49