Cómo "guardar" parámetros en \begin{tikzpicture}

Cómo "guardar" parámetros en \begin{tikzpicture}

Soy nuevo en el uso de tikz y cada vez que inserto un diagrama, pego el siguiente bloque (estoy escribiendo tarea de física, por lo que el tipo de imágenes que tengo que dibujar son casi siempre las mismas):

\begin{tikzpicture}[
    force/.style={>=latex,draw=blue,fill=blue},
    axis/.style={densely dashed,gray,font=\small},
    M/.style={rectangle,draw,fill=lightgray,minimum size=0.5cm,thin},
    m/.style={rectangle,draw=black,fill=lightgray,minimum size=0.3cm,thin},
    plane/.style={draw=black,fill=blue!10},
    string/.style={draw=red, thick},
    pulley/.style={thick},
]

Me gustaría acortar el comando que tengo que escribir. Tengo entendido que esos son "estilos" y que hay una manera de hacerlo, pero mis intentos con tikzset solo han producido resultados confusos. (Básicamente, lo que escribí en tikzset apareció como texto en la primera página del documento) Agradecería un poco de ayuda.

Respuesta1

Usar \tikzset:

\documentclass{article}
\usepackage{tikz}
\tikzset{    
    force/.style={>=latex,draw=blue,fill=blue},
    axis/.style={densely dashed,gray,font=\small},
    M/.style={rectangle,draw,fill=lightgray,minimum size=0.5cm,thin},
    m/.style={rectangle,draw=black,fill=lightgray,minimum size=0.3cm,thin},
    plane/.style={draw=black,fill=blue!10},
    string/.style={draw=red, thick},
    pulley/.style={thick},
}
\begin{document}
\begin{tikzpicture}
\draw[pulley] (0,0) -- (1,0);
% more code here
\end{tikzpicture}
\end{document}

información relacionada