Hi. I am pretty new to Latex, and have an assignment to typeset a calculus textbook. I am using TeXnicCenter. So how do I go about creating a number line (from -2 to 2 with 1/4 intervals)?
Thanks
Olga
Math & Science ⇒ Creating a number line
NEW: TikZ book now 40% off at Amazon.com for a short time.

Creating a number line
You can use PSTricks, by using the code
and add
to your preamble.
You can read about PSTricks at CTAN: http://tug.ctan.org/tex-archive/graphic ... t-user.pdf
And you can also read about the multido package at CTAN: http://mirrors.dotsrc.org/ctan/macros/g ... ultido.pdf
Code: Select all
\psset{yunit=0.5cm,xunit=3cm}
\begin{pspicture}(-2,-1)(2,1)
\psline[linewidth=2pt,linecolor=red](-2,0)(2,0)
\multido{\n=-2.00+0.25}{17}{
\psline[linewidth=1pt,linecolor=red](\n,0.5)(\n,-0.5)
\rput{90}(\n,-1.5){\scriptsize \n}}
\end{pspicture}
Code: Select all
\usepackage{pstricks}
\usepackage{multido}
You can read about PSTricks at CTAN: http://tug.ctan.org/tex-archive/graphic ... t-user.pdf
And you can also read about the multido package at CTAN: http://mirrors.dotsrc.org/ctan/macros/g ... ultido.pdf
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit