我正在写一份关于右对齐和右不等对齐之间的差异的报告。我试图通过将两列相邻(多列)来展示它们之间的差异。我该怎么做才能让它们具有不同的对齐方式,而不会影响整个文档?
答案1
答案2
\documentclass{article}
\usepackage{array}
\newcommand\sometext{You are my sunshine, my only sunshine, you make
me happy when skies are gray, you'll never know dear, how much I
love you, please don't take my sunshine away}
\begin{document}
\noindent
\begin{tabular}{%
>{\raggedright\arraybackslash}p{5cm}% ragged right
% >{\centering\arraybackslash}p{5cm}% ragged on both sides
% >{\raggedleft\arraybackslash}p{5cm}% ragged left
p{5cm}% justified
}
\sometext & \sometext
\end{tabular}
\end{document}