1

If February starts at the beginning of the month, the month label appears; otherwise, it doesn't:

\documentclass{article}
\usepackage[margin = 2.5cm, a4paper]{geometry}
\pagestyle{empty}
\usepackage[brazil]{babel}
\usepackage{fontspec}
\setmainfont{Alegreya Sans}
\usepackage{tikz}
\usetikzlibrary{calendar,positioning,shapes}


\def\pgfcalendarmonthname#1{ \translate{\ifcase#1\or Janeiro\or Fevereiro\or Março\or Abril\or Maio\or Junho\or Julho\or Agosto\or Setembro\or Outubro\or Novembro\or Dezembro\fi} }

\def\pgfcalendarmonthshortname#1{ \translate{\ifcase#1\or Jan\or Fev\or Mar\or Abr\or Mai\or Jun\or Jul\or Ago\or Set\or Out\or Nov\or Dez\fi} }

\def\pgfcalendarweekdayshortname#1{ \translate{\ifcase#1\or Seg\or Ter\or Qua\or Qui\or Sex\or Sab\or Dom\fi} }

\def\pgfcalendarweekdayname#1{ \translate{\ifcase#1\or Segunda\or Terça\or Quarta\or Quinta\or Sexta\or Sábado\or Domingo\fi} }

\tikzstyle{xis}=[cross out, draw,thick,draw=red!50,very thick]


\begin{document}
\noindent
\begin{tikzpicture}
[every day/.style={anchor=mid},every node/.style={inner sep=2pt,rectangle,thick},gray]
\calendar (cal) [dates=2019-02-22 to 2019-06-14, 
%month list, 
%month label left,%
week list,%
month label above centered,%
month text=\textcolor{black}{\%mt},
%every month/.append style={anchor=base east, 
%xshift=-2em},
month yshift=2em,
every month/.append style={yshift=-5em,xshift=-8em}
]
%
%if (Tuesday) [black]
%if (Friday) [black]
if (Sunday) [red]
if (Saturday) [blue]
if (Friday) [black,nodes={thick,draw=red!50}]
if (equals=2019-03-15) [nodes={cross out,draw,very thick}]
if (equals=2019-04-19) [nodes={cross out,draw,very thick}]
;
\end{tikzpicture}

\medskip 

\tikz[baseline=-3pt] \node[xis] at (0,0) {15/03};~~~Semana dos calouros

\medskip 

\tikz[baseline=(char.base)]{ \node[xis] (char) at (0,0) {19/04};}~~~ Sexta-Feira Santa

%don't know which baseline is better, left both options


\end{document}

I've also done some weird tweaking to get months left aligned:

every month/.append style={yshift=-5em,xshift=-8em}

Maybe there is a better option for this.

2

Month texts are only added on the first of every month, but it is possible to add additional ones:

\documentclass{article}
\usepackage[margin = 2.5cm, a4paper]{geometry}
\pagestyle{empty}
\usepackage[brazil]{babel}
%\usepackage{fontspec}
%\setmainfont{Alegreya Sans}
\usepackage{tikz}
\usetikzlibrary{calendar,positioning,shapes}


\def\pgfcalendarmonthname#1{ \translate{\ifcase#1\or Janeiro\or Fevereiro\or Março\or Abril\or Maio\or Junho\or Julho\or Agosto\or Setembro\or Outubro\or Novembro\or Dezembro\fi} }

\def\pgfcalendarmonthshortname#1{ \translate{\ifcase#1\or Jan\or Fev\or Mar\or Abr\or Mai\or Jun\or Jul\or Ago\or Set\or Out\or Nov\or Dez\fi} }

\def\pgfcalendarweekdayshortname#1{ \translate{\ifcase#1\or Seg\or Ter\or Qua\or Qui\or Sex\or Sab\or Dom\fi} }

\def\pgfcalendarweekdayname#1{ \translate{\ifcase#1\or Segunda\or Terça\or Quarta\or Quinta\or Sexta\or Sábado\or Domingo\fi} }

\tikzstyle{xis}=[cross out, draw,thick,draw=red!50,very thick]


\begin{document}
\noindent
\begin{tikzpicture}
[every day/.style={anchor=mid},every node/.style={inner sep=2pt,rectangle,thick},gray,
]
\calendar (cal) [dates=2019-02-22 to 2019-06-14, 
%month list, 
%month label left,%
week list,%
month label above centered,%
month text=\textcolor{black}{\%mt},
%every month/.append style={anchor=base east, 
%xshift=-2em},
month yshift=2em,
every month/.append style={yshift=-5em,xshift=-8em},
execute at begin day scope=
{
    \ifdate{equals=2019-02-22}{
        \node at (-8em,0em) [anchor=base east] {\small\tikzmonthtext};
    }{}
},
]
%
%if (Tuesday) [black]
%if (Friday) [black]
if (Sunday) [red]
if (Saturday) [blue]
if (Friday) [black,nodes={thick,draw=red!50}]
if (equals=2019-03-15) [nodes={cross out,draw,very thick}]
if (equals=2019-04-19) [nodes={cross out,draw,very thick}]
;
\end{tikzpicture}

\medskip 

\tikz[baseline=-3pt] \node[xis] at (0,0) {15/03};~~~Semana dos calouros

\medskip 

\tikz[baseline=(char.base)]{ \node[xis] (char) at (0,0) {19/04};}~~~ Sexta-Feira Santa

%don't know which baseline is better, left both options


\end{document}

enter image description here

1
  • @Joseph My pleasure! – user180639 Feb 7 '19 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy