How to create sets and name it

You can use TikZ to accomplish:

Code:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{calc,matrix}

\begin{document}
\begin{tikzpicture}
  \matrix (m) 
      [matrix of nodes, nodes={font=\bfseries}] {
       A & B & C & D & E & F & G & H & I & J & K & L & M & 
       N & O & P & Q & R & S & T & U & V & W & X & Y & Z \\
      };

  \def\h{8pt}

  \draw [thick] (m-1-1.north) -- +(0, \h) -- 
     node [anchor=south] {First set} 
    ($(m-1-5.north)+(0,\h)$) -- ($(m-1-5.north)$);

  \draw [thick] (m-1-9.north) -- +(0, \h) -- 
     node [anchor=south] {Second set} 
    ($(m-1-13.north)+(0,\h)$) -- ($(m-1-13.north)$);

  \draw [thick] (m-1-18.north) -- +(0, \h) -- 
     node [anchor=south] {Third set} 
    ($(m-1-22.north)+(0,\h)$) -- ($(m-1-22.north)$);

  \draw [thick] (m-1-1.south) -- +(0, -\h) -- 
     node [fill=white] {Complete set of characters} 
    ($(m-1-26.south)-(0,\h)$) -- ($(m-1-26.south)$);

\end{tikzpicture}
\end{document}

Some overlapping braces allow for this:

enter image description here

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\newcommand{\mystrut}{\rule[-.3\baselineskip]{0pt}{\baselineskip}}
\newcommand{\firstset}{\text{\mystrut A\ B\ C\ D\ E}}
\newcommand{\secondset}{\text{\mystrut I\ J\ K\ L\ M}}
\newcommand{\thirdset}{\text{\mystrut R\ S\ T\ U\ V}}
\newcommand{\completeset}{\text{\mystrut A\ B\ C\ D\ E\ F\ G\ H\ I\ J\ K\ L\ M\ N\ O\ P\ Q\ R\ S\ T\ U\ V\ W\ X\ Y\ Z}}
\begin{align*}
  \underbrace{
  \rlap{$\overbrace{\phantom{\firstset}}^{\text{First set}}$}\firstset\ 
  \text{F\ G\ H}\ 
  \rlap{$\overbrace{\phantom{\secondset}}^{\text{Second set}}$}\secondset      \text{N\ O\ P\ Q}\ 
  \rlap{$\overbrace{\phantom{\thirdset}}^{\text{Third set}}$}\thirdset\ 
  \text{W\ X\ Y\ Z}
  }_{\text{Complete set}}
\end{align*}
\end{document}

\rlap provides a zero-width box with a right overlap. I've added a \mystrut to each of the sets to raise/lower the \overbrace/\underbrace away from the characters.

amsmath provides the \text{...} macro and align environment for convenience, although it is not really necessary in this instance.

Tags:

Alphabet