作为 LaTeX 的新手,我从这个网站上拼凑了 3 到 4 个片段来制作日历,如下所示:
\documentclass{article}
\begin{document}
\noindent
% p is for paragraph length
\begin{tabular}{@{}p{30em}@{}}
\begin{flushright}\vspace{-.5cm}{\huge February 2021}\end{flushright} \\
{\huge 15}~\hrulefill \\
Monday~\dotfill~Presidents' Day\\
\dotfill \\
\dotfill \\
\dotfill \\
\dotfill \\
{\huge 16}~\hrulefill \\
Tuesday~\dotfill \\
\dotfill \\
\dotfill \\
\dotfill \\
\dotfill \\
\end{tabular}
\end{document}
它看起来像这样:
然而,我试图弄清楚如何使February 2021
第一条实线之间的垂直空间比现在小得多(参见vspace
调用,但似乎不起作用。)理想情况下,我希望实线与当天数字的中间对齐,而不是底部。
我如何控制边距/填充?谢谢。
答案1
\documentclass{article}
\begin{document}
\noindent
% p is for paragraph length
\begin{tabular}{@{}p{30em}@{}}
\hfill{\huge February 2021}\\[-5pt]
{\huge 15}\hfill\rule[1ex]{27.5em}{1pt} \\
Monday~\dotfill~Presidents' Day\\
\dotfill \\
\dotfill \\
\dotfill \\
\dotfill \\
{\huge 16}\hfill\rule[1ex]{27.5em}{1pt} \\
Tuesday~\dotfill \\
\dotfill \\
\dotfill \\
\dotfill \\
\dotfill \\
\end{tabular}
\end{document}
但更简单:
\documentclass{article}
\textwidth30em\parindent0pt
\begin{document}
\hfill{\huge February 2021}\par\vspace{-.7em}
{\huge 15}\hfill\rule[1ex]{27em}{1pt} \par
Monday~\dotfill~Presidents' Day\par
\dotfill \par
\dotfill \par
\dotfill \par
\dotfill \par\medskip
{\huge 16}\hfill\rule[1ex]{27.5em}{1pt} \par
Tuesday~\dotfill \par
\dotfill \par
\dotfill \par
\dotfill \par
\dotfill \par
\end{document}