作者chungyuandye (养花种鱼数月亮赏星星)
看板LaTeX
标题Re: [问题] 请问在tabular环境下,设定完栏宽後的对 …
时间Mon Aug 10 15:04:20 2009
※ 引述《wacomnow (无忧)》之铭言:
: 在网路上查到,要设定栏宽可用p{2in}命令,
: 但是设定完後,所有的栏位就都靠左对齐了>_<
: 请问我要要置右对齐的话该怎麽加入参数..因为我再加入r会被认为
: 是新的一栏..感谢
试试下面的语法
\documentclass{article}
\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
\begin{document}
\begin{tabular}{cp{1in}}
xxx & \multicolumn{1}{l}{Some ragged right text. Some ragged right text.}\\
yyy & \multicolumn{1}{l}{Some ragged right text. Some ragged right text.}\\
\end{tabular}
\begin{tabular}{cp{1in}}
xxx & \PreserveBackslash\raggedright
Some ragged right text. Some ragged right text.\\
yyy & \PreserveBackslash\raggedleft
Some ragged right text. Some ragged right text.
\end{tabular}
\end{document}
--
养花种鱼数月亮赏星星
http://cydye1069.blogspot.com
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.232.166.240
1F:→ wacomnow:好像试了但不太管用,但还是谢谢了! 08/16 04:52