Wie drehe ich das Amperemeter in Circuitikz, sodass das „A“ im Symbol eine horizontale Grundlinie verwendet?

Wie drehe ich das Amperemeter in Circuitikz, sodass das „A“ im Symbol eine horizontale Grundlinie verwendet?

Ich habe gerade angefangen, Latex zu verwenden. Ich verwende das Circuitikz-Paket. Immer wenn ich ein Voltmeter oder Amperemeter in einen vertikalen Abschnitt zeichne, wird das „A“ oder „V“ gedreht. Wie kann ich die horizontale Grundlinie verwenden? Und wie entferne ich den Pfeil im Amperemeter oder Voltmeter?

\documentclass{article}
\usepackage[american,siunitx,smartlabels]{circuitikz}

\begin{document}
\begin{figure}
\begin{circuitikz}
\draw (0,0)
to [sV=5V] (0,2)
to [R,l=$R_s$] (0,4)
to [C,l=$C$] (4,4)
to [short] (6,4);
\draw (6,0)
to [D] (6,4);
\draw (6,4)
to [short] (8,4)
to [R,l=$R_m$] (8,2)
to [ammeter] (8,0)
to [short] (0,0);

\end{circuitikz}
\end{figure}
\end{document}

Bildbeschreibung hier eingeben

Antwort1

Dies ist eine mögliche Lösung. Kommentare im Code helfen, die Methodik zu verstehen:

\documentclass[border=10pt]{standalone}
\usepackage[american,siunitx,smartlabels]{circuitikz}

\ctikzset{bipoles/ammeter/text rotate/.initial=0,% <=new key
rotation/.style={bipoles/ammeter/text rotate=#1},% style for ease introduction in code
}

% code from pgfcircbipoles.sty
\makeatletter
\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ammeter/height}}{ammeter}{\ctikzvalof{bipoles/ammeter/height}}{\ctikzvalof{bipoles/ammeter/width}}{
    \def\pgf@circ@temp{right}
    \ifx\tikz@res@label@pos\pgf@circ@temp
        \pgf@circ@res@step=-1.2\pgf@circ@res@up
    \else
        \def\pgf@circ@temp{below}
        \ifx\tikz@res@label@pos\pgf@circ@temp
            \pgf@circ@res@step=-1.2\pgf@circ@res@up
        \else
            \pgf@circ@res@step=1.2\pgf@circ@res@up
        \fi
    \fi

    \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}       
    \pgfpointorigin \pgf@circ@res@other =  \pgf@x  \advance \pgf@circ@res@other by -\pgf@circ@res@up
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
    \pgfusepath{draw}

    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}

        \pgfscope
            \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
            \pgfusepath{draw}       
        \endpgfscope    

    \pgftransformrotate{\ctikzvalof{bipoles/ammeter/text rotate}}% <= magic line
    \pgfsetlinewidth{\pgfstartlinewidth}

    \pgfsetarrowsend{latex}
    \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
    \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
    \pgfusepath{draw}
    \pgfsetarrowsend{}


    \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
    \pgfusepath{draw}


    \pgfnode{circle}{center}{\textbf{A}}{}{}
}
\makeatother

\begin{document}
\begin{circuitikz}
\draw (0,0)
to [sV=5V] (0,2)
to [R,l=$R_s$] (0,4)
to [C,l=$C$] (4,4)
to [short] (6,4);
\draw (6,0)
to [D] (6,4);
\draw (6,4)
to [short] (8,4)
to [R,l=$R_m$] (8,2)
to [ammeter,rotation=90] (8,0)% introducin rotation
to [short] (0,0);

\end{circuitikz}
\end{document}

Das Ergebnis:

Bildbeschreibung hier eingeben

verwandte Informationen