## LaTeX forum ⇒ Text Formatting ⇒ long bold large centered text exceeds right margin!!

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
amegahed3
Posts: 15
Joined: Wed Feb 25, 2009 11:20 am

### long bold large centered text exceeds right margin!!

Hi all,

I am a Latex beginner, and I face the following problem: whenever I try to type a long title that is centered, bold, large and underlined, it goes out of the page's right margin, instead of dividing it into two lines!!

Here is the code I use:

\documentclass[12pt]{article}%{amsart}\usepackage{graphicx}\usepackage{amsmath}\usepackage[top= 1in, bottom= 1in, left= 1in, right= 1in]{geometry}\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} \begin{document} \begin{centering}\underline{\large{\textbf{Progress in the Special Problems Course 8900 ALE'' Taken by Aly Megahed in Fall 2008 }}}\\\end{centering} \end{document}

Attached is an output pdf file that shows the problem!

Thanks.

Aly
Attachments
test.pdf

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm
Your problem is \underline, which TeX cannot line-break (more or less). There are ways around this, but underlining is normally regarded as bad news in typeset material. Do you really need this?

By the way, I would favour doing

\begin{center}
\large\bfseries
\end{center}

as the center environment is a group, and will "trap" \bfseries and \large.
Joseph Wright

amegahed3
Posts: 15
Joined: Wed Feb 25, 2009 11:20 am

I do understand all what you said. But what are the ways to go around this (as I really need the underline) ?

Thanks.

Aly

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm
The soul package will do the job:

\documentclass{article}\usepackage{soul} \begin{document} \begin{center}   \large\bfseries   \ul{Progress in the Special Problems Course      8900 ALE'' Taken by Aly Megahed in Fall 2008 }\end{center} \end{document}
Joseph Wright

amegahed3
Posts: 15
Joined: Wed Feb 25, 2009 11:20 am
Thanks a lot, Joseph. It worked perfectly. I really really appreciate your help.

Aly