When I use ragged2e
with \Centering
, this causes underfull errors when used in titlesec
.
As far as I know, I broke no functionality using the titlesec
package.
\documentclass{article}
\usepackage{ragged2e}
\usepackage{titlesec}
\usepackage{indentfirst}
\usepackage{microtype}
\usepackage{lipsum}
% Enable numbering for paragraphs and subparagraphs
\setcounter{secnumdepth}{5}
% Define the section formatting using titlesec
\titleformat{\section}
{\Centering\scshape}
{ \Roman{section}.\space}
{0em}
{}
\titleformat{\subsection}
{\Centering\scshape}
{ \Roman{section}.\Roman{subsection}.\space}
{0em}
{}
\titleformat{\subsubsection}
{\Centering\scshape}
{ \Roman{section}.\Roman{subsection}.\Roman{subsubsection}.\space}
{0em}
{}
\titleformat{\paragraph}
{\Centering\scshape}
{ \Roman{section}.\Roman{subsection}.\Roman{subsubsection}.\Roman{paragraph}.\space}
{0em}
{}
\titleformat{\subparagraph}
{\Centering\scshape}
{ \Roman{section}.\Roman{subsection}.\Roman{subsubsection}.\Roman{paragraph}.\Roman{subparagraph}.\space}
{0em}
{}
% Adjust spacings for sections
\titlespacing*{\section}{0pt}{0pt}{0pt}
\titlespacing*{\subsection}{0pt}{0pt}{0pt}
\titlespacing*{\subsubsection}{0pt}{0pt}{0pt}
\titlespacing*{\paragraph}{0pt}{0pt}{0pt}
\titlespacing*{\subparagraph}{0pt}{0pt}{0pt}
% Patch \paragraph and \subparagraph to behave like other sectioning commands
\makeatletter
\patchcmd{\paragraph}{\@startsection{paragraph}{4}}{\@startsection{paragraph}{4}{}{\z@}}{}{}
\patchcmd{\subparagraph}{\@startsection{subparagraph}{5}}{\@startsection{subparagraph}{5}{}{\z@}}{}{}
\makeatother
\setlength\parindent{.25cm}
\begin{document}
\section{Introduction}
Taylor Swift's success is a testament to her exceptional talent and unwavering determination. Since her debut in 2006, Swift has achieved remarkable milestones, including multiple Grammy Awards and chart-topping albums across various genres. Her transition from country music to pop was not only seamless but also marked by groundbreaking achievements, such as her album 1989 becoming one of the best-selling records of the decade. Swift's strategic reinventions and her ability to connect deeply with audiences have resulted in a string of record-breaking tours and an ever-expanding global fanbase. Beyond commercial success, she has become a powerful voice in the industry, advocating for artists' rights and influencing the evolution of modern music. Swift's career is characterized by a series of bold moves and artistic successes, underscoring her status as one of the most influential musicians of her generation.
\subsection{One}
\end{document}
I've had a question regarding \RaggedRight
and it causing overfull errors and got excellent answers, but could not find an answer that tackles what affects me right now with `\Centering'. I would greatly appreciate if someone could help me with my issue.
\centering
.\let\Centering\centering
work even though Ragged2e has\let\centering\Centering
?\show\Centering
still then say\protect\Centering
?