\documentclass[12pt, a4paper]{report}
\usepackage[spanish]{babel}
\usepackage{graphicx}
\usepackage{times}
\usepackage{geometry}
\usepackage{csquotes}
\usepackage{parskip}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{longtable}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepackage[style = apa, backend = biber]{biblatex}
\usepackage{setspace}
\usepackage{array}
\usepackage{float}
\usepackage{booktabs}
\usepackage{multicol}
\usepackage{esdiff}
\usepackage{titlesec}
\usepackage{titletoc}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\renewcommand{\thesubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}
\usepackage{caption}
\captionsetup[figure]{labelformat=simple, labelsep=none, labelfont={bf}, textfont={it}, singlelinecheck=off}
\renewcommand{\figurename}{Figura}
\DeclareCaptionFormat{custom}{#1#2\\#3}
\captionsetup[figure]{format=custom}
\captionsetup[table] {labelformat=simple, labelsep=none, labelfont={bf}, textfont={it}, singlelinecheck=off}
\renewcommand{\tablename}{Tabla}
\captionsetup[table]{format=custom}
% Recursos bibliográficos
\addbibresource{ref.bib}
% Formato de página
\geometry{a4paper, left=3.5cm,right=2.54cm,top=2.54cm,bottom=2.54cm}
\setlength{\parindent}{2em}
\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\renewcommand{\headrulewidth}{0pt} % no line in header area
\fancyfoot[R]{\thepage} % page number in the right footer
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[R]{\thepage} % page number in the right footer
}
% Documento
\begin{document}
\titleformat{\chapter}[block]
{\centering\bfseries\Large} % Format: centered, bold, large size
{CAPÍTULO \thechapter:} % Chapter label
{5pt} % Space between label and title
{\MakeUppercase} % Title formatting
\titlespacing*{\chapter}{0pt}{-30pt}{20pt} % Adjust spacing: {left}{before}{after}
\titleformat{\section}{\normalfont\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\bfseries}{\thesubsection}{1em}{}
%%% CONTENIDO %%%%%%%%%%
\input{frontmatter/frontmatter}
\renewcommand{\baselinestretch}{1.5}
\pagenumbering{arabic}
\input{mainmatter/intro}
\input{mainmatter/problematica}
\input{mainmatter/rev literatura}
\input{mainmatter/metodologia}
\printbibliography
\end{document}