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.

As the two pictures show, the first entry of listoffigures begins further to the right than in the case of my list of abbreviations. Is it - and if yes, how - possible to retrieve the margin-settings used in the listoffigures-environment and to apply these to the acronym-environment?

ListOfAbbr listoffigures

MWE

\documentclass{scrbook}

\usepackage[demo]{graphicx}
\usepackage{booktabs}
\usepackage{imakeidx}
\makeindex

\usepackage{acronym}

\begin{document}

\chapter*{List of abbreviations}
\begin{acronym}
\acro{3PL}{Third-party logistics}
\acro{APS}{Advanced Planning and Scheduling}
\end{acronym}

\listoffigures

\chapter{First chapter}

\section{Section}

    \begin{figure}[htbp]
       \centering
       \includegraphics{example.png} 
       \caption{example caption}
       \label{fig:example1}
    \end{figure}
    \index{Figure!Example1}

\end{document}
share|improve this question

2 Answers 2

You can go with xpatch and enumitem, since the package realizes the list of acronyms as a description environment:

\documentclass{scrbook}

\usepackage{xpatch,enumitem}
\usepackage{acronym}

\xpatchcmd{\acronym}{\begin{description}}
 {\begin{description}[labelindent=1.5em]}{}{}

\begin{document}

\chapter*{List of abbreviations}
\begin{acronym}
\acro{3PL}{Third-party logistics}
\acro{APS}{Advanced Planning and Scheduling}
\end{acronym}

...

enter image description here

The amount of indentation in the list of figures is stored in the macro \l@figure which usually has a definition such as

\@dottedtocline {1}{1.5em}{2.3em}

If you use a class where the definition is this, then a workaround to avoid guessing the length is as follows

\documentclass{scrbook}

\usepackage{xpatch,enumitem}
\usepackage{acronym}

\newlength\lfigureindent
\xpatchcmd{\acronym}{\begin{description}}
 {\begin{description}[labelindent=\lfigureindent]}{}{}
\makeatletter
\def\get@l@figure@indent{\expandafter\get@l@figure@indentaux\l@figure}
\def\get@l@figure@indentaux#1#2#3#4{\lfigureindent=#3\relax}
\AtBeginDocument{\get@l@figure@indent}
\makeatother

However, this can fail if some package (or class) changes the definition of \l@figure. Unfortunately there is no parameter for that length.

share|improve this answer
    
Please see my comment to GonzaloMedina's answer. –  John Nov 26 '12 at 22:13

One quick fix would be to use a list to wrap the acronym environment and use the desired indention; this can be easily done with the help of the changepage package:

\documentclass{scrbook}
\usepackage[demo]{graphicx}
\usepackage{booktabs}
\usepackage{imakeidx}
\usepackage{changepage}
\makeindex

\usepackage{acronym}

\begin{document}

\chapter*{List of abbreviations}
\begin{adjustwidth}{1.5em}{}
\begin{acronym}
\acro{3PL}{Third-party logistics}
\acro{APS}{Advanced Planning and Scheduling}
\end{acronym}
\end{adjustwidth}

\listoffigures

\chapter{First chapter}

\section{Section}

    \begin{figure}[htbp]
       \centering
       \includegraphics{example.png} 
       \caption{example caption}
       \label{fig:example1}
    \end{figure}
    \index{Figure!Example1}

\end{document}

enter image description here

enter image description here

share|improve this answer
    
If one changes the documentclass the value of 1.5em may change. So instead of setting a fix value the might be the possibility to have a dynamic value: Is it possible to retrieve the indention from the listoffigures-environment so that the indention of my list of abbreviations will be always the same as in listoffigures no matter which changes will be made in the preamble? –  John Nov 26 '12 at 22:12
    
@John since the indentation is given in the first argument of \@dotedtocline in \l@figure and the standard classes all use 1.5em for this value, is pretty safe to use it here; besides, if a package changes \l@figure I don't think there's a robust way to capture the new assigned value. –  Gonzalo Medina Nov 26 '12 at 22:39

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.