3

I have found a code for a calendar and would like to be able to write different tasks for each day. Basically, to make the command \daytext individual for each day. I have added an example with different text every day, which is not in the code. That is the question. How do I achieve the same result using only Tikz.

\documentclass[tikz]{standalone}
\usepackage{tikz,array}
\usetikzlibrary{calendar}
\begin{document}
\sffamily
\newcommand\daytext[2]{%
  \begin{tabular}{|>{\mdseries\tiny}r|p{1.5cm}|}
    \multicolumn{2}{c}{#1} \\
    \multicolumn{2}{c}{#2\color{black}} \\[1ex]
    \hline
     15:30 & \\\hline
     16:00 & \\\hline\hline
     16:30 & \\\hline
     17:00 & \\\hline\hline
     17:30 & \\\hline
     18:00 & \\\hline\hline
     18:30 & \\\hline
     19:00 & \\\hline\hline
     19:30 & \\\hline
     20:00 & \\\hline\hline
     20:30 & \\\hline
  \end{tabular}
}
\begin{tikzpicture}
  \calendar (cal)
  [dates=2021-08-16 to 2021-08-20,day list right,day xshift=3cm,
  day text={\daytext{\%wt}{\Huge\%d-}}]%\ooalign{\Huge\%d-\cr\hidewidth\raisebox{1cm}{\%wt}\hidewidth}}]
  if (weekend) [font=\bfseries]
  if (Sunday) [red];
\end{tikzpicture}
\end{document}

enter image description here

5
  • Your screenshot is uniform ... so I wonder, how it would look like, what you are trying to achieve? What would be different?
    – MS-SPO
    Commented Aug 15, 2021 at 21:12
  • 1
    I have now edited the picture and clarified the question. Commented Aug 16, 2021 at 8:32
  • 1
    I suggest having a look at ctan.org/pkg/schedule?lang=en . It seems to provide what you want. // Also check out the topics "Planning" and "Timetable" at CTAN.
    – MS-SPO
    Commented Aug 16, 2021 at 16:25
  • 1
    Thanks for the pointer! It looks like what I am after. Commented Aug 16, 2021 at 16:29
  • 1
    If so: Please share a solution with us. // The normal way to do it would be to "Ask Question" AND to checkmark "Answer your own question", lower left. // Perhaps you have to duplicate your question to do so (which is not so nice), or get some hint from more expereinced users here ;-) (Please)
    – MS-SPO
    Commented Aug 16, 2021 at 16:35

1 Answer 1

2

With help of the answer from @MS-SPO and the package schedule the problem has now been solved.

Thanks for the help!

\documentclass[border=2cm]{standalone}
\usepackage{schedule}

\begin{document}

\CellHeight{.4in}
\CellWidth{1in}
\TimeRange{15:00-21:00}
\SubUnits{15}
\BeginOn{Monday}
\TextSize{\tiny}
\FiveDay
\TwelveHour
\NewAppointment{meeting}{red}{white}
\NewAppointment{class}{green}{blue}

\begin{schedule}[Fall Quarter, 2021]
    \class{Transportation}{211}{W,Th}{15:30-16:50}
    \class{Ports}{307B}{W,Th}{19:15-20:45}
    \meeting{Office Hours}{Virtual}{T,F}{17:00-18:50}
\end{schedule}

\end{document}

enter image description here

You must log in to answer this question.

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