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.

I have an overfull hbox which I've decided to live with. Actually, several.

However, since they're in \[\], it would look better if they could remain centered, i.e. overflowing the margins equally on both sides, rather than just overflowing to the right. Is it possible to ask LaTeX to do this? (I'm using pdflatex and the amsbook class, fwiw.)

(Yes, I know overfull hboxes make Donald Knuth cry! But I've considered other options—splitting up these lines of maths, scaling them down a little, changing the document margins, etc—and this seems to me the least worst compromise; so please don't flame me too hard for doing this…)

share|improve this question
    
Have a look at the answer to this question: tex.stackexchange.com/questions/2319/… –  Stefan Kottwitz Nov 15 '10 at 0:27
    
@Stefan: Ah, thankyou! In light of that, I guess my question can probably be closed as a duplicate? –  Peter LeFanu Lumsdaine Nov 15 '10 at 0:49
    
@Stefan: actually, I'm not quite able to get that answer working, I’m afraid. Unless I’m doing something silly, \[...\] doesn't seem to work inside the \makebox{...}, nor vice versa, and using \makebox{$...$} instead changes a lot of other things (obviously). –  Peter LeFanu Lumsdaine Nov 15 '10 at 0:57
    
Try \makebox{$\displaystyle ... $}. –  Aditya Nov 15 '10 at 1:11
1  
@Hendrik: I know it’s bad, but for reasons to do with the mathematical content and notation, I’d really rather avoid splitting it. (Unfortunately to explain a minimal counterexample would need at least about 20 pages of background :-) ) Mentally, I attach a fairly high penalty score to overfull hboxes, and a higher one for margin changes or scaling, but a higher one still to splitting this particular content; and under my current settings (working to a tight deadline, and not for eg a commercially published journal or book) the medium-high penalty scores are acceptable. –  Peter LeFanu Lumsdaine Nov 15 '10 at 17:00
show 3 more comments

1 Answer 1

up vote 8 down vote accepted

Use \mathclap from the mathtools package:

\documentclass{amsbook}
\usepackage[margin=2in]{geometry}
\usepackage{mathtools}
\usepackage{lipsum}

\begin{document}
\lipsum[1]
\[\mathclap{%
  f(x) = \int\frac{\sin x}{x}\,\mathrm{d}x%
       = \int\frac{\sin x}{x}\,\mathrm{d}x%
       = \int\frac{\sin x}{x}\,\mathrm{d}x%
       = \int\frac{\sin x}{x}\,\mathrm{d}x%
       = \int\frac{\sin x}{x}\,\mathrm{d}x%
       = \int\frac{\sin x}{x}\,\mathrm{d}x%
}\]
\lipsum[2]
\end{document}
share|improve this answer
    
Thankyou! Works perfectly, exactly what I was after. –  Peter LeFanu Lumsdaine Nov 15 '10 at 16:51
add comment

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.