Andrew Stacey


About
Andrew Stacey
Information about my research, teaching, and other interests.

By: Andrew Stacey
Contact details


Andrew Stacey


blosxom icon


Mon, 11th Jan 2010 (HowDidIDoThat :: Unix)

Generating Lecture Filenames

My lecture presentations are contained in one big LaTeX file. To produce each individual lecture, I use symlinks to this particular file. The LaTeX code looks at the \jobname command to see how it was called, and produces the corresponding lecture. Part of this involves generating the symlinks - automatically of course.


The basic code is:

for f in {wednesday,friday}; do
 for g in {0..15}; do
  for h in {beamer,trans,handout}; do
   ln -s lectures.tex lecture.$h.$(date -d "$f + $g weeks" +%F).tex
  done
 done
done

Of course, replace the days of the week by the correct days, and the length of the semester by the correct length (and offset if not run on the first week of the semester). Minor adjustments for breaks and holidays need doing afterwards.

[Full link]
Last modified on:
Tue, 27th Jul 2010