Rabu, 12 Maret 2025

Number Line In Latex 5

1. type this following latex code in Latex editor for drawing a number line:
% Distributed under the LaTeX Project Public License
% https://www.latex-project.org/lppl.txt
% pdflatex numberLineCurve1.tex
%% A curve line on a number line

\documentclass[12pt]{article}
\usepackage[left=0.1cm,right=0.1cm,top=0.5cm,bottom=0.5cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{arrows,bending}

\usepackage[active,multi,tightpage,varwidth,pdflatex]{preview}
\PreviewEnvironment[{[]}]{tikzpicture}
\setlength\PreviewBorder{3pt}

\begin{document}

\tikzset{->-/.style={decoration={
  markings,
  mark=at position #1 with {\arrow{>}}},postaction={decorate}}}
  
\begin{tikzpicture}
%%draw axes line for number line
\draw[latex-,thick] (2,0) -- (11,0) ;
\draw[-latex,thick] (2,0) -- (11,0) ;

%%edit here for vertical lines on number line
\foreach \x in {3,4,5,6,7,8,9,10} \draw[shift={(\x,0)},color=black, thick] (0pt,3pt) -- (0pt,-3pt);

%%edit here for number labels
\foreach \x in {3,4,5,6,7,8,9,10} \draw[shift={(\x,0)},color=black] (0pt,0pt) -- (0pt,-3pt) node[below] (\x){$\mathbf{\x}$};

%%draw 3 + 5 curve line

\draw (3,0) edge[-latex, bend left=80, looseness=0.5,thick,above=0.9pt] node [above=0.9mm] {\textbf{+5}} (8.08,0);


%%draw 8 + 2 curve line

\draw (8,0) edge[bend left=80, looseness=0.9, above=0.9pt, blue, thick, -stealth] node [above=0.9mm] {\textbf{+2}} (10.02,0);


\end{tikzpicture}

\end{document}

2. Save file as numberLineCurve1.tex.

3.Then build or typeset the Latex code.

Output

To see the output, look at the below picture:



Notes

  • To see the more clear picture, click on the picture.
  • Maybe you need a little bit high computer requirement to learn from above lesson list.


< Previous Number Line In Latex 4


<< back to Study About Draw In Latex 2




Related Post

Draw A Cartesian Coordinate In Latex 1

Tidak ada komentar:

Posting Komentar