4

Continuing on from my question posted yesterday, I struck a similar problem with the \Edge macro of tkz-graph when attempting to define text labels - with \usetikzlibrary{babel} loaded compile ERROR !Undefined control sequence.\cmdGR is flagged. The fix provided for the previous question, if applied here, raises !Package xkeyval Error: '/tikz/handle active characters in nodes' undefined in families 'edge'; as demonstrated for \Edge[...](C)(B)

\documentclass{article}
% RN. 21 October 2017
\usepackage[utf8]{inputenc}
\usepackage[greek,ngerman,french,english]{babel}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usepackage{tkz-graph}
%\usetikzlibrary{babel}
\begin{document}
\section{Alain Matthes: tkz-graph}
\begin{tikzpicture}
\SetUpEdge[lw = 1.5pt,
color = orange,
labelcolor = gray!30,
labelstyle = {draw}]
\SetGraphUnit{3}
\GraphInit[vstyle=Normal]
\Vertex{P}
\NOEA(P){B}
\SOEA(P){M}
\SOEA(B){C}
%\Edge[/tikz/handle active characters in nodes=false,label=bc](C)(B)
\Edge[label=bp](B)(P)
\Edge[label=pm](P)(M)
\Edge[label=cm](C)(M)
\Edge[label=bm](B)(M)
\end{tikzpicture}
\end{document}
1

Rather than applying the fix of the other question (Incompatibility between `\usetikzlibrary{babel}` and `tkz` macros `\tkzRep` and `\tkzDrawLine`) to \Edge, you can put the edge commands within a scope where the fix is applied:

Sample output

\documentclass{article}
% RN. 21 October 2017
\usepackage[utf8]{inputenc}
\usepackage[greek,ngerman,french,english]{babel}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usepackage{tkz-graph}
\usetikzlibrary{babel}
\begin{document}
\section{Alain Matthes: tkz-graph}
\begin{tikzpicture}
\SetUpEdge[lw = 1.5pt,
color = orange,
labelcolor = gray!30,
labelstyle = {draw}]
\SetGraphUnit{3}
\GraphInit[vstyle=Normal]
\Vertex{P}
\NOEA(P){B}
\SOEA(P){M}
\SOEA(B){C}
\begin{scope}[/tikz/handle active characters in nodes=false]
\Edge[label=bc](C)(B)
\Edge[label=bp](B)(P)
\Edge[label=pm](P)(M)
\Edge[label=cm](C)(M)
\Edge[label=bm](B)(M)
\end{scope}

\end{tikzpicture}
\end{document}

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.