4

How can I define a

stylename/.style={...}

in the preamble so that all tikzpicture environments could reference it instead of defining this style inside of each tikzpicture?

CarLaTeX
  • 62,716
bp2017
  • 3,756
  • 1
  • 13
  • 33
  • 1
    It seems very stange that nobody asked it before, but I can't find a duplicate :). By the way, thank you for accepting my answer! – CarLaTeX Aug 31 '17 at 04:24
  • @CarLaTeX https://tex.stackexchange.com/questions/42800/ and https://tex.stackexchange.com/questions/54796/ are similar. (Duplicates, if any of these can be counted as such, are often difficult to find though.) – Torbjørn T. Aug 31 '17 at 09:46
  • @TorbjørnT. You're right. It is very similar to: https://tex.stackexchange.com/q/42800/101651 but not a perfect duplicate, and your other link is specific for arrows tip, whereas this one is generic. I'd leave it open. – CarLaTeX Aug 31 '17 at 09:50

1 Answers1

4

Just put:

\usepackage{tikz}
\tikzset{%
    stylename/.style={...},
    anotherstlye/.style={...},% and so on
}

in your preamble, and you'll be able to use stylename and anothetstyle in all the tikzpictures of your document.

CarLaTeX
  • 62,716