2

Why can’t I use \llbracket in the following example?

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,graphs,graphs.standard,quotes}
\usepackage{stmaryrd}

\begin{document}
\begin{tikzpicture}

\def\a{{
"\llparenthesis"
,"\llbracket" % With this line, it fails!
,"\llparenthesis"
}}

\draw (0,1) node{$\llparenthesis$};
\draw (1,1) node{$\llbracket$};

\foreach \x in {0,1}
{\draw (\x, 0) node {$\pgfmathparse{\a[\x]}\pgfmathresult$};} % (*)

\end{tikzpicture}
\end{document}
  1. Using \llparenthesis and \llbracket in normal draw works
  2. Using \llparenthesis works when using it in \pgfmathparse, indexing from array, whereas llbracket in the same place doesn’t (line (*))
  3. Both commands are from the stmaryrd package (not including the package doesn’t doesn’t allow 1.).

Activating the commented line produces this error:

! Package PGF Math Error: Unknown operator 4' or44' (in '{ "\llparenthesis " ,"\delimiter "444A471 " ,"\llparenthesis " }[0]'). See the PGF Math package documentation for explanation.

3

It's because one of them is a character \mathcar"444C hence "<char>" works off the bat. The other one is actually a macro expanding to \delimiter "444A471 and needs to be protected from expansion to avoid tripping up the math parser.

So you need

\def\a{{%
"\llparenthesis"%
,"\noexpand\llbracket"%
,"\llparenthesis"%
}}

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.