I want to make my own Tikz library/package or just a set of commands for making hydraulic diagrams within the Tikz environment. Say I want to draw a valve like (b) with the notation for the nodes in (a) (red)

Valve example with coordinate names

I want to write something like

  \draw (1,1) valve[name = V, ports = 4, type = 1];
  \draw[-o] (0,0) -| (V1);

with more options than those listed such as rotate, scale, etc.

Both possible solutions and guidance to further reading is much appreciated.

  • You can use a pic. – user11232 Oct 26 '15 at 22:44
  • Welcome! A pic would indeed be good here. The way I usually create pics when I'm not quite sure what I'm doing (which is usually the case), I start by just trying to draw a one-off instance of the thing I want. That is, I don't worry about options and re-using things and all the rest of it. I just concentrate on drawing, say, a single valve. Then I create some styles so that I can customise that single valve and I use the styles to define the valve. Now I've got something where I can twiddle the output without altering the code for the valve. Finally, I create a pic from it. – cfr Oct 26 '15 at 23:57
  • But before you do anything else, get yourself a better picture of the thing you want to draw. At least a bigger one so you can see what you are trying to do. – cfr Oct 26 '15 at 23:59
  • You might start by looking at the circuits library of tikz and circuitikz (which is a lot easier to create components for). – John Kormylo Oct 27 '15 at 4:05

Your Answer

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

Browse other questions tagged or ask your own question.