Reputation
84,620
Next tag badge:
132/100 score
19/20 answers
Badges
18 219 460
Newest
 Nice Answer
Impact
~2.9m people reached

Jul
15
comment tikzmark and xelatex
@cfr Well, it does. If I change the node {\pgfmark{nA} to coordinate (nA) and adjust the line drawing code accordingly then it works. So it solves the problem in that it gives code that works as expected. As I said above, \tikzmark and \pgfmark should not be used inside a tikzpicture because that is effectively putting a tikzpicture inside a tikzpicture and this Should Not Be Done. So while there may well be an underlying bug that should be squished, as far as the MWE in this question it doesn't need squishing to get code that will do what is wanted.
Jul
15
comment pgf inside macro
@egreg A little more experimenting shows that pgfplots suffers from the same issues. Freezing semi-colons as active disrupts the \addplot parser. So I'm inclined to say that "catcodes are tricksy" and that delimited macros are a nightmare. Which is a shame as they can be quite useful.
Jul
15
comment pgf inside macro
@egreg The TikZ parser goes to quite extreme lengths to avoid issues with changing catcodes to make it "just work". Whoever wrote the declare function part didn't go to the same lengths. I don't think that's really a problem with declare function, I think rather whoever wrote the TikZ code is to be congratulated for going to such great lengths to avoid the issue. (A particularly neat trick is that an active ; is defined to expand to a non-active ; and then arguments are expanded in an \edef before the parser sees it.).
Jul
14
answered Tikz: Once punctured torus?
Jul
14
answered pgf inside macro
Jul
12
comment Corners of 3D cube extend beyond where they meet / tikz / draw
@GonzaloMedina Yes, the clipping approach does work here.
Jul
12
comment Corners of 3D cube extend beyond where they meet / tikz / draw
See also my answer here: tex.stackexchange.com/a/30102/86
Jul
12
comment Corners of 3D cube extend beyond where they meet / tikz / draw
Whoa! I didn't mean to unilaterally close this! Obviously, the rules have changed since I last voted to close a question. If the linked question doesn't answer your problem, edit your question to explain why and it'll get reopened.
Jul
12
comment pgf inside macro
Or you could redefine declare function to take an active semi-colon. Or you could be even more sophisticated and have it try to detect the catcode of ; at invocation time and behave according. Which is the right solution depends on how you are using semi-colons in the rest of the document.
Jul
12
comment pgf inside macro
The problem is with the semi-colon in the define function. Because you are using Babel, at the start of the document (but crucially not before), ; is made active. So the ; in the define function bit is an active semi-colon. However, the code executed by define function is expecting ; with catcode of other so it panics. The solution depends on what you're doing in the rest of the document. You can switch ; back to 12 using \shorthandoff{;} before the \mymacro call but then it is disabled inside the \mymacro call (and you need to switch it back on after).
Jul
12
comment pgf inside macro
What happens if you comment out all references to babel?
Jul
11
awarded  Nice Question
Jul
6
awarded  Nice Answer
Jul
2
awarded  Nice Question
Jun
11
awarded  Good Answer
Jun
9
comment Error with hobbyconvexpath
@JoachimBreitner I tried x=5mm and got a self-intersecting path, is that what you meant? What is happening, I think, is that the nodes are too close together and the path is tied to going through certain of their anchors so the algorithm ends up getting a bit expansive. Hobby's algorithm is not the right thing to use in every case, and in my experience it works best when there are a few points spaced out. This is probably one of those problems where there's not going to be a single best solution and you have to work on a case-by-case basis.
Jun
4
awarded  Good Answer
Jun
4
awarded  Nice Answer
May
30
awarded  Good Answer
May
27
comment How can I uncover the fraction line in beamer?
Mentionning \binom is perhaps a red herring. The key is using the \genfrac command upon which both \frac and \binom are based. You could even make an overlay-aware version of this to condense the code still further. Good answer.