When I have an environment with a vertical skip after and whose content starts with \selectlanguage, and another environment or macro after the first environment that utilizes \addvspace, spaces are added. I tested a bit and figured that \selectlanguage resets \lastskip to 0pt:
MWE:
\documentclass{article}
\parindent0mm
\author{}
\title{}
\usepackage[main=ngerman,french]{babel}
\newenvironment{mylist1}{\addvspace{1\baselineskip}}{\vskip1\baselineskip}
\newenvironment{mylist2}{\addvspace{1\baselineskip}}{\vskip1\baselineskip}
\begin{document}
Main Text main text
\begin{mylist1}\selectlanguage{french}
mylist1 mylist1 mylist1
\end{mylist1}
Main Text main text
\begin{mylist2}
mylist2 mylist2 mylist2
\end{mylist2}
Main Text main text
\begin{mylist1}\selectlanguage{french}
mylist1 mylist1 mylist1
\end{mylist1}
\begin{mylist2}
mylist2 mylist2 mylist2
\end{mylist2}
Main Text main text
\end{document}
I got it fixed by adding the following to my preamble (using hyperref):
When I have an environment with a vertical skip after and whose content starts with
\selectlanguage
, and another environment or macro after the first environment that utilizes\addvspace
, spaces are added. I tested a bit and figured that\selectlanguage
resets\lastskip
to 0pt:MWE:
I got it fixed by adding the following to my preamble (using hyperref):