Text FormattingPreventing line breaks

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
theo moore
Posts: 72
Joined: Thu Jan 15, 2009 3:16 pm

Preventing line breaks

Post by theo moore »

I have a bit of text that I want to keep on the same line, even IF it goes slightly past the text boundary. That is, I have something like this

Code: Select all

The year went from 2003-
2004
I want to keep 2003-2004 on the same line (the first line), even though the last bit of 2004 will go past the text boundary. How would I do that? If I wanted to do it using the mathematical font, I could do,

Code: Select all

The year went from ${2003-2004}$
But I want it all to be regular text font.

I suppose I could do,

Code: Select all

The year went from ${\text{2003-2004}}$
#

But that's not very satisfying.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Preventing line breaks

Post by localghost »

You could start with rearrangement of the concerned sentence. Another way would be put this piece of text into a box.

Code: Select all

\mbox{2003--2004}

Best regards
Thorsten
Post Reply