# How to Draw Intervals

I am writing up some exercises for students who are using College Algebra as their textbook. I need to know how to TeX pictures of intervals like those on page 3 and page 5 of the linked book. Thanks. • Can you include the screenshot of an example here so that everybody who wonders what the question is about doesn't download the whole book for 1 page? – percusse Jan 17 '13 at 17:16
• @percusse It's two pages. Also, I don't know how to include a screenshot. – Joe Johnson 126 Jan 17 '13 at 18:24
• As is noted in the book's introduction, all LaTeX files used to created the book may be downloaded from the authors' website, stitz-zeager.com/Precalculus/…. – Mico Jan 17 '13 at 18:24

## 1 Answer

There are many ways to do this. For example,

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\tikz\draw [o-o] (0,0) -- +(1,0);
\tikz\draw [o-*] (0,0) -- +(1,0);
\tikz\draw [o->] (0,0) -- +(1,0);
\end{document} • Thanks. One more question, how would I label the endpoints with numbers? – Joe Johnson 126 Jan 17 '13 at 18:23
• Try \tikz\draw [o-o] (0,0) node[pos=0, below] {$a$} -- +(1,0); – Boris Jan 17 '13 at 18:33