Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is it possible to have lines (as an exception) that continue into the right margin ?

Here's why I hope it's possible: I have a document and one of the headings is the formal name of a particular organization. The name is a few letters wider than what fits in the article's text width. It looks uglier if I break it in two lines than allowing for this exception (because of the space around it, in this particular document it doesn't look that bad).

One option suggested by SE is given in the question How can I change the margins for only part of the text?. The reason I'm asking is that maybe there is another way, to tell LaTeX "do not break this line, even if you bleed into the margin".

If there isn't, I'll look into the changepage package, but it's worth asking.

Thanks in advance.

share|improve this question

3 Answers 3

up vote 13 down vote accepted

It can depend on where you need to do this, but the standard methods for keeping text together should work for you:

aaa bbb ccc ddd~eee~fff ...

or

aaa bbb ccc \mbox{ddd eee fff} ...

Under no circumstances will ddd eee fff ever break, so you can write the entire organisation name with \mbox and it should do what you want.

share|improve this answer
3  
…unless ~ or \mbox are redefined… :) –  Will Robertson Dec 1 '10 at 6:58

I would use \rlap:

\rlap{This is a very long name of some arcane organization}

will typeset the text, but it won't take up any space, so you don't even get an overfull hbox.

share|improve this answer

Kern
I would use \kern with a small, negative value (a fraction of an em) between every letter in the heading ‘condensing’ the text until it fits the available space. You may use \rlap in addition, because then you can protrude the heading a fraction into the right margin.

With a little tinkering, no one will even see that you have ‘cheated’.

Microtype
As Frank Mittelback point out in the comment below, hand tuning with \kernwill probably be (too) much work. To avoid that the heading protrude to much into the right margin, you can ‘condense’ (shrink) the text by using Microtype’s letterspacing with a small negative tracking. The code below reduces the number of characters protruding into the right margin from four to one on my system.

\SetTracking{encoding=*}{-30}

\noindent\rlap{\lsstyle Testing testing resting test testing testing Testing testing testing Testing testing testing Testing}
share|improve this answer
    
The problem with kerning in this manner is that you break any natural kerns between letters as well, which means that you have to tinker quite a lot to make it look right (if at all). Making the heading protuding slightly to the right, for example with \rlap is therefore probably the better looking, and definitely the simpler solution. –  Frank Mittelbach May 12 '12 at 21:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.