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.


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.

  • Thanks I imagined to test something but not ` \pgfutil@ifundefined{filldraw}` – Alain Matthes Mar 3 '12 at 9:17
  • 5
    I need to send a mail to TT : TT: This is a wrong test! Who uses this?... me ! – Alain Matthes Mar 3 '12 at 9:22
  • 1
    The macro works fairly well -- but not for nested pictures (i.e. it says "true" even if the current picture is temporarily interrupted). – Christian Feuersänger Mar 3 '12 at 18:17

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.