babel
was called without language option, which prevents compilation. I just noticed it when I used the convenient online compiler option (well, the mentioned slashbox too).Stefan
babel
was called without language option, which prevents compilation. I just noticed it when I used the convenient online compiler option (well, the mentioned slashbox too).NEW: TikZ book now 40% off at Amazon.com for a short time.
\documentclass
but then removed it again and forgot to parse it to babel.I haven't wuite understoof what you exactly want to calculate how. (maybe I'm too tired and should go to bed...) Can you give me a pseudo-code example?svend_tveskaeg wrote:I am not sure how to combine the two solution, in order to get yours but with week numbers modulo 52.
Sure!cgnieder wrote:Can you give me a pseudo-code example?
Code: Select all
\documentclass{article}\newcounter{week}\setcounter{week}{49}\newcommand\week[1]{Week~<CODE>}\begin{document}\begin{tabular}{lccccc}& \week{1} & \week{2} & \week{3} & \week{4} & \week{5} \\& \week{2} & \week{3} & \week{4} & \week{5} & \week{1} \\& \week{3} & \week{4} & \week{5} & \week{1} & \week{2} \\& \week{4} & \week{5} & \week{1} & \week{2} & \week{3} \\& \week{5} & \week{1} & \week{2} & \week{2} & \week{4}\end{tabular}\end{document}
Code: Select all
Week 49 Week 50 Week 51 Week 52 Week 1Week 50 Week 51 Week 52 Week 1 Week 49Week 51 Week 52 Week 1 Week 49 Week 50Week 52 Week 1 Week 49 Week 50 Week 51Week 1 Week 49 Week 50 Week 51 Week 52
Code: Select all
521
Code: Select all
\documentclass{article}\newcounter{week}\setcounter{week}{49}% \modulo by @egreg (http://tex.stackexchange.com/a/34449/5049)\def\truncdiv#1#2{((#1-(#2-1)/2)/#2)}\def\moduloop#1#2{(#1-\truncdiv{#1}{#2}*#2)}\def\modulo#1#2{\number\numexpr\moduloop{#1}{#2}\relax}\def\weeknum#1{\the\numexpr\modulo{#1+\value{week}-1}{52}\relax}\newcommand\week[1]{week~\ifnum\weeknum{#1}=0\relax52\else\weeknum{#1}\fi}\begin{document}\begin{tabular}{lccccc}& \week{1} & \week{2} & \week{3} & \week{4} & \week{5} \\& \week{2} & \week{3} & \week{4} & \week{5} & \week{1} \\& \week{3} & \week{4} & \week{5} & \week{1} & \week{2} \\& \week{4} & \week{5} & \week{1} & \week{2} & \week{3} \\& \week{5} & \week{1} & \week{2} & \week{3} & \week{4}\end{tabular}\end{document}
NEW: TikZ book now 40% off at Amazon.com for a short time.