2

Is there a simple and accurate possibility to use comma as decimal mark in a label of circuitikz (with or without the siunitx option)?

comma as decimal mark in circuitikz

I mean simpler then use this: l=${0,\!2}\,\mathrm{A}$ (The circuit above was drawn using this option.)

I tried three possibilities, but all of them worked just with point. Two possibilities can be seen in this example, and it gives an error message, if a change point to comma:

\begin{circuitikz} \draw
(0,0) -- (0,2)
    to[ammeter, l_=$0.2\,A$] (4,2)
    to[generic] (4,0)
    to[battery1] (0,0)
(0.5,0) -- (0.5,-1)
      to[voltmeter,l_=1.5<\volt>] (3.5,-1) -- (3.5,0)
;
\end{circuitikz}

When I used l_=$\SI{0,2}{\ampere}$, the comma was translated to point.

  • Could you please make your code into a complete document? It should either compile or it should give the error you're asking about when we try to compile it. – cfr Nov 24 '15 at 21:46
3

In your second example, siunitx is used, so you can add \sisetup{output-decimal-marker={,}} to the preamble.

\documentclass[border=4mm]{standalone}
\usepackage[siunitx]{circuitikz}
\sisetup{output-decimal-marker={,}}
\begin{document}
\begin{circuitikz} \draw
(0,0) -- (0,2)
    to[ammeter, l_=0.2<\ampere>] (4,2)
    to[generic] (4,0)
    to[battery1] (0,0)
(0.5,0) -- (0.5,-1)
      to[voltmeter,l_=1.5<\volt>] (3.5,-1) -- (3.5,0)
;
\end{circuitikz}
\end{document}
|improve this answer|||||

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.