To suppress hyphenation in section names I use \hyphenpenalty=10000 in \titleformat command.

Is there any similar way to suppress hyphenation in figure and table (and longtable) captions?

  • \captionsetup{justification=raggedright} makes unnecessary spaces at the end of line. \DeclareCaptionJustification{nohyphen}{\hyphenpenalty=10000} doesn't work. – kostr22 May 13 '14 at 11:11

The codes you put in the comment work to produce the effect that I think you want.

This image shows the default hyphenated layout in a table and longtable then the same again after declaring captions should be justified with no hyphenation (which gives TeX no choice but to over-stretch the space between Table and the number.)

enter image description here





\caption{verylongwordverylongword verylongwordverylongword }

\caption{verylongwordverylongword verylongwordverylongword }


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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