type this following latex code in Latex editor for drawing a number line:
% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode
%% Based on a TexWorks,TexMaker,TeXnicCenter-Template by Tino Weinkauf.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{report}
%% Tikz Packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{patterns}
\usetikzlibrary{positioning}
%% Math Packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\begin{document}
\centering
\begin{tikzpicture}% number line
% edit here for the x-axis horizontal line
\draw[latex-,very thick] (-5,0) -- (5,0);
\draw[-latex,very thick] (-5,0) -- (5,0);
%x axes vertical lines
\foreach \x in {-4, -3, -2, -1, 0, 1, 2, 3, 4} \draw[shift={(\x,0)}, color=black] (0,0) node{$\bullet$};
% edit here for the axes numbers below the x-axes horizontal line
\foreach \x in {-4, -3, -2, -1, 0, 1, 2, 3, 4}
\draw[shift={(\x,0)},color=black](0,0) node[below] {$\textbf{\x}$};
%% draw arrow negative line
\draw[shift={(0,-0.75)}, thick, -latex] (-0.9,0) |- (-5,-0.75);
%% draw negative label
\draw[shift={(-3,0)}] (-1, -2) node{\textbf{\normalsize{} Bilangan Bulat Negatif}};
%% draw arrow zero line
\draw[shift={(0,-0.75)}, thick, -latex] (0,0) -- (0,-0.75);
%% draw zero label
\draw (0,-2) node{\textbf{\normalsize{} Bilangan}};
\draw (0,-2.2) node[below]{\textbf{\normalsize{} Nol}};
%% draw arrow positive line
\draw[thick,-latex] (1,-0.75) |- (5,-1.5);
%% draw positive label
\draw[shift={(3,0)}] (1, -2) node{\textbf{\normalsize{} Bilangan Bulat Positif}};
\end{tikzpicture}
\end{document}
Tidak ada komentar:
Posting Komentar