LaTeX forum ⇒ Text Formattinglong 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!!

Postby amegahed3 » Wed Feb 25, 2009 11:28 am

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:

  1. \documentclass[12pt]{article}%{amsart}
  2. \usepackage{graphicx}
  3. \usepackage{amsmath}
  4. \usepackage[top= 1in, bottom= 1in, left= 1in, right= 1in]{geometry}
  5. \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
  6.  
  7. \begin{document}
  8.  
  9. \begin{centering}
  10. \underline{\large{\textbf{Progress in the Special Problems Course ``8900 ALE'' Taken by Aly Megahed in Fall 2008 }}}\\
  11. \end{centering}
  12.  
  13. \end{document}


Attached is an output pdf file that shows the problem!

Could you please help me?

Thanks.

Aly
Attachments
test.pdf
(10.93 KiB) Downloaded 369 times

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Postby josephwright » Wed Feb 25, 2009 12:25 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
Your text goes here.
\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

Postby amegahed3 » Wed Feb 25, 2009 3:43 pm

Thanks a lot, Joseph for your reply.

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

Postby josephwright » Wed Feb 25, 2009 5:48 pm

The soul package will do the job:

  1. \documentclass{article}
  2. \usepackage{soul}
  3.  
  4. \begin{document}
  5.  
  6. \begin{center}
  7. \large\bfseries
  8. \ul{Progress in the Special Problems Course
  9. ``8900 ALE'' Taken by Aly Megahed in Fall 2008 }
  10. \end{center}
  11.  
  12. \end{document}
Joseph Wright

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

Postby amegahed3 » Wed Feb 25, 2009 9:40 pm

Thanks a lot, Joseph. It worked perfectly. I really really appreciate your help.

Aly


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 9 guests