Text FormattingOdd Hyphenation Question

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
cbkschroeder
Posts: 55
Joined: Sun Nov 09, 2008 7:48 pm

Odd Hyphenation Question

Post by cbkschroeder »

Hi!

Thanks for taking the time to read my post.

So I have the following line:

Code: Select all

\caption{Video Post-Amplifier Filter Bank Module PCB Bottom, \unit[1.6875]{in}$\times$\unit[3.6875]{in}}
It makes a list-of-figures entry but I always get an \hbox overfull error - and the page number is pushed over. If I switch to \sloppy spacing (just to see what happens) LaTeX will break the line just after the comma and, of course, it looks heinous. So, I'd love to get LaTeX to break this line just after the second "$" because that won't kill the spacing too much. Do you think, however, that I can get LaTeX to do that?

My feeling is the answer is painfully simple but I don't have it; if anyone has any thoughts, I'd appreciate them.

Cheers,

Christian

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Odd Hyphenation Question

Post by phi »

You can insert \allowbreak to allow a line break at a specific point:

Code: Select all

\documentclass{article}
\usepackage{units}
\begin{document}
\listoffigures
\begin{figure}
\caption{Video Post-Amplifier Filter Bank Module PCB Bottom, \unit[1.6875]{in}$\times$\allowbreak\unit[3.6875]{in}}
\end{figure}
\end{document}
cbkschroeder
Posts: 55
Joined: Sun Nov 09, 2008 7:48 pm

Re: Odd Hyphenation Question

Post by cbkschroeder »

Brilliant! Thank you!!

Christian
Post Reply