Undocumented useful commands in Tikz

\tikzstyle{...}=[...]


This command seems to be extremely useful since it allows to re-use the same style in multiple TikZ pictures.

Is is used in a few places in TikZ manual (pgfmanual.pdf), but why it is not defined or described?

What are the other useful commands not described in TikZ manual?

-
The documented command to define styles is \tikzset (see Section 11.4 of the version 2.00 manual). As a general warning: If possible never use undocumented commands. They might be dropped in later releases. –  Caramdir Aug 17 '10 at 18:45

The command \tikzstyle is not well documented because the author would like to encourage users to set styles locally instead. Styles should be declared

\begin{tikzpicture}[..., certain style/.style={...}, ...]
...
\en{tikzpicture}


This way the style belongs to that picture.

Perhaps read this message of the author Till Tantau: Keeping the tikzstyle command.

-
Till's message is encouraging do-repeat-yourself approach, which is strange. –  Łukasz Lew Aug 17 '10 at 18:49
What's the difference between tikzstyle and tikzset? –  Łukasz Lew Aug 21 '10 at 14:32
@Łukasz First \tikzsetis recommended by T Tantau, and then I think \tikzset is quicker than \tikzstyle because for compatibility \tikzstyle now uses pgfkeys or \tikzset is defined by \def\tikzset{\pgfqkeys{/tikz}} . Tantau writes also \pgfqkeys is quicker. –  Alain Matthes Mar 17 '11 at 15:47
If \tikzstyle is used inside the environment tikzpicture, it seems to be local to this environment,no ? and it's the same for tikzset but I agree with you with the fact that T Tantau recommends to define the styles locally. –  Alain Matthes Mar 17 '11 at 15:55
@ŁukaszLew: Just a very late reaction to your complaint. It's possible to write \tikzset{some style/.style = ...} anywhere in the document to globally create a style; the style doesn't have to be constructed in each individual picture. So repetition is not necessary. –  Ryan Reich Nov 30 '12 at 1:36
From the beamer manual you can find that there is a macro called \pgfdeclareimage (Section 13, Graphics). This can be used to load a graphics file with a reusable name, to be applied using \pgfuseimage. This is obviously best for cases where the image is repeated in the output file (it only needs to be included once in the PDF, saving on file size). \pgfdeclareimage takes an optional argument for graphics settings, in the same way as \includegraphics.