How to draw this symbol (2 straight lines with an arc) in LaTeX? Really need help on this one. Thanks!
Asked
Active
Viewed 205 times
0
-
Welcome to LaTeX.SE!! What do you mean by "this symbol"? Do you only want the arrow, or adding the secant line with 2 straight lines? – manooooh Sep 30 '20 at 01:31
-
Electronic device? Tikz? CircuiTikz? https://ctan.org/pkg/circuitikz – pluton Sep 30 '20 at 01:32
-
I'd like to draw the parallel lines with the arc on it. It is not available in the circuitikz manual. – Chowlo Sep 30 '20 at 01:40
2 Answers
1
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--++(-90:1);
\draw very thickcoordinate(A)--++(-90:1);
\draw very thick--++(125:1.1)coordinate(B);
\draw very thick--++(180:0.75)coordinate(C);
\draw very thick--++(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}
-
Is it possible to just make an arc instead of a semi circle? Thanks btw! This is already big help. – Chowlo Sep 30 '20 at 01:50
-
@Chowlo, try removing the fill command from the \tkzDrawArc line. – N. F. Taussig Sep 30 '20 at 09:36
-
@Chowlo, your welcome. Remove
fillcommand as said @N.F.Taussig and usexshift, such as\tkzDrawArc[R,thick,black,xshift=1.25mm]($(C)!0.5!(D)$, 4pt)(90,270). – Sep 30 '20 at 10:31
1
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}
If you want a larger "double line" and/or (thanks @Sebastiano!) you have to do a few tricky things:
- use a clip (well, inverse clip) to position the double line correctly and draw only the useful one;
- 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}
Rmano
- 40,848
- 3
- 64
- 125
-
1Just an humble comment after my positive vote. Do you put the black straight line above instead in background? – Sebastiano Sep 30 '20 at 12:08
-
Yes, to simplify things (to have the anchor position). But you are right, wait a minute... – Rmano Sep 30 '20 at 12:56
-
1Very kind not to worry and no urgency was necessary. Mine was just a simple suggestion. :-) It was not necessary to include me in your addendum. So I get very emotional :-) and red in my face. :-) – Sebastiano Sep 30 '20 at 15:00



