I have a right floating figure with a justified caption spanning four lines like so:
Unfortunately, LaTeX will not hyphen the words in the caption (both words hyphen just fine in regular text), although just from eye measure there seems to be more than enough space. I have tried adding the words to the \hypenate
command, adding soft hyphens "-
and separating a word manually, i.e. "Un- terschiedliche". None worked.
I tried increasing the width of the wrapfigure
, still nothing (left image below). In another wrapfigure
(right image below) it seems to work just fine, and the only difference is caption text and width of both the image and the figure itself.
Is there a way to force LaTeX to hyphen at a particular syllable? Are there penalties for adding Text after a caption name/number?
Code of the first float:
\begin{wrapfigure}{r}{0.25\textwidth}
\centering
\includegraphics[width=0.2\textwidth]{images/4_eadogm_footprints}
\caption[Unterschiedliche Abmessungen der EA-DOGM-LCDs]{Unterschiedliche Abmessungen der EA-DOGM-LCDs.}
\label{fig:4_eadogm_footprints}
\vspace{-10pt}
\end{wrapfigure}
I realize without an MWE it is next to impossible to determine my error. I'm using this template and have unfortunately no idea how to compose an MWE with all settings intact.
Any help would be greatly appreciated.
UPDATE: Uploaded image to show what it should look like, rendering with {0.33\textwidth}
and working image.
Best Answer
with
babel
useor at least:
That should always be done for german texts when you have a word with a hyphen. And also for small text columns use package
ragged2e
and\RaggedRight
for the captions. Can be set automatically with\captionsetup
and packagecaption
.As lon gas you didn't provide a complete example it is really difficult to say what's the problem. This works: