TransWikia.com

Help! How do I draw this symbol in LaTeX?

TeX - LaTeX Asked on February 6, 2021

enter image description here

How to draw this symbol (2 straight lines with an arc) in LaTeX? Really need help on this one. Thanks!

2 Answers

Like this? Just to be a starting point.

documentclass[margin=3mm]{standalone}
usepackage{tikz}
usepackage{tkz-euclide}
usetikzlibrary{calc}

tikzset{%
startbutton/.pic = {%
draw [very thick](0,0)--++(-90:1);
draw [very thick](0,-2)coordinate(A)--++(-90:1);
draw [very thick](A)--++(125:1.1)coordinate(B);
draw [very thick]($(A)!0.45!(B)$)--++(180:0.75)coordinate(C);
draw [very thick]($(A)!0.55!(B)$)--++(180:0.68)coordinate(D);
tkzDrawArc[R,thick,fill,black]($(C)!0.5!(D)$, 4pt)(90,270)
}
}

begin{document}

begin{tikzpicture}
pic {startbutton};
end{tikzpicture}

end{document}

enter image description here

Answered by ferahfeza on February 6, 2021

The symbol is not in circuitikz, but you can build it if you insist... more or less.

documentclass[border=10pt]{standalone}
usepackage[siunitx, RPvoltages]{circuitikz}
begin{document}
begin{tikzpicture}[]
    ctikzset{bipoles/cuteswitch/thickness=0.5}
    draw (0,0) to [cosw, name=sw] ++(0,2);
    draw[thick, double, -{Arc Barb}] (sw.mid) -- ++(-0.5,0);
end{tikzpicture}
end{document}

enter image description here

If you want a larger "double line" and/or (thanks @Sebastiano!) you have to do a few tricky things:

  1. use a clip (well, inverse clip) to position the double line correctly and draw only the useful one;
  2. redraw the switch to remove the ugly clip-line composition.
documentclass[border=10pt]{standalone}
usepackage[siunitx, RPvoltages]{circuitikz}
begin{document}
%
% Thanks to Symbol1, Paul Gaborit etc. at
% https://tex.stackexchange.com/a/290508/38080
%
tikzset{
    clip even odd rule/.code={pgfseteorule}, % Credit to Andrew Stacey
    invclip/.style={
        clip,insert path=
            [clip even odd rule]{
                [reset cm](-maxdimen,-maxdimen)rectangle(maxdimen,maxdimen)
            }
    }
}
begin{tikzpicture}[]
    ctikzset{bipoles/cuteswitch/thickness=0.5}
    begin{scope}
        draw (0,0) to [cosw, name=sw, switches/scale=1.5] ++(0,2);
        % this "cuts out" from the path the triangle formed by the switch
        begin{pgfinterruptboundingbox}
            clip[invclip] (sw.in) -- ($(sw.in)!2!(sw.mid)$) -- (sw.out) -- cycle;
        end{pgfinterruptboundingbox}
        draw[thick, double, double distance=4pt, -{Arc Barb[]}] (sw.mid) ++(0.2,0) -- ++(-1.3,0);
    end{scope}
    %
    % redraw the switch to avoid the horrible junction!
    %
    draw (0,0) to [cosw, name=sw, switches/scale=1.5] ++(0,2);
end{tikzpicture}

end{document}

enter image description here

Answered by Rmano on February 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP