I saw some tricks here Problem with babel and tikz using \draw
but it seems I can't use them.
If I say in my MWE
\usepackage[ngerman]{babel}
\usepackage[autostyle=true,german=quotes]{csquotes}
and later
\def\Symbol{X}
\pgfmathsetlengthmacro\symbolwidth{0.5*width("\Symbol")},
he gives me
! Package PGF Math Error: Unknown function `X' (in '0.5*width("X")').
What have I to do?
% I need
% arara: lualatex
% if this is an important info.
\documentclass{article}
% needed: ======
\usepackage[ngerman]{babel}
\usepackage[autostyle=true,german=quotes]{csquotes}
% needed: ======
\usepackage{tikz}
\usetikzlibrary{babel}
\def\Symbol{X}
\begin{document}
\section{Quotation Marks}
\enquote{test}
\glqq test 2\grqq
\section{TikZ}
% needed: ======
\pgfmathsetlengthmacro\symbolwidth{0.5width("\Symbol")}
\pgfmathsetlengthmacro\symbolheight{0.5height("\Symbol")}
\begin{tikzpicture}[x=\symbolwidth, y=\symbolheight]
\node[draw]{\Symbol};
\end{tikzpicture}
\end{document}


\Symbolis irrelevant and alsocsquotes. Apparently the syntax is broken even if thebabellibrary is used. – egreg Jun 12 '20 at 17:11