To change the shaded color of the \rule{...}{...}
command, one solution is
\textcolor{blue}{\rule{2cm}{2cm}}
but I want to know how can I directly change the color of this command globally?
colorrules
To change the shaded color of the \rule{...}{...}
command, one solution is
\textcolor{blue}{\rule{2cm}{2cm}}
but I want to know how can I directly change the color of this command globally?
Best Answer
You could do
But it may be better to instead define a new
\colorrule
command and use that instead, as you may find\rule
is used in unexpected places so if you redefine it you may be changing more than you want to change.If you need to override this sometimes it's probably better to use a colour such as
rulecolor
rather thanblue
that you can (re)define when needed: