我怎样才能让这些 \parbox 边距在 LaTeX 中更宽

我怎样才能让这些 \parbox 边距在 LaTeX 中更宽

我有以下命令,后面跟着我想要显示的文本。我附上了输出的显示。我希望顶部中间的文本有更宽的边距。我尝试使用 \textwidth 调整 \parbox 命令,但没有达到我想要的结果。

\newcommand\rexbox[1]{%
      \parbox{.333\textwidth}{#1}%
    }

\noindent\rexbox{\small City, State}\rexbox{\small This is the text that I want to be on multiple lines but would like the horiz. margins wider}\rexbox{\hfill \small Oct 2018}\\
\noindent City, State \hfill This is text that is fine on one line \hfill Oct 2018\\

在此处输入图片描述

答案1

您应该将其设置为tabularx(如果您不关心需要跨越页面边界的内容:

在此处输入图片描述

\documentclass{article}

\usepackage{tabularx}

\begin{document}

\noindent
\begin{tabularx}{\linewidth}{ @{} l X r @{} }
  City, State &
    This is the text that I want to be on multiple lines but would like the horiz. margins wider &
    Oct 2018 \\
  City, State &
    This is text that is fine on one line &
    Oct 2018
\end{tabularx}

\end{document}

在设置完其他(左对齐和右对齐)列之后,列的宽度X将拉伸以填充剩余的部分。\linewidthlr

相关内容