0

Is there a simple way to align the RHS of LoF entries; for example using hyphenation, sloppy spacings, or similar?

\documentclass{scrreprt}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{tocloft}

\overfullrule=10mm

\makeatletter
\renewcommand{\@tocrmarg}{3em}
\makeatother

\begin{document}

\microtypesetup{protrusion=false}
\listoffigures
\microtypesetup{protrusion=true}

\begin{figure}
\caption{2D anisotropic velocity model used for objective function analysis anisotro\-pic}
\end{figure}

\begin{figure}
\caption{2D anisotropic velocity model used for objective function analysis 2D anisotropic velocity model used for objective function analysis 2D anisotropic velocity model used for objective function analysis}
\end{figure}

\end{document}
  • What about adding \hyphenation{...} to your preamble, which defines the default hyphenation points for anisotropic? For example, using \hyphenation{ani-so-tro-pic}. – Werner Feb 29 '16 at 23:16
  • \hyphenation{\ldots} certainly helps with the second LoF entry for the example above, thank you @Werner; however it makes no change to the first entry, where anisotropic is the last word of the line. Is there a way to override this? – H. Debens Mar 1 '16 at 9:08
1

Sometimes you have to play around a bit with the parameters you have. In the following example, making the box for the page number bigger gives a good result, but it make things worse for the next entries. In such a case, your only chance of getting a good result is to take things into your own hands and change the text a bit.

hdebensLofEntryAlign

\documentclass{scrreprt}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}

\overfullrule=10mm

\makeatletter
\renewcommand*\@pnumwidth{2.55em}
\makeatother

\hyphenation{an-iso-tro-pic}
\begin{document}

\microtypesetup{protrusion=false}
\listoffigures
\microtypesetup{protrusion=true}

\begin{figure}
    \caption{2D anisotropic velocity model used for objective
    function analysis anisotropic}
    \caption{2D anisotropic velocity model used for objective
    function analysis 2D anisotropic velocity model used for
objective function analysis 2D anisotropic velocity model used
for objective function analysis}
\end{figure}

\end{document}

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.