circuitikz 中的逻辑门和 osquarepole

circuitikz 中的逻辑门和 osquarepole

我有一个小问题,我想解决,我怎样才能用通常的语法to [short, -s]或放置一些方形端子,而to [short, s-]不必在选项的开头指定立柱和。菱形可以工作,但方形端子留下了裸露的短路。-ss-ctikzset{}

s选项为 commentend 时在此处输入图片描述

当我使用选项时 在此处输入图片描述

在这两种情况下,我都使用 W10 中的 TexStudio 和 XeLaTeX 进行编译。

\begin{figure}[!h]
    \centering
    \begin{circuitikz}[scale = 0.8, transform shape]
        \ctikzset{
            logic ports=ieee,
            logic ports/scale=0.8,
            component text=left,    
            -s/.style = {bipole nodes={none}{osquarepole, }},       %% square --
            s-/.style = {bipole nodes={osquarepole,}{none }},       %% -- square
        }

        }       
        %% NOR_3_1 in 2 ports gates
        \filldraw [blue , %very thick,
        line width =0.75pt ,
        dashed , fill = blue!8]
        (-4.25,5) -| (1.95,1.5) -| cycle;
        \node [rounded corners, black, draw, fill = blue!8] at (.95 ,1.88)
        { \textcolor{blue}{\small { LG2 }}};
        %%  dividing the NOR3
        \draw 
            (-1,4) node[not port,](not2){\scriptsize lg2} (not2.out) -- ($(not2.out)+(0.3,0)$) coordinate(notAB) 
            (notAB)node[above right]{\scriptsize $\overline{\overline{A + B}}=A+B$}
            (-3,4) node[nor port](norAB){\scriptsize lg3} (norAB.out) -- (not2.in 1)
            (-4.5,4.5) node[left]{\footnotesize A} to [short, s-] (-4,4.5) |- (norAB.in 1)
            (-4.5,3.5) node[left]{\footnotesize B} to [short, s-] (-4,3.5) |- (norAB.in 2)
            (norAB.out)node[above, xshift=3mm]{\scriptsize$\overline{\mbox{A + B}}$}
        ;
        \draw 
            (1,3) node[nor port,](exNor3){\scriptsize lg1} 
            (notAB) |- (exNor3.in 1)
            (-4.5,2.5) node[left]{\footnotesize C} to [short, s-] (-0,2.5) |- (exNor3.in 2)
        ;
        \draw (1,0) node[nor port, anchor=center](Nor2){\scriptsize LG1};
        \draw 
            (-4.5,-0.5) node[left]{\footnotesize E} to [short, s-] (0,-0.5) |- (Nor2.in 2)
            (-4.5,0.5)node[left]{\footnotesize D} to [short, s-] (0,0.5) |- (Nor2.in 1)
        ;
        \draw           
            (exNor3.out) -- ($(exNor3.out) + (0.5,0)$) coordinate(ABC)  node[right=1mm]{\scriptsize$\overline{\mbox{A + B + C}}$}
            (Nor2.out) -- ($(Nor2.out) + (0.5,0)$) coordinate(DE)   node[right=2mm]{\scriptsize$\overline{\mbox{D+E}}$} 
        ;
        \draw 
            (4,1.5) node[nand port] (Nand2){\scriptsize LG3}
            (DE) |- (Nand2.in 2)
            (ABC) |- (Nand2.in 1)
            (Nand2.out) -- ($(Nand2.out) + (0.5,0)$) coordinate(notF) node[above left]{\scriptsize$\overline{\mbox{F}}$}
        ;
        \draw 
            (6,1.5) node [not port](not1){\scriptsize LG4}
            (Nand2.out) -- (not1.in 1)
            (not1.out) to [short, -s] ($(not1.out)+ (0.5,0)$) node[right]{\footnotesize F}
        ;
    \end{circuitikz}
\caption{pic caption here}
\label{fig:Fco_2}
\end{figure}

PS:我复制了帖子提交的内容,并在报告中使用了带圆圈的那个,这是我的错。

答案1

是的,正如您所发现的,-s默认情况下未定义连接类型。您可以从手册第 6.1 章“节点(也称为极点)”中看到,预定义的连接类型(大多数)是o*d和的组合.。因此,当您需要它们时,您必须自己添加。

您可以将它们复制到序言中,使它们在您的所有文件中都可用,或者您可以将它们粘贴到样式文件中(参见第 3.3.5 章“样式文件:如何编写它们”)。

更简单的选择是将它们放在你的序言中:

\documentclass[border=10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage[RPvoltages]{circuitikz}
\ctikzset{
    -s/.style = {bipole nodes={none}{osquarepole}},
    s-/.style = {bipole nodes={osquarepole}{none}},
    s-s/.style = {bipole nodes={osquarepole}{osquarepoles}},
    % add the combinations you need, for example
    s-*/.style = {bipole nodes={osquarepole}{circ}},
    % you can see in the file pgfcircpath.tex the predefined ones
}
\begin{document}
\begin{tikzpicture}[]
    \draw (0,1) to[short, s-] ++(2,0);
    \draw (0,0) to[R, s-*] ++(2,0);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容