左对齐列宽 {p{cm}}

左对齐列宽 {p{cm}}

我正在尝试创建一个类似的表格:

Idioms                Definition 

A dime                Anything that is common, inexpensive, 
a dozen               and easy to get or available any where. 
Beat around           To treat a topic, but omit its main points, 
the bush              often intentionally or To delay or avoid
                      talking about something difficult or unpleasant.
Bite off more         To take on more responsibility than you can manage.
than one can chew

...

我所做的是

 \documentclass{book}
    \begin{document}
    \thispagestyle{empty}
    \noindent
    \begin{tabular}{p{6cm} p{12cm}}
    Idioms & Definitions
    {The Remaining portions of work goes here.} 
    \end{tabular}
    \end{document}

但我明白

成语定义

A         dime        Anything that is common, inexpensive, 
a dozen               and easy to get or available any where. 
Beat       around     To treat a topic, but omit its main points, 
the     bush          often intentionally or To delay or avoid
                      talking about something difficult or unpleasant.
Bite off       more   To take on more responsibility than you can manage.
than one can chew

...

我认为这与对齐有关。上面的示例与我在 Latex 中得到的示例并不完全相同。但它反映了我的问题。使用 l 代替 p,我可以获得所需的左对齐。但没有表格大小。但是使用固定大小,对齐就会出错。

序言中的一些元素可能缺失,例如我使用了 setspace 和 anysize 等包。

来源:上面的表格摘自维基百科,用于代表我的情况。

答案1

使用tabularx\RaggedRight

\documentclass{book}
\usepackage{tabularx,ragged2e}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{ 
  @{} % no \tabcolsep on the left side
  >{\RaggedRight}p{6cm}% let the p column typeset ragged right
  X % dynamical column width 
  @{} % no \tabcolsep on the right side
 }
    Idioms & Definitions
    {The Remaining portions of work goes here.} 
\end{tabularx}
\end{document}

相关内容