5

I have defined (for example) :
tikzstyle{text_st} =[thick, red, sloped]

Later on, I want to use these option for node text like
\path (a) -- (b) node[text_st] {Nice}

Now, if I want to use this predefined option text_st except for the sloped, how can I do that? Is there some variable like unsloped such that I can do
\path (a) -- (b) node[text_st, unsloped] {Nice}?

1 Answers1

2

The manual could have been better here but this is actually a boolean setting key. It sets the TeX conditional \ifpgfslopedattime

Hence when you have a style, you can turn the sloped effect off with setting it to false

\documentstyle[tikz]{standalone}

\tikzset{text_st/.style={thick, red, sloped}}

\begin{document}
\begin{tikzpicture}[every node/.style={text_st,draw}]
%....
\path (a) -- (b) node[text_st,sloped=false] {Nice};
\end{tikzpicture}
\end{document}
percusse
  • 157,807