Every draw style

There is no every draw available. One possible way is to style every path.

\documentclass{article}
\usepackage{tikz}
\begin{document}
    \begin{tikzpicture}[every path/.style={->,red,thick}]
    \draw(0,0)node[left]{$ A $}--(5,0)node[right]{$ B $};
    \end{tikzpicture}
\end{document}

enter image description here

An alternative solution is to globally set draw for every picture. In this way, color specification does not affect node!

\documentclass{article}
\usepackage{tikz}
\tikzset{every picture/.style={->,draw=red,thick}}
\begin{document}
    \begin{tikzpicture}
    \draw(0,0)node[left]{$ A $}--(5,0)node[right]{$ B $};
    \end{tikzpicture}
\end{document}

enter image description here


As other answers have said, you can set every path, but that changes the node styles. One way around this is to set every node just afterwards:

Sample output

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[every path/.style={->,red,thick},
  every node/.style={draw,blue,thin}]
  \draw(0,0)--(5,0) node[rectangle] {XX} -- (5,-1);
\end{tikzpicture}

\end{document}

Tags:

Draw

Tikz Pgf