I just copied this template from Overleaf and I am an absolute beginner. What should I do to move the chapter names away from the chapter numbers so that the 8 doesn't get stuck?

Pic:

My code:

\documentclass[smalldemyvopaper,11pt,twoside,onecolumn,openright,extrafontsizes]{memoir}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[osf]{Alegreya,AlegreyaSans}
\usepackage{microtype}
\usepackage{setspace}
\usepackage{lettrine}
\usepackage{titlesec}
\usepackage{lipsum}
\usepackage{calc}
\usepackage{hologo}
\setstocksize{8.5in}{5.675in}
\settrimmedsize{8.5in}{5.5in}{*}
\setbinding{0.175in}
\setlrmarginsandblock{0.611in}{1.222in}{*}
\setulmarginsandblock{0.722in}{1.545in}{*}
\renewcommand\thechapter{\Roman{chapter}}
\titleformat
{\chapter}
[display]
{\normalfont\scshape\huge}
{\HUGE\thechapter\centering}
{0pt}
{\vspace{18pt}\centering}[\vspace{42pt}]
\setlength{\parskip}{0em}
\renewcommand\contentsname{\normalfont\scshape Contents}
\renewcommand\cftchapterfont{\normalfont}
\renewcommand{\cftchapterpagefont}{\normalfont}
\renewcommand{\printtoctitle}{\centering\Huge}
\checkandfixthelayout
\fixpdflayout
\begin{document}
\tableofcontents*
\chapter{1}
\chapter{1}
\chapter{1}
\chapter{1}
\chapter{1}
\chapter{1}
\chapter{1}
\chapter{1}
\chapter{1}
\end{document}

• I believe, you can use \setlength{\cftchapternumwidth}{<length>} to adjust the amount of space 'saved' for that TOC element. Maybe try 2em.
– jon
Feb 18, 2017 at 4:56
• Off-topic: My advice for absolute beginners: As far a as possible, do not use any template, start with some empty standard class, then add only that you consider essential but the purpose of your document (that mean you understand what it does), i.e., maintain the preamble as clean as possible.
– Fran
Feb 18, 2017 at 9:14
• @Fran: This is so true!
– user31729
Feb 18, 2017 at 14:58
• Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. Dec 28, 2017 at 22:14

Inspired by the very talented @egreg idea, I changed the distance between chapter names and the chapter numbers.

\documentclass[smalldemyvopaper,11pt,twoside,onecolumn,openright,extrafontsizes]{memoir}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[osf]{Alegreya,AlegreyaSans}
\usepackage{microtype}
\usepackage{setspace}
\usepackage{lettrine}
\usepackage{titlesec}
\usepackage{lipsum}
\usepackage{calc}
\usepackage{hologo}
\setstocksize{8.5in}{5.675in}
\settrimmedsize{8.5in}{5.5in}{*}
\setbinding{0.175in}
\setlrmarginsandblock{0.611in}{1.222in}{*}
\setulmarginsandblock{0.722in}{1.545in}{*}
\renewcommand\thechapter{\Roman{chapter}}
\titleformat
{\chapter}
[display]
{\normalfont\scshape\huge}
{\HUGE\thechapter\centering}
{0pt}
{\vspace{18pt}\centering}[\vspace{42pt}]
\setlength{\parskip}{0em}
\renewcommand\contentsname{\normalfont\scshape Contents}
\renewcommand\cftchapterfont{\normalfont}
\renewcommand{\cftchapterpagefont}{\normalfont}
\renewcommand{\printtoctitle}{\centering\Huge}
\checkandfixthelayout
\fixpdflayout
\usepackage{etoolbox}
\makeatletter
\patchcmd{\l@chapter}{1.5em}{2em}{}{}
\makeatother
\setlength{\cftchapternumwidth}{3em}
\begin{document}
\tableofcontents*
\chapter{1}
\chapter{1}
\chapter{1}
\chapter{1}
\chapter{1}
\chapter{1}
\chapter{1}
\chapter{1}
\chapter{1}
\end{document}