I'm setting the margin configurations for multiple environments. For instances firstenvironment sets the margins using \setlength, then I make use of the multicols package inside the new environment. The problem is that the text doesn't seem to respect the bottom margin in the first page where the environment is just being used, but the text in the next pages do respect the margins. The same happens when I create a second environment with its own margin configurations. Not sure why the margins are not activated immediately when the environment begins. Any suggestions would be welcome, thanks!
PD. PDF compiled with Xelatex
\documentclass[12pt]{article}
\usepackage{lipsum}
\usepackage{showframe} % show the frame margins
\usepackage{multicol}
\newenvironment{firstenvironment}{
\setlength{\hoffset}{0mm}
\setlength{\voffset}{0mm}
\setlength{\headsep}{20pt}
\setlength{\headheight}{4em}
\setlength{\textheight}{6in}
\setlength{\footskip}{10mm}}{}
\newenvironment{secondenvironment}{
\setlength{\hoffset}{0mm}
\setlength{\voffset}{0mm}
\setlength{\headsep}{5pt}
\setlength{\headheight}{2em}
\setlength{\textheight}{5in}
\setlength{\footskip}{20mm}}{}
\begin{document}
\begin{firstenvironment}
\setlength\columnsep{30pt}
\begin{multicols}{2}
{\Large\bf 1ST LIPSUM}\\
\lipsum[1-10]
\end{multicols}
\end{firstenvironment}
\newpage
\begin{secondenvironment}
\begin{multicols}{2}
{\Large\bf 2ND LIPSUM}\\
\lipsum[1-10]
\end{multicols}
\end{secondenvironment}
\end{document}
Photo, text out of bottom margin: image
