1

Here's an image of what I am trying to draw:

image

2
  • 2
    Have you tried anything? If so, you should post a small document that shows your attempt. This shouldn't be to hard, and TikZ is well documented.
    – Alan Munn
    Jun 6, 2011 at 4:39
  • The title seems to indicate you want help, but your post gives the impression you want someone to do it for you. Which one is it?
    – Vivi
    Jun 6, 2011 at 6:17

3 Answers 3

2

This could probably be done more elegantly.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,decorations.pathreplacing,calc}
\begin{document}
\begin{tikzpicture}[%
box/.style={draw,rectangle},
decoration={brace,amplitude=4}]
  \node (posint) [box] {positive integer};
  \node (negint) [box,right=of posint] {negative integer};

  \draw [decorate,thick]
    ($(negint.south east) + (0,-.3)$) -- node (mida) {} ($(posint.south west)  + (0,-.3)$);

  \node (int) [box,below=.4cm of mida] {integer};
  \node (frac) [box,right=of int] {fractional number};

  \draw [decorate,thick]
    ($(frac.south east) + (0,-.3)$) -- node (midb) {} ($(int.south west)  + (0,-.3)$);

  \node (rational) [box,below=.4cm of midb] {rational number};

  \draw [->] (posint) -- (negint);
  \draw [->] (int) -- (frac);
\end{tikzpicture}
\end{document}
5

This doesn't use pgf, sorry.

\documentclass[a4paper]{article}
\usepackage{amsmath}
\newcommand{\myline}[2]{\underbrace{\,#1\,}_{#2}}
\newcommand{\dblbox}[2]{\fbox{#1}\makebox[3em]{\rightarrowfill}\fbox{#2}}
\newcommand{\mytopstrut}{\vbox to 3ex{}}
\newcommand{\mybotstrut}{\vtop to 2ex{}}
\begin{document}
\[
\myline{\dblbox{positive integer}{negative integer}\mybotstrut}{
  \hspace{11.5em}\myline{\dblbox{integer}{fractional number}\mybotstrut\mytopstrut}{
    \fbox{rational number}\mytopstrut
  }
}
\]
\end{document}
1
  • Much as it loathes me to say it, not everything has to be done using TikZ! Nice solution. Jun 6, 2011 at 18:55
1

Egreg did what I had in mind to do. I need a mobile TeX :-)
Oh well, this one's in eplain, so hopefully there is enough difference:

\input eplain
\def\mybox#1{\vcenter{\boxit{\hbox{#1}}}}
\def\To{\hbox to 3em{\rightarrowfill}}
$$ \displaylines{
  \underbrace{\mybox{positive integer}\To\mybox{negative integer}}\cr
  \hfil\underbrace{\mybox{integer}\To\mybox{fractional number}}\cr
  \hfil\mybox{rational number}}
$$
\bye

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .