围绕 align* 环境调整框

围绕 align* 环境调整框

我想在 align* 环境周围放置一个调整框,使整个 align* 环境缩小到高度为 .1\textheight。我试过了

\documentclass{article}
\usepackage{adjustbox}
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\usepackage{showframe}

\begin{document}

\begin{figure}[h]
\begin{adjustbox}{max height=.5\textheight, max width=\textwidth}
\parbox{\linewidth}{
    \begin{align*}
        many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
    \end{align*}
}
\end{adjustbox}
\end{figure}

\end{document}

但这似乎不起作用,即代码已编译,但 align* 环境根本没有缩放。我得到这个:

在此处输入图片描述

我能做些什么?

答案1

为了了解发生了什么,我修改了您的示例,如下所示。

输出显示

550.0pt,275.01346pt,270.7204pt

所以高度alignbox 已缩放到文本高度的一半,但它垂直居中,因此具有几乎相等的深度,最终结果或多或少\textheight

adjustbox有一个max totalheight专门用于此用途的密钥。

\documentclass{article}
\usepackage{adjustbox}
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\usepackage{showframe}

\begin{document}

\begin{figure}[h]
\sbox0{\begin{adjustbox}{max height=.5\textheight, max width=\textwidth}
\parbox{\linewidth}{
    \begin{align*}
        many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
         many \\
        many \\
        lines \\
        go \\
        here \\
    \end{align*}
}
\end{adjustbox}}\usebox0
\typeout{\the\textheight,\the\ht0,\the\dp0}
\end{figure}

\end{document}

相关内容