Sabtu, 08 Juni 2024

Number Line In Latex

type this following latex code for drawing a number line:
\documentclass[tikz,margin=0.25cm]{standalone}
\usepackage{tikz}
\usepackage{amsmath}
\usetikzlibrary{arrows}

% Number Line In Latex
\begin{document}
\begin{tikzpicture}
\draw[latex-latex,
ultra thick](-6.5,0) -- (6.5,0); %edit here for the axis
\foreach \x in {-6,

-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6} %edit here for vertical lines

\draw[shift={(\x,0)},color=black]

(0pt, 3pt) -- (0pt, -3pt);
\foreach \x in {-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6} %edit here for the numbers

\draw[shift={(\x,0)},color=black]

(0pt, 0pt) -- (0pt, -3pt) node[below]

{$\textbf{\x}$};
\end{tikzpicture}
\end{document}

Output:

number line


tex math and science document sample, latex math and science document example, learn about latex, latex lesson, mathematics, latex equation, latex draw, drawing in latex, latex graphic

Tidak ada komentar:

Posting Komentar