我正在写论文,想将一些文本移到同一行的左侧/中间/右侧。例如,我想将论文审阅者放在左侧,将考试委员会放在右侧,我该怎么做?
我的代码是
\begin{small}
\begin{center}
\textit{Examination Committee}
\\ \vspace{4pt} Prof.
\\ \vspace{4pt} Prof.
\\ \vspace{4pt} Prof.
\end{center}
\begin{center}
\textit{Thesis reviewers}
\\ \vspace{4pt} Prof.
\\ \vspace{4pt} Prof.
\end{center}
\end{small}
答案1
另外,一列tabularx
有三列,第一列和最后一列左对齐以占据其自然宽度,中间一列为X
列类型以占用剩余的水平空间。
\documentclass[12pt]{article}
\usepackage{tabularx}
\begin{document}
\begingroup
\small
\renewcommand*{\arraystretch}{1.5}
\noindent
\begin{tabularx}{\linewidth}{@{}lXl@{}}
\textit{External Reviewers} & & \textit{Examination Commitee} \\
Prof.\@ John Doe & & Prof.\@ Dr.\@ Jane Doe \\
Prof.\@ Dr.\@ Max Mustermann & & Prof.\@ Lieschen M\"uller \\
& & Prof.\@ Nomen Nescio
\end{tabularx}
\endgroup
\end{document}
答案2
可以将两个块设置tabular
为增加行高。然后,一个块中的行可以左对齐,但右侧块可以向右移动:
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[2]
\vspace{2em}
\begingroup
\small
\renewcommand*{\arraystretch}{1.5}
\noindent
\begin{tabular}[t]{@{}l@{}}
\itshape External Reviewers\\
Prof.\@ John Doe\\
Prof.\@ Dr.\@ Max Mustermann\\
\end{tabular}\hfill
\begin{tabular}[t]{@{}l@{}}
\itshape Examination Commitee\\
Prof.\@ Dr.\@ Jane Doe\\
Prof.\@ Lieschen M\"uller\\
Prof.\@ Nomen Nescio\\
\end{tabular}
\endgroup
\end{document}