Based on a given starting time, I'd like to automatically calculate a time table. Based on https://groups.google.com/forum/#!topic/de.comp.text.tex/BQrRUYmDrHw I put the following MWE together:




    \advance\hours by \addhrs\relax%
    \advance\minutes by \addmins\relax%
    \advance\minutes by -60\relax%
    \advance\hours by 1\relax%
    \advance\minutes by 60\relax%
    \advance\hours by -1\relax%
    \advance\hours by -24\relax%
    \advance\hours by 24\relax%

            \begin{tabular}{l l l}
                top1 & \startTime{} -- \add\startTime{01:00}\startTime & \textcolor{red}{01:00}\\ 
                top2 & \startTime{} -- \add\startTime{00:45}\startTime & \textcolor{red}{00:45}\\ 
                top3 & \startTime{} -- \add\startTime{00:15}\startTime & \textcolor{red}{00:15}\\ 
                Sum & \textcolor{red}{09:30} -- \startTime

Now the question:

How can I insert the red denoted times automatically as well? [In values in the third column are the durations]

enter image description here

1 Answer 1


I'm confused as it seems that the red times at the end of the rows are just the durations that are added to \startTime and that the red entry at the bottom of the second column is just the initial start time...so all you need to do is remember these values.

Assuming this is the case if you add these definitions to your preamble:

    Top\arabic{top}&\startTime{}--\add\startTime{#1}\startTime& #1\\}
    \tabular{lll}Heat & Time & Duration\\\hline}%
  {\hline Sum& \InitialStartTime--\startTime\endtabular}

then you can generate your table with:


This produces:

enter image description here


You must log in to answer this question.

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