
私はこのexam
クラスを問題用紙の準備に利用しようとしています。最初のページの上部に、時間、日付、最高点数を入力する必要があります。このために、tabular
下の MWE に示すように、中央揃えでセクションを作成しました。
しかし、列間の間隔を均等にして、ページ全体に線を広げたいのですが、どうすれば実現できるでしょうか?
\documentclass[12pt,a4paper,addpoints,answers]{exam}
\begin{document}
\begin{center}
\Large \textbf{XXX}\\
\large \textbf{XXX}\\
\textbf{XXX}\\
\textbf{XXX}
\end{center}
\begin{center}
\begin{tabular}{ c c c }
\textbf{Time: 3 Hours} & \textbf{Date: 07.12.2019} & \textbf{Max. Marks: 100}
\end{tabular}
\end{center}
\end{document}
答え1
こんなものがほしいですか?
\documentclass[12pt,a4paper,addpoints,answers]{exam}
\begin{document}
\begin{center}
\Large \textbf{XXX}\\
\large \textbf{XXX}\\
\textbf{XXX}\\
\textbf{XXX}
\end{center}
\textbf{Time: 3 Hours} \hfill \textbf{Date: 07.12.2019} \hfill \textbf{Max. Marks: 100}\\
\hrule % or \hrulefill if necessary.
\end{document}
あなたが達成したいことを達成するには、表形式を使用する必要はないと思います。
答え2
tabular*
および\extracolsep
(パッケージなし)も使用できます。
\documentclass[12pt,a4paper,addpoints,answers]{exam}
\begin{document}
\begin{center}
\Large \textbf{XXX}\\
\large \textbf{XXX}\\
\textbf{XXX}\\
\textbf{XXX}
\end{center}
\begin{center}
\tabcolsep=0pt% visably affects spacing on far right edge
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} c c c }
\textbf{Time: 3 Hours} & \textbf{Date: 07.12.2019} & \textbf{Max. Marks: 100}
\end{tabular*}
\end{center}
\end{document}
答え3
(この方法でtabularx
は 3 つの列の幅が同じになります)
\documentclass[12pt,a4paper,addpoints,answers]{exam}
\usepackage{tabularx}
\begin{document}
\begin{center}
\Large \textbf{XXX}\\
\large \textbf{XXX}\\
\textbf{XXX}\\
\textbf{XXX}
\end{center}
\begin{tabularx}{\linewidth}{X>{\centering}X>{\raggedleft}X}
\textbf{Time: 3 Hours} & \textbf{Date: 07.12.2019} & \textbf{Max. Marks: 100}
\end{tabularx}
\end{document}
答え4
中央部分をメイン ヘッダーの下に中央配置します。右側部分と左側部分の幅を 0 にするだけで十分です。
\documentclass[12pt,a4paper,addpoints,answers]{exam}
\usepackage{showframe} % just for the example
\begin{document}
\begin{center}\bfseries
\Large
XXX
\large
XXX\\
XXX\\
XXX
\normalsize
\bigskip
\makebox[0pt][l]{Time: 3 Hours}\hfill
Date: 07.12.2019\hfill
\makebox[0pt][r]{Max. Marks: 100}
\end{center}
\end{document}
このshowframe
パッケージは、テキスト ブロックの余白を表示するためにのみ使用されます。