I want to create a new command with some default TikZ options that you can override using an optional argument. If working as intended the code below would generate a red line between A and B, and a translucent green line with arrows between A and C. How can I accomplish this?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\newcommand{\relation}[3][]
{
% this needed to be modified somehow...
\path [draw, red] (#2) -- (#3);
}
\begin{tikzpicture}
\node [draw] (A) at (0, 0) {A};
\node [draw] (B) at (3, 0) {B};
\node [draw] (C) at (3, 3) {C};
\relation{A}{B}
\relation[<->, color=green!10]{A}{C}
\end{tikzpicture}
\end{document}
draw,red,#1
and it's good to go. However, it is better to usedraw=red
such that you can easily override it withdraw=none
without having the red color set for fill etc.