1

With the package setspace I can change the line spacing. This works quite fine. When I place the command \singlespacing after a section it introduces additional space. MWE:

\documentclass[a4paper,11pt]{article}
\usepackage[shorthands=off,bidi=basic,english, ngerman]{babel}
\usepackage{setspace} 
\onehalfspacing 
\usepackage{kantlipsum}

\begin{document}
    \title{merry setspace christmas test}
    \author{who cares?}
    \date{2011-12-19}
    \maketitle
    \section{Kant - 1}
    \kant[1]
    \subsection{Kant - 2 }
    \singlespacing  % <----------------------------------
    \kant[2]
\end{document}

Is there a way to prevent this?

2
  • the code inserts a vskip there. Use \setstretch{1}. Commented Nov 27, 2020 at 12:09
  • Ahhh, OK, thx for the solution
    – LeO
    Commented Nov 27, 2020 at 12:15

1 Answer 1

1

Put the \singlespacing before the \subsection{Kant - 2} not after it.

4
  • Although I agree with your approach I have the problem that I need to know in advance where the \singlespacing will be put to. I prefer more the approach that the command by itself should take care and not me as a user should take care where to place it.
    – LeO
    Commented Nov 28, 2020 at 10:08
  • @LeO It is you as the user who decides where to put \singlespacing. How do you expect the command to know where you really wanted it? ---GOM Commented Nov 28, 2020 at 19:31
  • But when using an environment with spacing the issue won't appear. So how does the environment knows but the command not? I know there is a diff but send quite strange.
    – LeO
    Commented Nov 29, 2020 at 12:27
  • @LeO (Change to) commands within an environment are local to the environment and do not apply outside it. This is standard (La)TeX. Commented Nov 30, 2020 at 19:35

You must log in to answer this question.

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