缩放 mdframed 框

缩放 mdframed 框

缩放盒子的技巧是什么mdframed

如果我注释掉中的\begin{MyEnv}和,我会得到缩放效果,但我想缩放整个框吗?\end{MyEnv}\adjustboxmdframed

代码:

\documentclass{article}

\usepackage{mdframed}
\usepackage{adjustbox}

\newenvironment{MyEnv}{%
    \begin{mdframed}[nobreak,userdefinedwidth=5cm]
}{%
    \end{mdframed}%
}%

\begin{document}
\begin{MyEnv}
Some text here.
\end{MyEnv}

\adjustbox{scale=0.75}{%
    \begin{MyEnv}
    Some text here.
    \end{MyEnv}%
}%
\end{document}

答案1

对于段落内容,最好先将其包装起来,varwidth以便正确装箱:

\documentclass{article}

\usepackage{mdframed}
\usepackage{adjustbox}

\newenvironment{MyEnv}{%
    \begin{mdframed}[nobreak,userdefinedwidth=5cm]
}{%
    \end{mdframed}%
}%

\begin{document}
\begin{MyEnv}
Some text here.
\end{MyEnv}

\adjustbox{varwidth=\linewidth,scale=0.75}{%
    \begin{MyEnv}
    Some text here.
    \end{MyEnv}%
}%
\end{document}

相关内容