我希望实现如下的对齐,array
优先考虑环境:
abcde fghijk
lmnnnnn opq
rstuvwxyz
因此,abcde
和lmnnnnn
左对齐;fghijk
和右对齐。和opq
之间有一些空格。abcde
fghijk
rstuvwxyz
与前两行左对齐;将其放在其所在行的中央也是可以的……
有人可以帮忙吗?
答案1
我肯定误解了你的问题......
看一下这段代码:
\documentclass{report}
\usepackage{amsmath,array}
\begin{document}
\emph{Something like this (in math mode)?}
\vspace{10pt}
\(
\begin{array}{@{}l@{}r@{}}
\text{abcde}&\text{fghijk}\\
\text{lmnnnnn}&\text{opq}\\
\text{rstuvwxyz}
\end{array}
\)
\vspace{20pt}
\emph{or like this?}
\vspace{10pt}
\(
\begin{array}{@{}p{0.85cm}r@{}}
\text{abcde}&\text{fghijk}\\
\text{lmnnnnn}&\text{opq}\\
\text{rstuvwxyz}
\end{array}
\)
\vspace{20pt}
\emph{Or something like this (in text mode)?}
\vspace{10pt}
\begin{tabular}{@{}l@{}r@{}}
abcde&fghijk\\
lmnnnnn&opq\\
rstuvwxyz
\end{tabular}
\vspace{20pt}
\emph{or like this?}
\vspace{10pt}
\begin{tabular}{@{}p{0.85cm}r@{}}
abcde&fghijk\\
lmnnnnn&opq\\
rstuvwxyz
\end{tabular}
\end{document}