TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The \tikzmark command (as in here) does not work within the \PARENS command provided by the mtpro2 package.

Here is a MWE (requiring at least two runs):



\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

$$\PARENS{\tikzmark{a}1}$$ %With PARENS

$$\tikzmark{b}(1)$$ %Without PARENS

\tikz[overlay,remember picture] {
\draw (a) circle (1cm); %With PARENS - ends up at the bottom left corner of page
\draw (b) circle (1cm); %Without PARENS - works fine

Would appreciate any explanations and/or remedies. Thanks

share|improve this question
(I'm not able to test this right now, hence just a comment.) Try the pgfmark variant from the experimental tikzmark package. Search for TeX-SX Launchpad here for the link. – Loop Space Dec 19 '12 at 7:43
What about $$\tikzmark{a}\PARENS{1}$$ ? – JLDiaz Dec 19 '12 at 9:36
@JLDiaz In this example yes, but most of the time large matrices sit within \PARENS, and \tikzmark is used to mark different positions within these matrices – hwhm Dec 19 '12 at 9:44
Ah, I understand. What about $$\PARENS{{\tikzmark{a}}1}$$? – JLDiaz Dec 19 '12 at 10:44
@JLDiaz Doesn't work – hwhm Dec 19 '12 at 13:00
up vote 4 down vote accepted

I cannot test, because I do not have package mtpro2 installed. From source code analysis I would say, that \tikzmark is set twice in box \LRbox@ and a box inside macro \EXtest@. Since the former is used to typeset the result, \tikzmark is disabled in \EXtest@ to avoid duplicate \tikzmark's:


\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

share|improve this answer
The same I was thinking. It would be better if \LEFTRIGHT@ used a conditional, similarly to amsmath's \ifmeasuring@. – egreg Dec 19 '12 at 13:02
Great answer, thanks! – hwhm Dec 19 '12 at 13:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.