When I use this bellow to make the section text upper case:
\makeatletter
\renewcommand*{\l@section}[2]
{%
\l@chapapp{\uppercase{#1}}{#2}{\cftsectionname}
}
\makeatother
The spacing between my chapter and section is added to the same length as set by (TOC Spacing in Memoir):
\setlength{\cftbeforechapterskip}{12pt}
But if I remove these lines:
\makeatletter
\renewcommand*{\l@section}[2]
{%
\l@chapapp{\uppercase{#1}}{#2}{\cftsectionname}
}
\makeatother
The spacing between chapters and section is correct:
How to make the table of contents section title upper case without messing with the space between the chapter and section?
With this full code, you can reproduce the problem after building it two times:
\documentclass{abntex2}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% TOC Spacing in Memoir
% https://tex.stackexchange.com/questions/60317/toc-spacing-in-memoir
\setlength{\cftbeforechapterskip}{12pt}
\makeatletter
\renewcommand*{\l@section}[2]
{%
\l@chapapp{\uppercase{#1}}{#2}{\cftsectionname}
}
\makeatother
\begin{document}
\begin{KeepFromToc}
\tableofcontents
\end{KeepFromToc}
\chapter*{Foreword}
\addcontentsline{toc}{chapter}{Foreword}
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\chapter{Chapter One}
\section{Section One One}
\subsection{Section One One}
\section{Section One Two}
\subsection{Section One Two}
\section{Section One Three}
\section{Section One Four}
\chapter{Chapter One}
\section{Section One One}
\section{Section One Two}
\section{Section One Three}
\section{Section One Four}
\end{document}
Best Answer
I managed to fix it using a general solution for the
article
class I find on How to make section name uppercase in ToC?:Also it was required to remove these statements from my file:
They were the cause of all my problems. I am not sure why they are scrolling everything, as causing the spacing between the section and chapter to be the same as the space between chapters.
This last should be due the fact that the command is redefining the
\l@section
with\l@chapapp
, which is just like begging for trouble and weird behaviors.Here are some related references for the memoir class and table of contents: