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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 6 down vote accepted

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}   
share|improve this answer
    
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 – Kelakaka Jan 24 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 at 18:30
    
That is what actually I'm looking for. Thanks. – Kelakaka Jan 24 at 19:12

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.