1

I am trying to use the pdfcalendar library, but I think I'm confused by the definitions.

My Question: What kind of LaTeX counter/macro/variable can I use with pgfcalendar functions? Do I have to learn the TeX syntax? If so, will later issues arise when these TeX counters interact with LaTeX commands expecting LaTeX-style variables?

Background The TikZ manual specifies this function:

\pgfcalendardatetojulian{<date>}{<counter>}

and later, where the manual warns that the second argument must be a TeX counter, there is this function:

\pgfcalendarjuliantoweekday{<Julian day>}{<week day counter>}

How do I define <counter> and <week day counter>?

Can I use \newcounter{mycount} or \newcommand{\mycount}?

I've tried all combinations I can think of, and only got partial success.

Some googling led me to differences between TeX and LateX counters, but concludes that apart from syntactical variance, either was reasonably acceptable. But it seems that TikZ/pgfcalendar is wanting something quite specific.

MWE:

\documentclass{article}
\usepackage{tikz,pgfcalendar}
\begin{document} 
\newcommand{\myisodate}{2018-06-02}
\newcommand{\myjuliandatecommand}{}
\newcounter{myjuliandatecounter}
\newcounter{myweekdaycounter}
\newcommand{\myweekdaycommand}{}
\pgfcalendardatetojulian{\myisodate}{\myjuliandatecommand} %works, but prints the value, something I want to avoid.
% \pgfcalendardatetojulian{\myisodate}{myjuliandatecounter} %doesn't parse correctly
% \pgfcalendarjuliantoweekday{\myjuliandatecommand}{myweekdaycounter} %doesn't work
% \pgfcalendarjuliantoweekday{\myjuliandatecommand}{\myweekdaycommand} %doesn't work
\end{document}
  • 1
    pgfcalendar, or the whole pgf, is designed for both TeX and LaTeX. In this case you must use \newcount\mylovelycounter to declare a TeX-counter. – Symbol 1 May 24 '18 at 21:00
  • 1
    Basically, a LaTeX counter named name creates a TeX count named \c@name. – John Kormylo May 25 '18 at 21:49

Your Answer

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

Browse other questions tagged or ask your own question.