0

I have created a custom calendar for myself by using tikz picture. I want to rename the months in Turkish.

Ocak, \c{S}ubat, Mart, Nisan, May{\i}s, Haziran, Temmuz, A\u{g}ustos, Eyl\"{u}l, Ekim, Kas{\i}m, Aral{\i}k

I could not find any place where the names of the months are stored. Thus, I need your help. Here is my minimal working example.

\documentclass[10pt]{standalone}

\usepackage{tikz}

\usetikzlibrary{calendar}

\begin{document}

\begin{tikzpicture}
\matrix[column sep=1em, row sep=1em]{
  \calendar (m09) [dates=2018-09-01 to 2018-09-last,week list,month label above centered]; &
  \calendar (m10) [dates=2018-10-01 to 2018-10-last,week list,month label above centered]; &
  \calendar (m11) [dates=2018-11-01 to 2018-11-last,week list,month label above centered]; &
  \calendar (m12) [dates=2018-12-01 to 2018-12-last,week list,month label above centered]; &
  \calendar (m01) [dates=2019-01-01 to 2019-01-last,week list,month label above centered]; &
  \calendar (m02) [dates=2019-02-01 to 2019-02-last,week list,month label above centered]; &
  \calendar (m03) [dates=2019-03-01 to 2019-03-last,week list,month label above centered]; \\
};
\end{tikzpicture}

\end{document} 
1

Warning:

This is a hackish solution, not a good one.


The calendar library uses the \translate command (from the translator package) around the month names, so you should, in principle, only have to load the translator package with your language option. I couldn't get it to work...

So you can redefine the \pgfcalendarmonthname to suit your needs:

\def\pgfcalendarmonthname#1{%
  \ifcase#1\or Ocak\or \c{S}ubat\or Mart\or Nisan\or
  May{\i}s\or Haziran\or Temmuz\or A\u{g}ustos\or
  Eyl\"{u}l\or Ekim\or Kas{\i}m\or Aral{\i}k\fi
}

full MWE:

\documentclass[10pt]{standalone}

\usepackage{tikz}

\usetikzlibrary{calendar}

\begin{document}

\def\pgfcalendarmonthname#1{%
  \ifcase#1\or Ocak\or \c{S}ubat\or Mart\or Nisan\or
  May{\i}s\or Haziran\or Temmuz\or A\u{g}ustos\or
  Eyl\"{u}l\or Ekim\or Kas{\i}m\or Aral{\i}k\fi
}

\begin{tikzpicture}[
  every calendar/.style = { week list,month label above centered },
  fullmonth/.style = {
    dates = #1-01 to #1-last
  },
]
\matrix[column sep=1em, row sep=1em]{
  \calendar (m09) [fullmonth = 2018-09]; &
  \calendar (m10) [fullmonth = 2018-10]; &
  \calendar (m11) [fullmonth = 2018-11]; &
  \calendar (m12) [fullmonth = 2018-12]; &
  \calendar (m01) [fullmonth = 2019-01]; &
  \calendar (m02) [fullmonth = 2019-02]; &
  \calendar (m03) [fullmonth = 2019-03]; \\
};
\end{tikzpicture}

\end{document}

If you prefer to write the month name manually, you can use the month text option to achieve the same result:

\documentclass[10pt]{standalone}

\usepackage{tikz}

\usetikzlibrary{calendar}

\begin{document}

\begin{tikzpicture}[
  every calendar/.style = { week list,month label above centered },
  fullmonth/.style = {
    dates = #1-01 to #1-last
  },
]
\matrix[column sep=1em, row sep=1em]{
  \calendar (m09) [fullmonth=2018-09, month text = {Eyl\"{u}l}]; &
  \calendar (m10) [fullmonth=2018-10, month text = {Ekim}]; &
  \calendar (m11) [fullmonth=2018-11, month text = {Kas{\i}m}]; &
  \calendar (m12) [fullmonth=2018-12, month text = {Aral{\i}k}]; &
  \calendar (m01) [fullmonth=2019-01, month text = {Ocak}]; &
  \calendar (m02) [fullmonth=2019-02, month text = {\c{S}ubat}]; &
  \calendar (m03) [fullmonth=2019-03, month text = {Mart}]; \\
};
\end{tikzpicture}

\end{document}
  • Thank you for the answer. Is it possible to type the months manually into the matrix at aproopriate places? – bkarpuz Oct 5 '18 at 21:18
  • 1
    @bkarpuz Yes, it is. See my edit. – Phelype Oleinik Oct 5 '18 at 21:32
  • Oh not like that, I mean without defining \pgfcalendarmonthname. By typing the month names at matrix nodes manually. – bkarpuz Oct 5 '18 at 21:46
  • @bkarpuz Drat, I messed up the edit. Now it's the way it should be. – Phelype Oleinik Oct 5 '18 at 21:47

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.