TransWikia.com

Few issues with Tikz Calendar

TeX - LaTeX Asked by nathan31 on January 9, 2021

I have been trying to implement my own agenda since those from the store never really satisfied me. I have now more or less what I wanted to get. I still have minor issues I can’t workaround. So if someone has any tips :

  1. I display only Monday, Thursday and Friday on the calendar (that appears on each weekly page in the upper right corner). So far the only working solution I have found is a negative "xshift" on days I don’t want to display, otherwise, a blank space remains. But for some reason, it works fine except on weeks where the monday beglon to another month than the Thursday and Friday. In that case, a larger blank space is added for some reason, and I don’t know why.

  2. The calendar displayed on each page do not show the last vertical line whilst it is written in the tabular definition I use for the daytext…

  3. The names of the days and the month refuse to translate to french, and I cant figure out why, I paid attention to the usepackage position but still, it does not work.

  4. A great icing would be to display a different calendar depending on the week (the value of n in my code, some calendar if n is odd, another if n is even). I don’t know how to do that.

A regular week with issues 2 and 3
A regular week with issues 2 and 3
The ugly week with issue 1 (and 2 and 3 for that matters)
The ugly week with issue 1 (and 2 and 3 for that matters)

Thanks a lot for any input!
Cheers!

My code below :

documentclass{article}
usepackage{advdate}

makeatletter
renewcommandAdvanceDate[1][@ne]{globaladvanceday#1 FixDate}
makeatother

usepackage{tgheros,tikz,array}
usetikzlibrary{calendar}
usepackage[margin=1.25in,noheadfoot=true]{geometry}
usepackage[french]{babel}
usepackage[french]{translator}


%=========================================================
%== Page characteristics (Page Setup) ====================
setlength{textwidth}{126mm}
setlength{textheight}{230.0mm}
setlength{topmargin}{-30mm}
setlength{hoffset}{-20mm}
setlength{marginparwidth}{-20mm}
setlength{footskip}{0mm}
setlength{headheight}{11mm}
setlength{headsep}{4mm}
setlength{parindent}{0cm}
%=========================================================

usetikzlibrary{backgrounds, positioning, scopes}
newcommand{textoverline}[1]{$overline{mbox{#1}}$}
usepackage[absolute,overlay,showboxes]{textpos}
usepackage{xcolor}
usepackage{colortbl}
definecolor{mygrey}{RGB}{239,239,239}
usepackage{lastpage}
usepackage{fancyhdr}
begin{document}

setlength{arrayrulewidth}{0.1pt}
sffamily
footnotesize

newcommandmondaytext[2]{%
  begin{tabular}{|>{mdseriesfootnotesize}cp{1cm}|cp{1cm}|}
    multicolumn{2}{c}{#1 #2} 
    hline
    begin{tabular}{@{}c@{}}8:35  9:30end{tabular}&  hline
    begin{tabular}{@{}c@{}}9:30  10:25end{tabular} & textbf{4D} hlinehline
    begin{tabular}{@{}c@{}}10:40  11:35end{tabular} & textbf{4B}hline
    begin{tabular}{@{}c@{}}11:35  12:30end{tabular} & hlinehline
    begin{tabular}{@{}c@{}}12:30 13:05end{tabular}  & hlinehline
    begin{tabular}{@{}c@{}}13:0514:00 end{tabular}  & hline
    begin{tabular}{@{}c@{}}14:0014:55 end{tabular} & begin{tabular}{@{}c|c@{}}&textbf{4B}end{tabular}hlinehline
    begin{tabular}{@{}c@{}}15:1016:05 end{tabular}& textbf{4C}hline
  end{tabular}
}
newcommandthursdaytext[2]{%
  begin{tabular}{|>{mdseriesfootnotesize}cp{1cm}|cp{1cm}|}
    multicolumn{2}{c}{#1 #2} 
    hline
    begin{tabular}{@{}c@{}}8:35  9:30end{tabular}& textbf{4D} hline
    begin{tabular}{@{}c@{}}9:30  10:25end{tabular} & textbf{4B}hlinehline
    begin{tabular}{@{}c@{}}10:40  11:35end{tabular} & textbf{4C}hline
    begin{tabular}{@{}c@{}}11:35  12:30end{tabular} & hlinehline
    begin{tabular}{@{}c@{}}12:30 13:05end{tabular}  & hlinehline
    begin{tabular}{@{}c@{}}13:0514:00 end{tabular}  & begin{tabular}{@{}c|c@{}}textbf{4D}&end{tabular}hline
    begin{tabular}{@{}c@{}}14:0014:55 end{tabular} & hlinehline
    begin{tabular}{@{}c@{}}15:1016:05 end{tabular}& hline
  end{tabular}
}
newcommandfridaytext[2]{%
  begin{tabular}{|>{mdseriesfootnotesize}p{1cm}|cp{1cm}|}
    multicolumn{2}{c}{#1 #2} 
    hline
    begin{tabular}{@{}c@{}}8:35  9:30end{tabular}& textbf{DF:3C} hline
    begin{tabular}{@{}c@{}}9:30  10:25end{tabular} & textbf{4D} hlinehline
    begin{tabular}{@{}c@{}}10:40  11:35end{tabular} & hline
    begin{tabular}{@{}c@{}}11:35  12:30end{tabular} & hlinehline
    begin{tabular}{@{}c@{}}12:30 13:05end{tabular}  & hlinehline
    begin{tabular}{@{}c@{}}13:0514:00 end{tabular}  & begin{tabular}{@{}c|c@{}}& textbf{4C}end{tabular} hline
    begin{tabular}{@{}c@{}}14:0014:55 end{tabular} & textbf{4D}hlinehline
    begin{tabular}{@{}c@{}}15:1016:05 end{tabular}& textbf{4C}hline
  end{tabular}
}

setlength{skipfootins}{0cm}
pagestyle{empty}
SetDate[31/08/2020]
foreach n in {1,...,45}{

begin{textblock}{8}(2,1.25)

  textblockcolour{mygrey!40}
  vspace{5mm}
    { qquad bfseries Notes : }
  vspace{26mm}

  vspace{25mm}
end{textblock}
begin{textblock}{15}(2,14.5)

  textblockcolour{mygrey!40}
  vspace{2mm}
    { quad bfseries Remarques : }
  vspace{18mm}
end{textblock}
enlargethispage{40pt}
setlength{arrayrulewidth}{0.5pt}
arrayrulecolor{black}
LARGE PLANNING DE LA SEMAINE n footnotesize
begin{tikzpicture}[remember picture, overlay,shift={(5,-3.5)}]
  calendar (cal)
  [dates=year-month-day to year-month-day+5,day list right,day xshift=3cm,
   execute before day scope=
  {
    ifdate{Tuesday,Wednesday}{pgftransformxshift{-3cm}}{}
    },
    day text={},
    execute at begin day scope={
    ifdate{Monday}{tikzmonthcode}{}},
    set style={{every month}+=[anchor=base east,font=bfserieslarge,xshift=-2.5em,yshift=12em]},
%  execute after day scope={ifdate{Sunday}{pgftransformyshift{-30em},pgftransformxshift{-10.1cm}}{}}
  ]
  if(Monday) [day text={mondaytext{%wt}{%d0}}]
  if(Thursday) [day text={thursdaytext{%wt}{%d0}}]
  if(Friday) [day text={fridaytext{%wt}{%d0}}]  
  if (weekend) [font=bfseries]
  if (Sunday) [red];
%  node[above right,font=bfseriesfootnotesize] at (cal-2020-09-14.north west)
%    {14--18 Septembre 2020};
end{tikzpicture}






















setlength{arrayrulewidth}{0.1pt}
arrayrulecolor{black!60}
begin{tabular}{p{19cm}}
textbf{LUNDI :} 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 

textbf{JEUDI :} 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 

textbf{VENDREDI :} 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
hline 
end{tabular}

AdvanceDate[7]

newpage
}

end{document}

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP