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}

internet
  • 569

1 Answers1

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

Rmano
  • 40,848
  • 3
  • 64
  • 125
  • 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 '22 at 08: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. https://ibb.co/YkrLYs9 – internet Dec 12 '22 at 08:24
  • Removing \kern-5pt seems to work for the minus sign but the plus sign is still not aligned. – internet Dec 12 '22 at 08: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 '22 at 08:45
  • Perfect! Thank you. I would be nice if this can be made built-in. – internet Dec 12 '22 at 08:52
  • Done. You can easily add that block to a style file... ;-) – Rmano Dec 12 '22 at 09:00
  • Thanks, that looks neat! Do you mean that do not put those commands inside tikzpicture? – internet Dec 12 '22 at 09:07
  • 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: https://tex.stackexchange.com/questions/34175/how-do-i-create-a-latex-package – Rmano Dec 12 '22 at 09:11