I have problems when trying to compile a document with \section modified. I wrote the following code for my format:
\renewcommand{\thesection}{\Roman{section}}
\titleformat{\section}{\centering \bf \Large}{Título}{0.3em}{\thesection\\}
\renewcommand{\thesubsection}{\arabic{subsection}}
But, after the titlepage, I insert a \tableofcontents which is throwing the error: LaTeX Error: There's no line here to end.
I tried replacing the \\ from the \titleformat with \newline but the result is not what I need (that does not throw the error).
The question: Is there any simple way I can get this output when writing \section{I'm a Title!}?
EDIT: Sample Code:
\documentclass{article}
\usepackage[spanish]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{titlesec}
\renewcommand{\thesection}{\Roman{section}}
\titleformat{\section}{\centering \bf \Large}{Título}{0.3em}{\thesection\\}
\renewcommand{\thesubsection}{\arabic{subsection}}
\begin{document}
\tableofcontents
\section{I'm a Title!}
\end{document}


\documentclass{article}btw – M Aubel Dec 16 '18 at 02:55\section*? – Mico Dec 16 '18 at 07:27