こんにちは。これをもう少し理解したいと思っています。adjustbox
次の例では、テキストのサイズが、私が指定した寸法に合うように変更されないのはなぜでしょうか。たとえば、4 インチ x 4 インチのボックスなどです。何か間違っているのでしょうか。どうすれば修正できますか。
\documentclass{article}
\usepackage{lipsum}
\usepackage{adjustbox}
\begin{document}
\begin{adjustbox}{frame,max height=4in,max width=4in}
\parbox{4in}{
\lipsum[1-3]}
\end{adjustbox}
\end{document}
答え1
の箱にはTeX
高さと奥行きがあります。 問題の箱の寸法については、次のように問い合わせることができます。
\documentclass[10pt]{article}
\usepackage{adjustbox}
\usepackage{lipsum}
\begin{document}
\newsavebox\Abox
\savebox\Abox{\parbox{4in}{\lipsum[1-3]}}
\newlength\mydp
\newlength\myhg
\settodepth\mydp{\usebox{\Abox}}
\settoheight\myhg{\usebox{\Abox}}
\showthe\mydp
\showthe\myhg
\end{document}
このようにして、高さは204.97221pt
、奥行きは となります209.97223pt
。 なので1in=72.27pt
、これはボックスの高さと奥行きがそれぞれおよそ2.84in
と であることを意味します2.91in
。したがって、設定はmax height=4in
影響しません。adjustbox パッケージ マニュアルはを加算した値totalheight
なので、ページ上のボックスの実際の高さを に制限したい場合は、 の代わりにを使用する必要があります。ボックスの幅を同じままにするには (つまり、ボックスのアスペクト比を変更するには)、と を設定する必要があります。height
depth
4in
totalheight
height
width
totalheight
\documentclass[10pt]{article}
\usepackage{adjustbox}
\usepackage{lipsum}
\begin{document}
\adjustbox{width=4in,totalheight=4in}{\parbox{4in}{\lipsum[1-3]}}
\end{document}