Making a list with dates for labels, automatically skipping days

Course Queries Syllabus Queries 3 years ago

5.11K 2 0 0 0

User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 3 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.

0 views
0 shares

profilepic.png
manpreet 3 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.

Similar Forum