xkeyval, xkeyval et tkz-tools
Bonjour,
J'ai récupéré le code source d'une macro définie dans le package `tkz-tools` écrit par Stéphane Pasquet afin de créer ma propre macro mais lors macro.
Lors de la compilation via PDFlatex je reçois le message d'erreur suivant `Undefined control sequence \define`.
\documentclass[12pt,a4paper]{article}
\usepackage[latin1,utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{lmodern}
\usepackage{fourier}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{xkeyval}
\begin{document}
\newcommand{\CrayonGris}
{
\draw (-0.3,0.6) -- (0,0) -- (0.3,0.6);
\draw[fill=black] (-0.1,0.2) -- (0.1,0.2) -- (0,0) -- cycle;%Pointe du crayon
\draw[fill=gray] (0.3,0.6) arc(90:180:0.1) arc(0:180:0.1) arc(0:180:0.1) arc(0:90:0.1) -- (-0.3,6) -- (0.3,6) -- cycle;%Corps du crayon
\draw (-0.2,6) -- (-0.2,0.55) (0,6) -- (0,0.55) (0.2,6) -- (0.2,0.55);%Traits verticaux
}
\begin{tikzpicture}
\CrayonGris
\end{tikzpicture}
%-----------> \tkzPen <-------------------
\definecolor{wood}{cmyk}{0.00,0.12,0.35,0.05}
\define@cmdkey[PAS]{tkzPen}{angle}{} % première ligne référencée par l'erreur signalée
\define@cmdkey [PAS] {tkzPen} {color}{}
\define@cmdkey [PAS] {tkzPen} {xscale}{}
\define@cmdkey [PAS] {tkzPen} {yscale}{}
\presetkeys [PAS] {tkzPen} {color = red, angle = 30, xscale=1, yscale=1}{}
%
\newcommand{\tkzPen}[2][]
{%
\setkeys[PAS]{tkzPen}{#1}
\begin{scope}[shift={(#2)},rotate=\cmdPAS@tkzPen@angle, xscale=\cmdPAS@tkzPen@xscale, yscale=\cmdPAS@tkzPen@yscale]
\fill[wood] (0,5) circle[x radius=5mm, y radius=2mm];
\fill[wood] (-0.5,1) to[bend right=30] (-0.25,1.2) arc (180:360:0.25cm) to[bend right=30] (0.5,1) -- (0,0) -- cycle;
\fill[fill=\cmdPAS@tkzPen@color] (116.565:2mm) -- (63.435:2mm) -- (0,0) -- cycle;
\fill[fill=\cmdPAS@tkzPen@color] (-0.5,5) -- (-0.5,1) to[bend right=30] (-0.25,1.2) arc (180:360:0.25cm) to[bend right=30] (0.5,1) -- (0.5,5) arc (0:-180:0.5cm and 0.2cm);
\fill[fill=\cmdPAS@tkzPen@color] (116.565:2mm) -- (63.435:2mm) -- (0,0) -- cycle;
\fill[\cmdPAS@tkzPen@color] (0,5) circle[x radius=1.5mm, y radius=0.5mm];
\draw (-0.5,5) -- (-0.5,1) -- (0,0) -- (0.5,1) -- (0.5,5) arc (0:-360:0.5cm and 0.2cm);
\draw (-0.25,4.82) -- (-0.25,1.2) arc(180:360:0.25cm and 0.25cm) -- (0.25,4.82);
\draw (-0.25,1.2) to[bend left=30] (-0.5,1);
\draw (0.25,1.2) to[bend right=30] (0.5,1);
\end{scope}
}
\tkzPen[angle=90,color=blue,xscale=0.5,yscale=0.75]{0,0}
\end{document}
\end{document}