\textheight
is changing as you can verify by adding the verbose
option to geometry
and looking in the log file. The problem is the adjustbox
command. Changing max height
to max totalheight
gives the desired behaviour.
\documentclass[a4paper,10pt]{article}
\usepackage[landscape,hmargin={1.2cm,1cm},vmargin=1cm,footskip=7mm]{geometry}
\usepackage{adjustbox}
\usepackage{boxedminipage}
\begin{document}
\begin{adjustbox}{max width=\textwidth,max totalheight=0.4\textheight,keepaspectratio}
\begin{boxedminipage}{70cm}
\ \vspace{70cm}\
\end{boxedminipage}
\end{adjustbox}
\end{document}
If you do the following
\newsavebox{\test}
\settoheight{\test}{\begin{boxedminipage}{70cm}
\ \vspace{70cm}\
\end{boxedminipage}}
\showthe\\test
\sbox{\test}{\begin{boxedminipage}{70cm}
\ \vspace{70cm}\
\end{boxedminipage}}
\showthe\ht{\test}
then the log file will show that your boxed minipage has height 1001.74644pt
and depth 996.74644pt
so its total height is about twice its height. (The values are close to being such that the box is vertially centered with respect to the middle of the current row.)
boxedminipage
is just like minipage
, so you can give it positioning arguments: a \begin{boxedminipage}[b]
results in a box with zero depth and full height; \begin{boxedminipage}[t]
results in a box with height 0.4pt
and (nearly) full depth (the 0.4pt
comes from the frame). So instead of using totalheight
, you could use
\begin{adjustbox}{max width=\textwidth,max height=0.4\textheight,keepaspectratio}
\begin{boxedminipage}[b]{70cm}
\ \vspace{70cm}\
\end{boxedminipage}
\end{adjustbox}
keepaspectratio
overwrite the height setting?adjustbox
would shrink it. I couldn't find a cleaner way of drawing a huge square, so I just usedboxedminipage
.{\fboxsep=-\fboxrule\framebox[70cm]{\rule{0pt}{70cm}}}
\newcommand{\bigsquare}[1]{{\fboxsep=-\fboxrule\sbox0{}\wd0=#1\ht0=#1\relax\fbox{\box0}}}
and then\bigsquare{70cm}
is even faster.