1

I would like to be able to draw this image in LaTeX but have no idea how to do so. I am new to graphs in LaTeX so any help would be much appreciated.

The red, green and blue circles along with annotations are not part of the image; they are there to explain length requirements. Also, the final graph produced need not follow that same format. As long as all the lines are drawn, I would be able to work out the positioning.

It is also a proper subset symbol, not a C. Thank you in advance.

Edit: I figured it out after the suggestion to use Tikz (thank you @SebGlav).

\begin{center}
\begin{tikzpicture}[scale=1.5]

\node (a) at (0,0) [fill,circle,inner sep=1.2pt] {};
\node (b) at (1,0) [fill,circle,inner sep=1.2pt] {};
\node (c) at (4,0) [fill,circle,inner sep=1.2pt] {};
\node (d) at (5,0) [fill,circle,inner sep=1.2pt] {};
\draw (0,0) -- (1,0) -- (4,0) -- (5,0);
\draw [gray,decorate,decoration={brace,amplitude=5pt},
       xshift=0pt,yshift=-4pt]
   (1,0) -- (0,0) 
   node [black,midway,below=4pt,xshift=0pt]
   {\footnotesize $I_1$};
\draw [gray,decorate,decoration={brace,amplitude=5pt},
       xshift=0pt,yshift=-4pt]
   (4,0) -- (1,0) 
   node [black,midway,below=4pt,xshift=0pt]
   {\footnotesize $I_2$};
\draw [gray,decorate,decoration={brace,amplitude=5pt},
       xshift=0pt,yshift=-4pt]
   (5,0) -- (4,0) 
   node [black,midway,below=4pt,xshift=0pt]
   {\footnotesize $I_3$};
   
\end{tikzpicture}

\bigskip

\begin{tikzpicture}[scale=1.5]
   
\node (a) at (0,0) [fill,circle,inner sep=1.2pt] {};
\node (b) at (2,0) [fill,circle,inner sep=1.2pt] {};
\node (c) at (3,0) [fill,circle,inner sep=1.2pt] {};
\node (d) at (5,0) [fill,circle,inner sep=1.2pt] {};
\draw (0,0) -- (1,0) -- (4,0) -- (5,0);
\draw [gray,decorate,decoration={brace,amplitude=5pt},
       xshift=0pt,yshift=-4pt]
   (2,0) -- (0,0) 
   node [black,midway,below=4pt,xshift=0pt]
   {\footnotesize $I'_1$};
\draw [gray,decorate,decoration={brace,amplitude=5pt},
       xshift=0pt,yshift=-4pt]
   (3,0) -- (2,0) 
   node [black,midway,below=4pt,xshift=0pt]
   {\footnotesize $I'_2$};
\draw [gray,decorate,decoration={brace,amplitude=5pt},
       xshift=0pt,yshift=-4pt]
   (5,0) -- (3,0) 
   node [black,midway,below=4pt,xshift=0pt]
   {\footnotesize $I'_3$};

\end{tikzpicture}
\end{center}
4
  • Welcome to TeX.SX! Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document.
    – DG'
    Commented Feb 12, 2021 at 14:33
  • Welcome to TeX.SE! Please, show us, what you try so far. If you have an sketch desired result, please insert it in the question. Given link can after while become dead and will be not visible to site users any longer ...
    – Zarko
    Commented Feb 12, 2021 at 14:34
  • And also, this kind of drawing is pretty straightforward in TikZ. You should be able to achieve this by yourself. At least, you should try and come back with what you get.
    – SebGlav
    Commented Feb 12, 2021 at 16:28
  • 1
    Thank you @SebGlav. I was able to get it after your suggestion. Commented Feb 12, 2021 at 17:00

1 Answer 1

3

You can draw these with \rules and tabulars for the structural layout:

enter image description here

\documentclass{article}

\begin{document}

Consider the following partition:
\begin{center}
  \begin{tabular}{ c @{\quad} c @{\quad} l }
    \makebox[2em]{$I_1$}\makebox[6em]{$I_2$} \\[-.4\normalbaselineskip]
    \rule[.5ex]{2em}{.4pt}\rule{.4pt}{1ex}\hspace{-.4pt}\rule[.5ex]{6em}{.4pt} &
      $\rightarrow$ & partition 1 \\
    \makebox[5.5em]{$I'_1$}\makebox[2.5em]{$I'_2$} \\[-.4\normalbaselineskip]
    \rule[.5ex]{5.5em}{.4pt}\rule{.4pt}{1ex}\hspace{-.4pt}\rule[.5ex]{2.5em}{.4pt} &
      $\rightarrow$ & partition 2
  \end{tabular}
\end{center}

We note that $I_1 \subset I'_1$ and $I'_2 \subset I_2$. Thus,
\begin{center}
  \begin{tabular}{ l @{\quad} c @{\quad} c }
    & & \makebox[2em]{$I_1$}\makebox[3.5em]{$I^B_2$}\makebox[2.5em]{$I^A_2$} \\[-.4\normalbaselineskip]
    partition 1 becomes & $\rightarrow$ & 
      \rule[.5ex]{2em}{.4pt}\rule{.4pt}{1ex}\hspace{-.4pt}\rule[.5ex]{3.5em}{.4pt}\rule{.4pt}{1ex}\hspace{-.4pt}\rule[.5ex]{2.5em}{.4pt} \\
    & & \makebox[2em]{$I^{\prime A}_1$}\makebox[3.5em]{$I^{\prime C}_1$}\makebox[2.5em]{$I'_2$} \\[-.4\normalbaselineskip]
    partition 2 becomes & $\rightarrow$ &
      \rule[.5ex]{2em}{.4pt}\rule{.4pt}{1ex}\hspace{-.4pt}\rule[.5ex]{3.5em}{.4pt}\rule{.4pt}{1ex}\hspace{-.4pt}\rule[.5ex]{2.5em}{.4pt}
  \end{tabular}
\end{center}

\end{document}

You must log in to answer this question.

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