5

I read some documentation about how to create a new shape. But some things are still not clear to me. In fact I wanted to create a new shape representing a switch symbol: I did the code in tikzpicture environment. Here is the code:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes, arrows, fit}
\begin{document}

\newcommand\switch[0] {
    \begin{tikzpicture}
        \draw (0, 0) -- (1, 0) (1, 1) -- (2, 0) -- (3, 0);
        \draw [->, thick] (2, 1) .. controls +(left:5mm) and +(up:5mm) .. (1, 0);
    \end{tikzpicture}
}
\switch
\end{document}

Any suggestion is welcome.

Ruben
  • 13,448
user48343
  • 173
  • 1
    Instead of a new shape you can try with a pic (TiKZ 3.0), they are easier to understand and use. Some examples: http://tex.stackexchange.com/a/170686/1952, http://tex.stackexchange.com/a/151772/1952 – Ignasi Apr 11 '14 at 14:43

0 Answers0