Fixing the position of a number line in section

Click For Summary
SUMMARY

This discussion focuses on the proper formatting and positioning of number lines in LaTeX using the TikZ package. The user seeks assistance with spacing issues while graphing real numbers and inequalities. Key examples include graphing subsets of real numbers and demonstrating inequalities on a number line. The discussion emphasizes the importance of correctly representing inequalities and intervals visually using TikZ commands.

PREREQUISITES
  • Basic understanding of LaTeX typesetting
  • Familiarity with TikZ package for graphical representation
  • Knowledge of real numbers and inequalities
  • Ability to interpret mathematical notation and symbols
NEXT STEPS
  • Explore advanced TikZ features for enhanced graphing capabilities
  • Learn about LaTeX packages for mathematical typesetting, such as amsmath
  • Research best practices for visualizing inequalities on number lines
  • Study examples of compound inequalities and their graphical representations
USEFUL FOR

Students, educators, and anyone involved in teaching or learning mathematics, particularly those using LaTeX for document preparation and graphical representation of mathematical concepts.

cbarker1
Gold Member
MHB
Messages
345
Reaction score
23
TL;DR
In the document, there is some errors in my spacing and location of number line.
I am having trouble with the spacing and positioning of some number line. Sorry for any format problems.

Code:
\usepackage{tikz}
\usepackage{parskip}

 \subsubsection{Graphing Real Numbers on Number Line}
    We can graph subsets of real numbers on the number line. The number lines continue forever in both directions. The positive numbers are represented by the points to the right of $0,$ and the negative numbers are represented by the points to the left of $0.$
  
    \begin{tikzpicture}[scale = 3]
      
        \draw[<->, > = stealth, thick] (-2.8, 0) -- (2.8, 0);
        \foreach \x in {-2, -1, ..., 2} {\draw (\x, 2pt)--(\x, -2pt) node [below] {\x};}
      
    \end{tikzpicture}
    \begin{example}
        Graph the following subset of the real numbers: $\{1,-2,\frac{\pi}{2},\sqrt{2}, .\overline{12}, -\frac{1}{5} \}$
    \end{example}
  
    \begin{tikzpicture}[scale = 3]
      
        \draw[<->, > = stealth, thick] (-2.8, 0) -- (2.8, 0);
        \foreach \x in {-2, -1, ..., 2} {\draw (\x, 2pt)--(\x, -2pt) node [below] {\x};}
      
    \end{tikzpicture}
    \newline
    Each number in the example's set has just one point representing that number.
    \subsection{Inequalities and Intervals}
    To compare two quantities, we can use an inequality symbol.These is a table of common inequalities that we will use in this class:
    \begin{table}[ht]
        \centering
        \begin{tabular}{|c|c|c|}
            \hline
            \textbf{ Symbol} & \textbf{Words} & \textbf{Example} \\
            \hline
            $<$ & less than & $3<15$ \\
            \hline
            $>$ & greater than & $12>5$ \\
            \hline
            $\leq$ & less than or equal to & $0\leq 1$ \\
            \hline
            $\geq$ & greater than or equal to & $2 \geq 0$\\
            \hline
            $\ne$ & not equal to & $4\ne 5$\\
            \hline
            $\approx$ & approximately equal to & $\pi \approx 3.14 $ \\
            \hline
        \end{tabular}
        \caption{Basic Inequality symbols}
        \label{tab:Inequality Symbols}
    \end{table}
    Note that we can write an inequality with the inequality symbol pointing in the opposite direction:
    \begin{example}
        We will see two examples:
        \begin{enumerate}
            \item $32<40$ is equivalent to $40>32$
            \item $2.0 \geq -1.8$ is equivalent to $-1.8 \leq 2.0$
        \end{enumerate}
    \end{example}
    Now we will use the number line to graph some inequalities and intervals.
    \subsubsection{Graphing inequalities on Number Line}
    Suppose that we have two points on the number line $a$ and $b$. These are the rules of what the inequality is:
    \begin{enumerate}
        \item If $a>b,$ then $a$ lies to the right of $b$ on a number line.
        \item If $a<b$, then $a$ lies to the left of $b$ on a number line.
    \end{enumerate}
We will use example 9 to demonstrate this idea:
\begin{example}
    Compare the following subset of the real numbers with the right inequality symbol: $\{1,-2,\frac{\pi}{2},\sqrt{2}, .\overline{12}, -\frac{1}{5} \}$
\begin{tikzpicture}[scale = 3]
  
    \draw[<->, > = stealth, thick] (-2.8, 0) -- (2.8, 0);
    \foreach \x in {-2, -1, ..., 2} {\draw (\x, 2pt)--(\x, -2pt) node [below] {\x};}
      
\end{tikzpicture}
 
\end{example}
Let's drop the one constant and change it into a variable. Then this is called an inequality. We motivated this idea with an example.

\begin{example}
    Graph these inequalities: $x>-1$ and $x\leq 1$
\end{example}
\begin{solution}
    The first step is to graph the constant value. Then the second step is to see where the arrow of inequality is pointing right or left. Then we ask ourselves, "is it filled in or not?". Meaning that if we see the bar below inequality then we filled in the circle, otherwise we do not fill.
  
\end{solution}
\begin{tikzpicture}[scale = 3]

\draw[<->, > = stealth, thick] (-2.8, 0) -- (2.8, 0);
\foreach \x in {-2, -1, ..., 2} {\draw (\x, 2pt)--(\x, -2pt) node [below] {\x};}

\end{tikzpicture} \\
 
Sometimes, we can combine two inequalities into a compound inequality. Here is one example:
\begin{example}
$5<x<6$ which means that "$x$ is less than 5 and $x$ is less than 6."
    \begin{tikzpicture}[scale = 3]
  
    \draw[<->, > = stealth, thick] (4, 0) -- (7, 0);
    \foreach \x in {4, 4.5, ..., 6.5} {\draw (\x, 2pt)--(\x, -2pt) node [below] {\x};}  
\end{tikzpicture}
\end{example}

Carter Barker
 
Last edited by a moderator:
Physics news on Phys.org
What should it look like?
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
2
Views
2K
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 0 ·
Replies
0
Views
6K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
5
Views
3K