4

I am currently using the the scrartcl document class and glossaries for acronyms:

\documentclass[12pt,a4paper,headsepline,notitlepage,parskip=half]{scrartcl} 
\usepackage[nonumberlist,acronym]{glossaries}

Further in the document I am using this

\section{Abkürzungen}
\glossarystyle{longheaderborder}
\printglossary[type=\acronymtype,title={}]

to have a numbered Section "Abkürzungen" in the table of contents. This works ok so far.

However the spacing between the Section "Abkürzungen" and the listing of the acronyms is too large. I reduce this spacing by using \vspace*{-15mm} but I think there must be a better way.

Is there a way to reduce the space after the section heading by the exact space which is normally used for spacing headers and text (I don't know how to achieve that in latex)?

Edit:

I think I wasn't clear enough on what I want to achieve:

For the section "Abkürzungen" only, the vspace is too large. For all other sections, scrartcl's vspace is fine.

I would like to reduce the vspace between the section heading and the text for just one section.

I know that by using an empty title \printglossary[type=\acronymtype,title={}] I effectively get an empty title (and it seems it is using the space even though it is empty), but I couldn't figure out how to put a title in \printglossary which is also visible as a numbered section in the table of contents.

1 Answer 1

5

Here's a way for switching between sections with tighter spacing and sections with normal spacing, done by redefing the \section command of scrartcl:

\documentclass{scrartcl}
\newcommand{\breaksection}[1]{#1\par\noindent}
\usepackage{letltxmacro}
\LetLtxMacro{\oldsection}{\section}
\makeatletter
\newcommand*{\smallsection}{
  \renewcommand{\section}{\@startsection{section}{1}{\z@}%
    {-3.5ex \@plus -1ex \@minus -.2ex}%
    {0ex}%
    {\ifnum \scr@compatibility>\@nameuse{scr@[email protected]}\relax
      \setlength{\parfillskip}{\z@ plus 1fil}\fi
      \raggedsection\normalfont\sectfont\nobreak\size@section\breaksection}%
  }
}
\makeatother
\newcommand*{\stdsection}{\LetLtxMacro{\section}{\oldsection}}
\begin{document}
\section{One}
text
\smallsection
\section{Two}
text
\stdsection
\section{Three}
text
\end{document}

It copies the original definition from scrartcl but uses 0ex for the new space after the heading, which is 2.3ex \@plus.2ex by default. \breaksection is defined to get a paragraph break after the heading, without it you would get a run-in heading: a positive value causes a skip below, a negative value a run-in heading with that horizontal space.

5
  • Why didn't you redefine the 5th argument of \@startsection. A simple 1sp or other glue length are possible. Commented Dec 19, 2011 at 17:22
  • @MarcoDaniel Just because the OP would like to "reduce ... by the exact space". One scaled point wouldn't make a visible difference, in that case \breaksection could be omitted.
    – Stefan Kottwitz
    Commented Dec 19, 2011 at 17:44
  • I think I wasn't precise enough and I edited my question. Thanks for your answer so far (+1)
    – tobsen
    Commented Dec 20, 2011 at 8:26
  • @tobsen could be done, I modified the code above.
    – Stefan Kottwitz
    Commented Dec 20, 2011 at 8:45
  • @StefanKottwitz that did the trick, thank you very much indeed!
    – tobsen
    Commented Dec 20, 2011 at 9:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .