在 circuitikz 中配置破折号长度

在 circuitikz 中配置破折号长度

我尝试在使用时手动设置破折号长度\usepackage{circuitikz}。我只知道选项\draw[dashed]\draw[densely dashed]。但我怎样才能让破折号更短呢?或者甚至加标点,比如“ \draw[punctuated]”。

这是我的代码示例:

\documentclass [a4paper,11pt,oneside]{scrbook}
\usepackage[left=2.5cm,right=2.5cm,top=3.5cm,bottom=3.5cm]{geometry}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[european, siunitx]{circuitikz}
\usepackage{siunitx}
\usepackage{graphicx, pgf, listings, units, hyperref}
\usepackage{float}
    \restylefloat{figure}
\usepackage{amsmath}
\usepackage{bm}     
%-------------------------------------------
\begin{document}
%-------------------------------------------
\begin{figure}[H]
    \centering
\begin{circuitikz}[>=latex]
%--------------BASE CIRCUIT & CELLS-------
\draw
(0,0) -- (5.75,0)
;
\draw[thick]
(5.75,0)
-- (5.75,-0.25)
-- (6.25,-0.25)
-- (6.25,0.25)
-- (5.75,0.25)
-- (5.75,0)
;
\draw
(6.25,0) -- (12,0)
-- (12,1)
to[C, l=$\text{C}_{\text{x}}$] (6,7)
to[C, l=$\text{C}_{\text{n}}$] (0,1)
-- (0,0)
;
\draw[dashed]
(9.5,3.5) -- (10.5,4.5)
(9.5,5.5)-- (8.5,4.5)
;
\draw
(9.5,5.5)
to[pC, l={\tiny{Elko}}] (10.5,4.5)
;
%
\draw[densely dashed]         % This part is supposed to be with shorter dashes
(10.5,4.5) -- (11.5,5.5)
(10.5,6.5) -- (9.5,5.5)
;
\draw
(10.5,6.5)
to[empty diode, l={\tiny{Varicap}}] (11.5,5.5);
;
%
\end{circuitikz}
\caption[\LaTeX: test]{test}
\label{fig:test}
\end{figure}
%------------------------
\end{document}

这可能吗?

答案1

您可以使用dotteddensely dotted线条样式,也可以定义自己的dash pattern。请参阅 PGF 3.0 第 168 页第 15.3.2 节手动的。请注意,我已将你的序言精简到仅包含此处必要的内容,并用mathtools包裹amsmath

\documentclass{standalone}
\usepackage{mathtools}
\usepackage[european]{circuitikz}
%-------------------------------------------
\begin{document}
\begin{circuitikz}[>=latex]
%--------------BASE CIRCUIT & CELLS-------
\draw (0,0) -- (5.75,0);
\draw[thick] (5.75,0) -- (5.75,-0.25) -- (6.25,-0.25) -- (6.25,0.25) -- (5.75,0.25) -- (5.75,0);
\draw (6.25,0) -- (12,0) -- (12,1) to[C, l=$\text{C}_{\text{x}}$] (6,7) to[C, l=$\text{C}_{\text{n}}$] (0,1) -- (0,0);
\draw[dashed] (9.5,3.5) -- (10.5,4.5) (9.5,5.5)-- (8.5,4.5);
\draw (9.5,5.5) to[pC, l={\tiny{Elko}}] (10.5,4.5);
%
% \draw[dotted]         % Could be dotted
% (10.5,4.5) -- (11.5,5.5)
% (10.5,6.5) -- (9.5,5.5)
% ;
\draw[dash pattern=on 1pt off 1pt]         % Or you can use dash pattern
(10.5,4.5) -- (11.5,5.5)
(10.5,6.5) -- (9.5,5.5)
;
\draw (10.5,6.5) to[empty diode, l={\tiny{Varicap}}] (11.5,5.5);
%;
%
\end{circuitikz}
%------------------------
\end{document}

相关内容