[Tex/LaTex] Unexplainable change of line spacing

line-spacingspacing

I am currently writing my bachelor's thesis and have encountered some very peculiar behavior in LaTeX which I frankly cannot explain.

I am using the setspace package and have \onehalfspacing set at the beginning of my document and do not change it until a table at the end of the document. However, for some reason and without any action of my own, at a seemingly random spot, the spacing of my document automatically changes from onehalfspacing to singlespacing.

I'd appreciate any ideas on what the reason could be.
I have attached an image of the generated PDF in which the spacing change is clearly visible (pretty much at the end of the page, it goes on after that for the whole document) and of my code at the same location.
Note: The \setmeter function is a custom function which is also used several times beforehand, thus probably not being the cause.
I have also tried manually setting to \onehalfspacing and \setstretch{1.5} at the place where it changes, which does not seem to help.

The generated PDF
The code

Best Answer

Thanks to Ulrike Fischers comment, I figured it out. I had a longtabu in the same section after the text that had singlespacing activated. After changing the code, the spacing was fine again. Here is the longtabu code that caused the issue:

\tabulinesep=0.8mm
\singlespacing
\begin{longtabu} to \textwidth {
    X[3,c]
    X[3,c]
    X[4,c]}
    \hline
    \textbf{Interpret} & 
    \textbf{Anzahl Stücke} & 
    \textbf{Genre-Zuordnung}
    \\ \hline \hline
    Lionel Richie & 2 & Motown-Sound, Pop, Rhythm and Blues, Soft Soul\\ \hline
    Blondie & 1 & New Wave, Pop\\ \hline
    Diana Ross & 1 & Motown-Sound, Pop, Rhythm and Blues, Soul\\ \hline
    Kenny Rogers & 1 & Country, Pop\\ \hline
    Rick Springfield & 1 & AOR, Pop, Rock\\ \hline
    Joan Jett & 1 & Hard Rock, Pop\\ \hline
    Bonnie Tyler & 1 & Pop\\ \hline
    Phil Collins & 1 & AOR, Pop\\ \hline
    Tina Turner & 1 & Pop, Rhythm and Blues\\ \hline
    Kenny Loggins & 1 & AOR, Pop, West Coast\\ \hline
\end{longtabu}

The \singlespacing in the second line is what caused the unexpected behavior, since it was in the same paragraph.

Related Question