![我怎样才能将两段文本并排放置?](https://linux22.com/image/413909/%E6%88%91%E6%80%8E%E6%A0%B7%E6%89%8D%E8%83%BD%E5%B0%86%E4%B8%A4%E6%AE%B5%E6%96%87%E6%9C%AC%E5%B9%B6%E6%8E%92%E6%94%BE%E7%BD%AE%EF%BC%9F.png)
我是 LaTeX 新手,知识很少。我一直在尝试使用 minipage、grouping、flushleft/flushright 等技术,以便将 2 段文本(我喜欢将其想象为 MS Word 中调用的单独文本框)并排排列,并在顶部对齐。
由于我的知识非常有限,我无法提供任何 LaTeX 示例。
我将非常感激任何帮助。
答案1
有几种可能性:
\documentclass{article}
\begin{document}
\setlength\parskip{1cm}
\section*{tabular}
\begin{tabular}{p{3cm}p{4cm}}
\raggedright
some text here on the left some text here on the left &
\raggedleft
some more text on the right some more text on the right
\end{tabular}
\begin{tabular}{p{3cm}p{4cm}}
\centering
some text here on the left some text here on the left &
\centering
some more text on the right some more text on the right
\end{tabular}
\section*{parbox}
\parbox[t]{3cm}{
\raggedright
some text here on the left some text here on the left}%
\hspace{1cm}%
\parbox[t]{4cm}{
\raggedleft
some more text on the right some more text on the right}
\parbox[t]{3cm}{
\centering
some text here on the left some text here on the left}%
\hspace{1cm}%
\parbox[t]{4cm}{
\centering
some more text on the right some more text on the right}
\section*{minipage}
\begin{minipage}[t]{3cm}
\raggedright
some text here on the left some text here on the left
\end{minipage}%
\hspace{1cm}%
\begin{minipage}[t]{4cm}
\raggedleft
some more text on the right some more text on the right
\end{minipage}
\begin{minipage}[t]{3cm}
\centering
some text here on the left some text here on the left
\end{minipage}%
\hspace{1cm}%
\begin{minipage}[t]{4cm}
\centering
some more text on the right some more text on the right
\end{minipage}
\end{document}