I have defined a command for the jacobian matrix, such as follows


The problem comes if I try to use it inside a tikzcd arrow, probably because of problems with interepreting the brackets. I want to write something like this:

    \mathbb{R}^{2} \arrow[r,"\Jacobian[p]{f}"] &

And have an output as if I had typed

    \mathbb{R}^{2} \ar[r, "\operatorname{J}_{p}{f}"] &

But if I try this, compilation fails with

ERROR: Argument of \tikz@quote@@parser has an extra }.

--- TeX said ---
<inserted text> 
l.152     \end{tikzcd}

--- HELP ---
From the .log file...

I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

I tried putting braces in some reasonable places without success.


You have to enclose the whole command in braces inside the quotes.

    \mathbb{R}^{2} \arrow[r,"{\Jacobian[p]{f}}"] &
  • 1
    You should edit your question instead of posting an answer. If there is now an answer, many people will ignore your question. – user156344 Nov 6 '18 at 12:13

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.