Notice: that question has been answered here, posted to be useful to the general public.
I am struggling to write a macro to use in circuitikz
to apply the change to arrow tips you can see here (which will be in 3.1.11) to work with older versions of TikZ.
I managed to separate the 3 values of the version, and to make a simple check with \ifnum
, but I find the thing not so elegant:
\documentclass[]{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\makeatletter
\def\ctikz@@pgfpgfversionsplit#1.#2.#3\ctikz@@pgfstop{\xdef\ctikz@@pgfmayor{#1}\xdef\ctikz@@pgfminor{#2}\xdef\ctikz@@pgfminorminor{#3}}
\expandafter\ctikz@@pgfpgfversionsplit\pgfversion\ctikz@@pgfstop
\xdef\mycheck{Not patched}
\ifnum\ctikz@@pgfmayor<3 \else % wrong, just the idea
%% more nested ifs here
\xdef\mycheck{Patching}
%% Henri Menke's code, see https://github.com/pgf-tikz/pgf/pull/1352
\pgfkeys{/pgf/arrow keys/fill/.code={%
\def\pgf@temp{#1}%
\ifx\pgf@temp\pgf@nonetext%
\pgfarrowsaddtooptions{\pgfarrowopentrue}%
\else\ifx\pgf@temp\pgfkeysnovalue@text%
\pgfarrowsaddtooptions{\pgfarrowopenfalse}%
\else
\pgfarrowsaddtooptions{\pgfarrowopenfalse\def\pgf@arrows@fill@color{#1}}%
\fi\fi
}}%
%% this does not work
\pgfkeys{/pgf/arrow keys/fill/.value required=false}%
\fi
\makeatother
\begin{document}
\makeatletter
Check-\ctikz@@pgfmayor-\ctikz@@pgfminor-\ctikz@@pgfminorminor-:\mycheck
\makeatother
\end{document}
Is there a more elegant way to check it? Notice that the code does load TikZ, and so PGF, but it could be used also in ConTeXt, so it must be basically plain TeX.
If you want to know how to "undo" \pgfkeys{/pgf/arrow keys/fill/.value required}
look at this comment by @muzimuzhi...