![Как объявить пользовательскую координату](https://rvso.com/image/392317/%D0%9A%D0%B0%D0%BA%20%D0%BE%D0%B1%D1%8A%D1%8F%D0%B2%D0%B8%D1%82%D1%8C%20%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D1%8C%D1%81%D0%BA%D1%83%D1%8E%20%D0%BA%D0%BE%D0%BE%D1%80%D0%B4%D0%B8%D0%BD%D0%B0%D1%82%D1%83.png)
Я создал эту схему-пример, где все выровнено с входами первого и гейта. Можно ли заменить их ([xshift=-15mm]bothNegated.bin 1)
пользовательским выражением, объявленным ранее, так, чтобы не приходилось повторять одну и ту же команду снова и снова?
Я используюcircuitikzgitпакет дляинвертированные входытолько остальное как в circuitikz.
Я пробовал использовать узел на пересечении, но тогда линии ([xshift=-5mm]bothNegated.bin 1) |- node[circ,midway]{} (notB.in 1)
не соединяются с линией, ведущей к вершине и воротам.
\documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikzgit}
\begin{document}
\begin{circuitikz} \draw
(2,0) node[and port] (bothTrue) {}
(2,2) node[and port] (notB) {}
(2,4) node[and port] (notA) {}
(2,6) node[and port] (bothNegated) {}
([xshift=-15mm]bothNegated.bin 1) node[anchor=east] (Anode) {A}
([xshift=-15mm]bothNegated.bin 1) -| (bothNegated.in 1)
([xshift=-5mm]bothNegated.bin 1) node[circ]{} |- (bothTrue.in 1)
([xshift=-5mm]bothNegated.bin 1) |- node[circ,midway]{} (notB.in 1)
([xshift=-5mm]bothNegated.bin 1) |- node[circ,midway]{} (notA.in 1)
([xshift=-15mm]bothNegated.bin 2) node[anchor=east] {B}
([xshift=-15mm]bothNegated.bin 2) -| (bothNegated.in 2)
([xshift=-10mm]bothNegated.bin 2) node[circ]{} |- (bothTrue.in 2)
([xshift=-10mm]bothNegated.bin 2) |- node[circ,midway]{} (notA.in 2)
([xshift=-10mm]bothNegated.bin 2) |- node[circ,midway]{} (notB.in 2)
(bothNegated.bin 2) node[ocirc, left] {}
(bothNegated.bin 1) node[ocirc, left] {}
(notA.bin 2) node[ocirc, left] {}
(notB.bin 1) node[ocirc, left] {}
;\end{circuitikz}
\end{document}
решение1
Координаты можно определить следующим образом:
\coordinate (c1) at ([xshift=-15mm]bothNegated.bin 1);
\coordinate (c2) at ([xshift=-15mm]bothNegated.bin 2);
\documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikzgit}
\begin{document}
\begin{circuitikz}
\draw
(2,0) node[and port] (bothTrue) {}
(2,2) node[and port] (notB) {}
(2,4) node[and port] (notA) {}
(2,6) node[and port] (bothNegated) {};
\coordinate (c1) at ([xshift=-15mm]bothNegated.bin 1);
\coordinate (c2) at ([xshift=-15mm]bothNegated.bin 2);
\draw
(c1) node[anchor=east] (Anode) {A}
(c1) -| (bothNegated.in 1)
([xshift=10mm]c1) node[circ]{} |- (bothTrue.in 1)
([xshift=10mm]c1) |- node[circ,midway]{} (notB.in 1)
([xshift=10mm]c1) |- node[circ,midway]{} (notA.in 1)
(c2) node[anchor=east] {B}
(c2) -| (bothNegated.in 2)
([xshift=5mm]c2) node[circ]{} |- (bothTrue.in 2)
([xshift=5mm]c2) |- node[circ,midway]{} (notA.in 2)
([xshift=5mm]c2) |- node[circ,midway]{} (notB.in 2)
(bothNegated.bin 2) node[ocirc, left] {}
(bothNegated.bin 1) node[ocirc, left] {}
(notA.bin 2) node[ocirc, left] {}
(notB.bin 1) node[ocirc, left] {};
\end{circuitikz}
\end{document}