![使用adjustbox时如何保持单元格文本高度较大?](https://linux22.com/image/449587/%E4%BD%BF%E7%94%A8adjustbox%E6%97%B6%E5%A6%82%E4%BD%95%E4%BF%9D%E6%8C%81%E5%8D%95%E5%85%83%E6%A0%BC%E6%96%87%E6%9C%AC%E9%AB%98%E5%BA%A6%E8%BE%83%E5%A4%A7%EF%BC%9F.png)
当我将表格宽度限制为 0.7\textwidth 时,字体大小也会减小。我希望表格显示在页面中央,但文本足够大,便于阅读。
\documentclass{exam}
\usepackage{adjustbox}
\begin{document}
\begin{center}
\begin{adjustbox}{width=0.7\textwidth}
\medskip\noindent
\begin{tabular}{|l|l|} \hline
Some text. & lsibyg gihebg fiehbg etin vtn osuing iostnugetnug etouhg otunhoeuthg thgu ituhg iotuhg ieuth guoierthg touhg uoth ut guotg uwht owuht \\\hline
\end{tabular}
\end{ajustbox}
\end{center}
\begin{tabular}{|l|l|} \hline
Some text. & lsibyg gihebg fiehbg etin vtn osuing iostnugetnug etouhg otunhoeuthg thgu ituhg iotuhg ieuth guoierthg touhg uoth ut guotg uwht owuht \\\hline
\end{tabular} \\
\end{document}
答案1
您不需要调整框。只需规定表格宽度,并为第二列使用“段落”列类型,例如p{<width>}
或在包X
中定义的列类型tabularx
:
\documentclass{exam}
\usepackage{tabularx}
%---------------- Show page layout. Don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{center}
\begin{tabularx}{0.7\linewidth}{|l|X|} % <---
\hline
Some text. & lsibyg gihebg fiehbg etin vtn osuing iostnugetnug etouhg otunhoeuthg thgu ituhg iotuhg ieuth guoierthg touhg uoth ut guotg uwht owuht \\
\hline
\end{tabularx}
\bigskip
\begin{tabularx}{\linewidth}{|l|X|} % <---
\hline
Some text. & lsibyg gihebg fiehbg etin vtn osuing iostnugetnug etouhg otunhoeuthg thgu ituhg iotuhg ieuth guoierthg touhg uoth ut guotg uwht owuht \\
\hline
\end{tabularx}
\end{center}
\end{document}
(红线表示页面布局)