6

How can I make the voltage plus/minus signs bolder?

The setting circuitikz/voltage/american font=\boldmath works, but it is not bold enough.
It would be nice if there is something which can be placed and applied whenever I create a new components without having to specify coordinate and place them myself.

(Please check the boldness of the voltage plus/minus signs only in the image below.)

Enter image description here

And the plus/minus sign inside the voltage source as well:

Enter image description here

\documentclass[tikz, border=1cm]{standalone}
\usepackage[american, siunitx]{circuitikz}

\begin{document}
\begin{tikzpicture}[ ultra thick]
\begin{scope}
 circuitikz/voltage/american font=\boldmath
 \draw (7,0) to [
R=R1, v=V1] ++(3,0) node[right]  {boldmath};
\end{scope}
\draw [yshift=-2cm] (7,0) to [
R=R1, v=V1] ++(3,0) node[right]  {default};
\end{tikzpicture}
\end{document}

1 Answer 1

10

The matter would be to find a font with a suitable boldness for you, and then use the keys to change the default chars.

Otherwise, you can build your symbols with basic TeX rules or, if you like, with picture mode (do not use a tikzpicture though):

\documentclass[tikz, border=1cm]{standalone}
    \usepackage[american, siunitx]{circuitikz}

\newcommand{\pluuus}{%
    \vrule width 8pt height 5pt depth -3pt\relax
    \kern-5pt\vrule width 2pt height 8pt\kern3pt\relax
}
\newcommand{\miiinus}{%
    \vrule width 8pt height 5pt depth -3pt\relax
}
\ctikzset{voltage/american plus=\pluuus}
\ctikzset{voltage/american minus=\miiinus}
\ctikzset{bipoles/vsourceam/inner plus=\pluuus}
\ctikzset{bipoles/vsourceam/inner minus=\miiinus}


\begin{document}
\begin{tikzpicture}[thick,
    circuitikz/inductors/thickness=0.5]

    \draw (0,0) to [cute inductor, v^=$V_L$] ++(3,0);
    \draw (0,0) to [V, l=V, invert] ++(0,3);
    % go back to standard, check alignement
    \ctikzset{voltage/american plus=$+$}
    \ctikzset{voltage/american minus=$-$}
    \draw [thin, red, dashed] (0,0) to[cute inductor, v^=$V_L$] ++(3,0);  

\end{tikzpicture}
\end{document}

enter image description here

The relevant part in the manual is

enter image description here

and for the voltage generator symbol

enter image description here

8
  • Thanks, I see how it works now. I was thinking that you would need to manually do that for every symbol. Anyway, about the plus/minus in the voltage source, first I tried this \ctikzset{bipoles/vsourceam/inner plus={\large $\textbf{+}$}} \ctikzset{bipoles/vsourceam/inner minus={\large $\textbf{-}$}} and it does increase the font size and boldness but not enough I still want it bolder. So I tried a second method as you mentioned.
    – internet
    Dec 12, 2022 at 8:24
  • I set \ctikzset{bipoles/vsourceam/inner plus={ \vrule width 8pt height 5pt depth -3pt\kern-5pt\vrule width 2pt height 8pt\relax}} \ctikzset{bipoles/vsourceam/inner minus={\kern-5pt\vrule width 8pt height 5pt depth -3pt\relax}} but the plus/minus isn't aligned inside the voltage source. ibb.co/YkrLYs9
    – internet
    Dec 12, 2022 at 8:24
  • Removing \kern-5pt seems to work for the minus sign but the plus sign is still not aligned.
    – internet
    Dec 12, 2022 at 8:39
  • Yes, you have to go back to the end of the sign otherwise LaTeX thinks that the symbol ends at the end of the vertical bar: \ctikzset{bipoles/vsourceam/inner plus={\vrule width 8pt height 5pt depth -3pt\kern-5pt\vrule width 2pt height 8pt\kern3pt\relax}} (and probably you need the same for the external ones, it's just less visible, I'll fix the answer when I can)
    – Rmano
    Dec 12, 2022 at 8:45
  • 1
    If you want the same appearance for all the circuits, sticks them in the preamble; you can even create your own little package with the settings: tex.stackexchange.com/questions/34175/…
    – Rmano
    Dec 12, 2022 at 9:11

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.