Making a list with dates for labels, automatically skipping days

Course Queries Syllabus Queries 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

I'm making my first syllabus in LaTeX and would like to know if there is a LaTeX-y way to generate the course schedule. Something like:

7/5 Friday: Read blah

7/8 Monday: Blah

7/10 Wednesday: Blah

7/12 Friday: Blah

The course is Monday-Wednesday-Friday, so I'm looking for a way to generate a list that will skip Tuesday, Thursday, Saturday and Sunday.

I realize that simply manually editing the labels to reflect the dates would be easy enough, there are only 40 or so class meetings, but is there a way (package or native commands I'm unfamiliar with) to do this in a more automated way? Especially because it would make using this syllabus as a template for future syllabi much easier.

profilepic.png
manpreet 2 years ago

Here is a starting point:

enter image description here

\documentclass{article}
\usepackage{advdate,datetime}% http://ctan.org/pkg/{advdate,datetime}
\newenvironment{schedule}
  {\par\longdate\renewcommand{\item}{\par%
    \stepcounter{mycntr}\ifnum\value{mycntr}>3\relax%
      \setcounter{mycntr}{0}\AdvanceDate[3]%
    \else
      \AdvanceDate[2]%
    \fi\today\quad}
  }{\par}
\newcounter{mycntr}
\begin{document}
\begin{schedule}
  \item Something
  \item Something else
  \item Relax
  \item Go to the sea
  \item Something
  \item Something else
  \item Relax
  \item Go to the sea
\end{schedule}
\end{document}

It would be possible to adjust the alignment as well as a starting date via an optional argument (say).


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.