2

For the documentation of an electronic product I need to typeset the sign shown in the picture linked below. Who knows how to do this? Solutions that say "just add it as a picture" are not considered helpful…

image

A quick websearch for "center positive sign latex" did not lead to anything particulary useful.

  • Personally, I don't remember that among the common symbols there is the symbol you are looking for. Surely the best solution is to draw it or with circuitikz and make it a symbol with a macro. – Sebastiano Dec 9 '18 at 20:00
7

Using tikz you can draw:

enter image description here

using the code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\tikzset{
  circ/.style={circle,draw, inner sep=0mm, minimum width=10pt}
}
\newcommand\widget{%
\begin{tikzpicture}[thick]
     \draw[fill=black](0,0) circle (2pt);
     \draw ([shift=(45:5pt)]0,0) arc [start angle=45, end angle=315, radius=5pt];
     \node[circ] at (-1,0) {-};
     \node[circ] at (1,0) {\tiny +};
     \draw($ (-1,0)+(5pt,0) $)--(-5pt,0);
     \draw(0,0)-- ($ (1,0)-(5pt,0) $);
  \end{tikzpicture}
}
\begin{document}

  \widget

\end{document}

EDIT

As pointed out in the comments, the code above does not play well when used with dvipdfm to compile from LaTeX to PDF (compiling with LaTeX is fine but dvipdfm produces errors). Looking at tikz driver dvipdfm for positioning suggested the following modifications, which seem to fix this:

\documentclass{article}
\def\pgfsysdriver{pgfsys-dvipdfmx.def}

\usepackage{tikz}
\usetikzlibrary{calc}
\tikzset{
  circ/.style={circle,draw, inner sep=0mm, minimum width=10pt}
}
\newcommand\widget{%
\begin{tikzpicture}[thick]
     \draw[fill=black](0,0) circle (2pt);
     \draw ([shift=(45:5pt)]0,0) arc [start angle=45, end angle=315, radius=5pt];
     \node[circ] at (-1,0) {-};
     \node[circ] at (1,0) {\tiny +};
     \draw($ (-1,0)+(5pt,0) $)--(-5pt,0);
     \draw(0,0)-- ($ (1,0)-(5pt,0) $);
  \end{tikzpicture}
}
\begin{document}

  \widget

\end{document}

That is, you need to add \def\pgfsysdriver{pgfsys-dvipdfmx.def}.

  • never used tikz before so i will Need some time to understand whats going on here but looks very promising. i m gonna test this out. end then encapsulate this into a custom command b/c im not gonna paste this everywhere where needed…. – der bender Dec 11 '18 at 13:56
  • tried this out and it doesnt work Right out of the box... what are you compiling this with? Latex->dvi->pdf ? because everything else in my original document is compiled this way changing to latex->ps will be no real solution to the original problem – der bender Dec 11 '18 at 13:58
  • just saw you already made custom command so i m just renaming it to what i Need... – der bender Dec 11 '18 at 14:05
  • btw is the Tiny command really needed for the plus sign while not for the minus sign? this Looks kinda suspicious to me – der bender Dec 11 '18 at 14:09
  • @derbender These days most people compile straight to PDF using pdflatex. I just checked and compiling from latex to dvi to PDF also works. If you are getting compilation errors the most likely reason is that you need to update your TeX distribution. I am using TexLive 2018. I agree that using \tiny only on the + sign looks strange, but this produces a "symbol" that is closer to what appears in the OP. Probably the reason for this is that TeX does some fancy things with dashes so that -, -- and --- all do different things. – Andrew Dec 11 '18 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.