I was wondering if anyone would know how I can modify the general style that has the latex document so that the section part, subsection and subsubsection follow the specifications that I show in the following image.
At the moment what I was doing with the section and subsection part was something like this:
\section{\underline{THIS IS THE SECTION TITLE}}
\subsection{\textit{This is the subsection title}}
For the subsubsection part using times new roman as far as I could read it is not possible to use small caps, so capital letters would do.
----- TEMPLATE.
\documentclass[a4paper,12pt]{exam}
% PAQUETES PRINCIPALES
% ----------------------------------------------------------------------------------------
% ----------------------------------------------------------------------------------------
\usepackage[bitstream-charter]{mathdesign} % Paquete de fuentes matemáticas.
\usepackage[spanish, es-tabla]{babel} % Paquete de caracteres y títulos en español
\usepackage[utf8]{inputenc} % Permite escribir con acentos.
\usepackage{newtxtext,newtxmath} % Permite cambiar el tipo de letra a Times New Roman
\usepackage{lipsum} % Permite añadir texto LIPSUM.
\usepackage{ragged2e} % Paquete de alineación del texto.
\usepackage{amsmath} % Paquete para insertar símbolos matemáticos
\usepackage{hyperref} % Paquete para insertar referencias en el texto
\hypersetup{ % Establecer las propiedades para las referencias.
colorlinks = true,
linkcolor = matlab_blue,
urlcolor = matlab_blue,
citecolor = matlab_blue
}
\usepackage{textcomp,gensymb} % Paquetes que permiten agregar símbolos al texto.
\usepackage{float} % Paquete para tratar figuras y tablas como flotantes
\usepackage{lipsum} % Paquete para insertar texto mudo
\usepackage[none]{hyphenat} % Eliminar la división de palabras en el texto.
\setlength{\parindent}{0pt}
% Permite definir el símbolo de diámetro
\usepackage{wasysym}
\usepackage{enumitem}
% PAQUETES PARA LA DEFINICIÓN DE COLORES.
% ----------------------------------------------------------------------------------------
% ----------------------------------------------------------------------------------------
\usepackage[dvipsnames,table,xcdraw]{xcolor}
\definecolor{airforceblue}{rgb}{0.36, 0.54, 0.66}
\definecolor{matlab_blue}{rgb}{0, 0.447 0.741}
% MODIFICAR LA ZONA EN LA QUE SE INCUYE EL RESUMEN
% ----------------------------------------------------------------------------------------
% ----------------------------------------------------------------------------------------
\renewenvironment{abstract} % Modifica la alineación del resumen.
{\par\noindent\textbf{\abstractname}\ \ignorespaces \}
{\par\noindent\medskip}
% PAQUETES PARA TRABAJAR CON FIGURAS.
% ----------------------------------------------------------------------------------------
% ----------------------------------------------------------------------------------------
\usepackage{graphicx} % Paquete para insertar imágenes en latex.
\graphicspath{ {images/} } % Ruta para buscar las imágenes.
\usepackage{caption} % Modificaciones en el título de las figuras.
\usepackage{subcaption} % Modificaciones independientes en los títulos.
% - Permite cambiar la numeración de las figuras para incluir el número de la sección
% - y también cambia el estilo del texto
\setcounter{figure}{0}
\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}
\captionsetup[figure]{labelfont={it},textfont=it,labelsep=period,font=small}
% - Permite cambiar la numeración de las tablas para incluir el número de la sección
% - y también cambia el estilo del texto
\renewcommand{\thetable}{\arabic{section}.\arabic{table}}
\captionsetup[table]{labelfont={it},textfont=it,labelsep=period,font=small}
% - Código que permite eliminar la línea en blanco de forma previa a
% - incluir una enumeración
\setlist[itemize]{noitemsep, topsep=-12pt, after=\vspace{\baselineskip}}
\usepackage{array}
\newenvironment{conditions}
{\par\vspace{\abovedisplayskip}\noindent\begin{tabular}{>{$}l<{$} @{${}={}$} l}}
{\end{tabular}\par\vspace{\belowdisplayskip}}
% ESTABLECER LOS MÁRGENES DEL DOCUMENTO
% ----------------------------------------------------------------------------------------
% ----------------------------------------------------------------------------------------
\usepackage[a4paper,top=20mm,left=25mm,right=20mm,bottom=20mm,headheight=20mm]{geometry}
% CAMBIAR EL INTERLINEADO DEL DOCUMENTO
% ----------------------------------------------------------------------------------------
% ----------------------------------------------------------------------------------------
\usepackage{setspace}
\spacing{1}
% CREAR PÁGINAS EN BLANCO HASTA LLEGAR A PÁGINA PAR
% ----------------------------------------------------------------------------------------
% ----------------------------------------------------------------------------------------
\usepackage{changepage,ifthen}
\newcommand\skiptoevenpage{%
\checkoddpage
\ifthenelse{\boolean{oddpage}}%
{\null\clearpage}%
{\null\clearpage \null \clearpage}%
}
% CREAR PÁGINAS EN BLANCO HASTA LLEGAR A PÁGINA IMPAR
% ----------------------------------------------------------------------------------------
% ----------------------------------------------------------------------------------------
\newcommand\skiptooddpage{%
\checkoddpage
\ifthenelse{\boolean{oddpage}}%
{\null\clearpage \null \clearpage}%
{\null\clearpage}%
}
% CREAR EL ENCABEZADO DEL DOCUMENTO
% ----------------------------------------------------------------------------------------
% ----------------------------------------------------------------------------------------
\header{}{}{HEADER}
\headrule
% ----------------------------------------------------------------------------------------
% ----------------------------------------------------------------------------------------
% ----------------------------------------------------------------------------------------
% ----------------------------------------------------------------------------------------
\begin{document} \sloppy
\section{\underline{THIS IS THE SECTION TITLE}} %% THIS IS WRONG!!
\lipsum[2-4]
\textit{\subsection{\underline{This is the subsection title}}} %% THIS IS WRONG!!
\lipsum[1]
\textit{\subsubsection{\underline{This is the subsubsection title}}} %% THIS IS WRONG!!
\lipsum[1]
\end{document}


\underlineor\textitinside\section) is wrong. – Skillmon Feb 13 '22 at 17:54