14

I read the answer for this question (inside a environment) but I would like to know if there is something more specific. LaTeX keeps the current environment in the macro \@currenvir but how do the test with the plain TEX format or the ConTEXt format.

Alain Matthes
  • 95,075

1 Answers1

15

TikZ has a command \tikzifinpicture that does the test:

\tikzifinpicture{true branch}{false branch}

However, the comments in the definition of the command (tikz.code.tex) say

% TT: This is a wrong
% test! Who uses this?...

So there may be a better way.

Andrey Vihrov
  • 22,325