2

As a rank newbie to LaTeX I have cobbled together 3 or 4 snippets from this site to make a calendar, as follows:

\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}

And it looks like this:

enter image description here

However I am trying to figure out how to make the vertical space between February 2021 and the first solid line much smaller than it is (see vspace invocation, which does not seem to work.) Ideally, I'd like the solid lines to be aligned at the middle of the day numbers rather than the bottom also.

How do I control margins/padding? Thanks.

1
  • 1
    All lists (flushright} add extra space, so it is better to not use them. Using \hfill instead will align the bottom of the y in February with the top of 15, so it takes negative \vspace to overlap them. Jul 12, 2021 at 17:08

1 Answer 1

2

mwe

\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}

But simpler:

\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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .