# Centering an underlined title

The goal is to center the main title in the cover page, however, this has been proven quite the challenge.

### What the problem is

Most of the approaches I've tried end up in the same way: the title overflowing to the right without adding a line break. Below is the output of \uline{\par\Large{\textbf{\@title}}}\\, where title is defined as A VERY LONG TITLE THAT DOES NOT BREAK INTO MULTIPLE LINES EVEN THOUGH IT SHOULD:

The above format is specified and cannot be modified. However, I've narrowed down the problem to be the underlining, as any other commands without any form of underlining (\underline{}, \ul{}, \uline{}, etc. ) all have the desired effect, minus the underlining. The current class is book.

### What has been tried

• Refactoring of the command above.
• The ulem and soul packages, along with the default underlining options.
• Wrapping the title in a minipage.
• \centerline.
• Making a wrapper for \@title

### What has not been tried

• titling package.
• Last resources: a pre-underlined font; starting from scratch.

Minimal working example

• Welcome to TeX.SX! Please provide a minimal working example (MWE) of your current code for us to work on. – epR8GaYuh Mar 17 at 20:47
• It is easier to make a custom title by NOT using \maketitle at all. titlepage OTOH is fine. – John Kormylo Mar 17 at 21:21

You can define your titlepage to get a bold, large, undeline title plus the rest of the layout with a few changes to Titulation, and keep using \maketitle.

\documentclass[letterpaper,openright,11pt, oneside, spanish]{book}
\usepackage[spanish, es-tabla]{babel}
\usepackage[utf8]{inputenc}

\usepackage{Titulacion} % Formatting
\usepackage{ulem}

\title{\uline{A VERY LONG TITLE THAT DOES NOT BREAK INTO MULTIPLE LINES EVEN THOUGH IT SHOULD}}

\begin{document}
\maketitle
\end{document}


This is Titulation.sty

   \ProvidesPackage{Titulacion}

\renewcommand\maketitle{%
\begin{titlepage}
\fontfamily{lmr}
\fontsize{14}{30}\selectfont

\hfill\vspace{.1\textwidth}
\centering
\vspace{11mm}

{\bfseries \@title}

\vspace{11mm}
TITULACIÓN INTEGRAL\\
\vspace{2mm}\

PARA OBTENER EL TÍTULO DE:
\vspace{11mm}

PRESENTA:\\
\vspace{11mm}
ASESOR:\\
\end{titlepage}
}%
\endinput


As pointed out by John Kormylo, getting rid of a custom \maketitle worked like a charm. Find the new changes implemented below:

\documentclass[letterpaper,openright,11pt, oneside, spanish]{book}
\usepackage{ulem}

\begin{document}
\title{\uline{A VERY LONG TITLE THAT DOES NOT BREAK INTO MULTIPLE LINES EVEN THOUGH IT SHOULD}}
\maketitle

\end{document}


Which produce the following result:

• You don't give enough of your original attempt to make a strong diagnosis, but from what you gave, I think changing it to \par\Large{\textbf{\uline{\@title}}} would probably work. – Don Hosek Mar 18 at 1:35
• Didn't work when plugged as-is, most likely due to the intrincate \maketitle I have set up, as John Kormylo pointed out. I'll keep it in mind for the next template though. – POWRFULCOW89 Mar 18 at 1:55