2

I've many "tikzpicture"s which are part of a "subfigure" environment. I don't want to use a global "\tikzstyle". I can write them in each of the "tikzpicture"s. This creates time, space, and editing issues.

Can I easily create local \tikzstyle that is only part of a subfigure?

5

Yes. you can do this on two ways:

  • use \tikzset (not tikzstyle, it is deprecated) and put them after \begin{tikzpicture}, for example

    \begin{tikzpicture}
    \tikzset{
        every node/.style = {draw, align= center, ...},
             arrow/.style = {thick,-{Latext[]} }
        ...
            }
    \node (first) {...};
    ...
    \end{tikzpicture}
    
  • include styles as tikzpicture options, for example:

    \begin{tikzpicture}[
        every node/.style = {draw, align= center, ...},
             arrow/.style = {thick,-{Latext[]} }
        ...
    ]
    \node (first) {...};
    ...
    \end{tikzpicture}
    

Is this what you asking for? Apparently not (according to your comment) , so ...

Upgrade: In the case, that you like to have common \tikzse{...} for a figure with number of sub figures, than put it after `\begin{table˙, something like this:

\begin{table}[htb]
    \centering
 \tikzset{
 every node/.style = {draw, align= center, ...},
      arrow/.style = {thick,-{Latext[]} }
        ...
            }
    \begin{subfigure}{<width>}
            \begin{tikzpicture}
    \node (first) {...};
    ...
    \end{tikzpicture}
             \end{subfigure}
    ... more subfigures ...
    \caption{...}\label{...}
    \end{figure}   
  • In subfigure, I had to write them into every tikzpicture. I'm looking something like a local definition for the subfigure. Or should I say, for every chapter, section etc. define local styles – kelalaka Jan 24 '16 at 18:25
  • 1
    My answer exactly do this. If you have in the mind something else, you should ask more clear, what you like to obtain. Now I guesing, that you like to have \tikzest "locally" for all sub figures in figure. If this is a case, than put ``tikzset` after \begin{figure}. – Zarko Jan 24 '16 at 18:30
  • That is what actually I'm looking for. Thanks. – kelalaka Jan 24 '16 at 19:12

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.