1

I'm new to LaTex in general, having discovered it in my search for a way to produce circuit diagrams, and therefore have arrived via CircuiTikZ and TikZ. So far, I'm loving it!

Unfortuantely, due to my lack of experience, I am unsure which features I am using / needing belong to TeX in general, TikZ or are unique to CircuiTikZ, which makes it very hard to find tutorials or examples of what I am trying to do!

Anyway, I have discovered the ($(Nor.out)+(1,0)$) notation that allows me to locate a point relative to an anchor on an object, but I was wondering if I can split this reference up for X and Y co-ordinates?

Say, for example, I have two lines that cross, one horizontal and one verical. I want to use the crossing object at the intersection. I therefore need to reference the X co-ordinate using the anchor at one end of the vertical line, and the Y co-ordinate using an anchor at one end of the horizontal.

So, in this case:

Crossing example

The crossing (circled in red) would need to get it's Y Co-Ordinate from the output of the gate NOR1 and it's X Co-Ordinate from the top of the capacitor C1.

Kind of related to this, can I specify one co-ordinate using relative and the other using absolute referencing? Say, I want to place an object that is vertically aligned with an anchor on a second object, but at an absolute position horizontally. (Say, a connector that is on the left of my diagram, but in line with a partcular anchor somewhere to it's right.)

I'm not sure if I'm explaining myself properly, so please let me know if I need to clarify.

Thoughts?

[Edited to add sketch for clarity]

3
1

My personal advice is to not using "jumps" --- mark all the connected crossing with more than three wires with a dot (using the -* syntax or simply with node [circ]{}) and let wires simply cross. But if you like jump crossing (and I admit that sometimes, especially in basic courses, is better to avoid catastrophic misunderstandings), I'll do something like this:

  1. find the crossing using the |- or -| coordinate syntax;
  2. use a xing bipole with a symmetric displacement on both sides

I explain it in the comments:

\documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\ctikzset{logic ports=ieee}
\begin{document}
\begin{circuitikz}[]
    \node [vcc](VCC) at(2,2) {} ;
    \draw (VCC) -- ++(0,-2) to[C] ++(0,-1);
    \node [xor port](P){P1};
    % now let's draw a wire with a jump crossing to an AND for example.
    % the point on the vertical line where the crossing occurs is (P.out -| VCC)
    % so move simmetrically around it
    \draw (P.out) -- ([xshift=-3mm] P.out -| VCC) to[xing] ++(6mm,0)
        -- ++(1,0) node[and port, anchor=in 1]{Q};
\end{circuitikz}
\end{document}

which results in:

enter image description here

3
  • Thank you! So, if I'm reading this correctly, (P.out -| VCC) returns the coordinates of the intersection itself? Awesome - just what I needed!
    – Paul
    Jun 12 '20 at 18:56
  • Yes - it's the coordinate of the point you find going horizontally from P.out and vertically from VCC. One of the most useful coordinate operation in TikZ.
    – Rmano
    Jun 12 '20 at 22:06
  • Re especially in basic courses, to avoid catastrophic misunderstandings: sadly, I know multiple uni professors who sometimes didn't even care to put a dot to indicate a connection. Hence, marking a crossing could not just help alleviate misunderstandings, but if you're as messy as those professors, it's basically a necessity.
    – Mew
    Jul 2 at 17:09
0

From page 60 of the circuitikz manual -- the crossing itself is a node and can be called upon by its various anchor points -- east west north etc

enter image description here

\begin{circuitikz}[]
     \node at (1,1)[jump crossing](X){};
     \draw (X.west) -- ++(-1,0);
     \draw (X.east) to[R] ++(2,0);
     \draw (X.north) node[vcc]{};
     \draw (X.south) to[C] ++(0,-1.5);
     \end{circuitikz}

For other solutions you could turn to the following links which define how to make custom crossings

--https://tex.stackexchange.com/a/134090/197451

--https://tex.stackexchange.com/a/395495/197451

--https://tex.stackexchange.com/a/372742/197451

1
  • Thanks for the suggestion (and I'm looking into the links you suppled!) My only issue is that your example fixes the crossing and then lays everything out around it, whereas I need the surrounding elements to be the ones that are fixed and the crossing to have its position calculated...
    – Paul
    Jun 12 '20 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.