Graphics, Figures & TablesMake a node out of several components

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
manuavazquez
Posts: 9
Joined: Wed Nov 10, 2010 2:49 pm

Make a node out of several components

Post by manuavazquez »

Hi,

is there a way to make a component out of several components so that it can be referenced later?

I'm trying to picture a decisor (in the field of communications),

Code: Select all

\begin{tikzpicture}
	\draw [ultra thick] (10,4.5) -- (10.5,4.5) -- (10.5,5.5) -- (11,5.5);
	\draw (9.8,4.3) rectangle (11.2,5.7);
\end{tikzpicture}
and it would be nice to be able to reference it later as a unit (for drawing arrows and that kind of thing). I guess this is tantamount to build a custom component...isn't it? The thing is I'm starting to learn TikZ and it's a little bit overwhelming :?

Cheers!!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Make a node out of several components

Post by localghost »

Perhaps you should take a look at circuitikz.


Best regards and welcome to the board
Thorsten
manuavazquez
Posts: 9
Joined: Wed Nov 10, 2010 2:49 pm

Re: Make a node out of several components

Post by manuavazquez »

Thank you very much for your fast reply Thorsten.

I took a look a circuitikz and I can't find such component (I don't think this decisor thing shows up very often in circuits, only in block diagrams for digital communications systems in which there is a modulator, demodulator and stuff like that).

Anyway, I'm wondering...would it possible to include cirkuitikz components in a tikzpicture environment? I take it circuitikz is not a Tikz library but a latex package based on Tikz...am I right?

Greetings.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Make a node out of several components

Post by localghost »

Then try something like this. The "decisor" (what's the English term?) is drawn as a node with a name you can reference.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}

\begin{document}
  \begin{tikzpicture}[
    decisor/.style={
      rectangle,
      draw,
      minimum size=1cm,
      inner sep=2pt
    }
  ]
    \node[decisor] (d1) at (1,1) {\tikz\draw[very thick] (0,0) -| +(0.4,0.8) -- (0.8,0.8);};
  \end{tikzpicture}
\end {document}
The node name d1 can be used for other drawing commands.
manuavazquez
Posts: 9
Joined: Wed Nov 10, 2010 2:49 pm

Re: Make a node out of several components

Post by manuavazquez »

It works like a charm. Thank you very much.!!

PS: you got me there: "decisor" is a direct translation from Spanish :oops: I'm not sure about the appropriate English translation but I think it's "threshold detector"
Post Reply