Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 13 down vote accepted

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.

share|improve this answer
    
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
    
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
add comment

Your Answer

 
discard

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.