Good day. I want define an environment that change the text height in function of the width
\documentclass[a4paper]{book}
\usepackage{lipsum}
\begin{document}
\the\textwidth---\the\textheight
\newenvironment{whtext}[1]{%
\newpage\begingroup
\hsize=#1
\vsize=\dimexpr\textheight*\numexpr\hsize/\textwidth\relax
\textwidth=\hsize
\textheight=\vsize}%
{\endgroup\newpage}
\lipsum[1-10]
\begin{whtext}{15cm}
\the\textwidth---\the\textheight
\lipsum[1-20]
\the\textwidth---\the\textheight
\end{whtext}
\end{document}
what i should do?