当我将表格宽度限制为 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}
(红线表示页面布局)