1

I am coding my electrical circuit in LaTeX using circuitikz.

I have a pulsed voltage source in my circuit, and have used an AC voltage source until now. I'd like to change the sinusoidal 'wiggle' symbol in it, to a symbol that denotes a pulsed voltage input.

I know that there is \sqV but that implies a continuous square input.

Is there a way to do this?

I want to change this:

enter image description here

To this:

enter image description here

2
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented May 24, 2023 at 15:19
  • 1
    Any news? I'm confident that receiver answer solve your problem, so it will be nice from you to accept them (by clicking on the check mark at top left side of the answer).
    – Zarko
    Commented Jun 5, 2023 at 13:33

1 Answer 1

3

You could copy and modify the low-level code of the square source if you use that kind of symbol a lot. But another way is to use the empty source and just draw the symbol you want on it.

In the following example, I am doing it with a macro so that you can reuse it easily (just name the source and call the macro with the name). You have to manually rotate the symbol (I have added an optional argument for it) if you need/want to.

\documentclass[border=10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage[siunitx, RPvoltages]{circuitikz}
\newcommand{\drawpulse}[2][0]{% draw a pulse inside an empty source
    \begin{scope}[rotate=#1]
    \draw (#2.center) ++(-3mm, -2mm) -| ++(2mm,5mm)
    -- ++(2mm,0mm) |- ++(2mm, -5mm);
    \end{scope}
}
\begin{document}
\begin{tikzpicture}[american]
    \draw (0,0) to [esource, name=pulse1, v=$V_p$] ++(0,2)
        to[esource, name=pulse2, v=$V_h$] ++(2,0)
        to[esource, name=pulse3, v=$V_v$] ++(2,0);
    \drawpulse{pulse1}
    \drawpulse[-90]{pulse2}
    \drawpulse{pulse3}
\end{tikzpicture}
\end{document}

enter image description here

You can adjust the exact shape by changing the distances in the \drawpulse macro.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .