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.

How do I do a definecolor in a /.style?

         inputnode/.style={shape=ellipse,draw,inner sep=2pt,minimum size=5.0mm},

doesn't work.

share|improve this question
Does this post help: tex.stackexchange.com/questions/19190/… –  cmhughes Sep 25 '11 at 1:48

1 Answer 1

up vote 6 down vote accepted

You can define a /.code (or /.code 2 args, or /.code n args) key that executes your desired code. To define a new color within a style, you could define a key

    define color/.code 2 args={

Your example could look like this



    define color/.code 2 args={
            inner sep=2pt,
            minimum size=5mm
         define color={dpred}{0.80,0.35,0}

\node [/IMMstyle,inputnode,fill=dpred] {x};

share|improve this answer

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.