0

I am trying to create a latex document containing a 3 column table where the first column should contain the date and the name of a day between 01.01.2020 till 31.12.2020 and the other two columns should be free to be filled out by hand on the printout. Each page should contain one month. If possible the weekends should be highlightes with color across the whole line.

Is it possible to have latex do that automatically so i just have to change the year when I need the 2021 file?

I am aware that this would be trivial with excel but I want to give latex a try.

6
  • 1
    Could you post a MWE on what you have tried so far? Commented Jan 30, 2019 at 12:26
  • right now i have not tried anything, because i have not the slightest idea where to start. sure i could create a table and fill in the dates an names by hand, but i have not the slightest idea if and how to "automate" the table.
    – patlabor
    Commented Jan 30, 2019 at 12:34
  • Might be useful: tex.stackexchange.com/questions/49414/… and Commented Jan 30, 2019 at 13:18
  • I am voting to close this question as it is too broad to be covered in a single answer. It is better to break your question in to multiple parts and ask them one-by-one instead. Thereby, it will be easy to answer small increments than creating all at once in do it for me fashion. Commented Jan 30, 2019 at 14:10
  • 2
    Maybe section 47 Calendar Library of the pgfmanual can be of use here.
    – user121799
    Commented Jan 30, 2019 at 14:10

1 Answer 1

2

A starting point could be by defining a small macro and a loop along with advdate and datetime packages as in

\documentclass[12pt]{article}
\usepackage{advdate}
\usepackage[dayofweek]{datetime}
\usepackage{array,longtable}
\newcount\fooo
\long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
% some help from this https://tex.stackexchange.com/questions/122807/inserting-day-of-the-week-into-custom-datetime-format
% some help from that
%https://tex.stackexchange.com/questions/122785/making-a-list-with-dates-for-labels-automatically-skipping-days
    \SetDate[01/01/2020]
    \newcounter{mycntr}
    \begin{document}
    \def\tabledata{} \fooo=365
    \loop
   \addto\tabledata{\AdvanceDate[\value{mycntr}]\today\stepcounter{mycntr} &  & \\
    \hline}
    \advance \fooo -1
    \ifnum \fooo>0
    \repeat 

    \begin{longtable}{|c|c|c|}
        \hline
        \tabledata
    \end{longtable}

\end{document}

This spit-outs more than 10 pages, hence, I wouldn't dare to post a screenshot of them ;)

Open-issue: Breaking the page based on the end of month. I don't yet know how to achieve it.

However, on the other hand, the OP can break the table manually by defining the SetDate and \fooo counter for every month followed by a \newpage command (which, might make life simpler, imho).

1

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