我很困惑如何在 latex 文档中修复这些数字线的位置。数字线到处都是。我的示例和数字线之间有很大的空间
\documentclass{book}
\usepackage{tikz}
\usepackage{parskip}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{mdframed}
\usepackage{tikz}
\usepackage{parskip}
\usepackage{longdivision}
\usepackage{amsthm}
\newmdtheoremenv{theo}{Theorem}
\newmdtheoremenv{Definition}{Definition}
\newtheorem{example}[]{Example}
\newcommand{\R}{\mathbb{R}}
\newenvironment{solution}
{\renewcommand\qedsymbol{QED}\begin{proof}[Solution]}
{\end{proof}}
\begin{document}
\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}
\end{document}
答案1
最好添加一个空白行来开始新段落,而不是\\
。
我添加了一些 tikzpicture 并将其中的许多图片更改为\begin{tikzpicture}[scale = 2]
并将其移到 之外 example
。
所以大部分都是你的代码。
\documentclass{book}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{mdframed}
\usepackage{tikz}
\usepackage{parskip}
\usepackage{longdivision}
\usepackage{amsthm}
\newmdtheoremenv{theo}{Theorem}
\newmdtheoremenv{Definition}{Definition}
\newtheorem{example}[]{Example}
\newcommand{\R}{\mathbb{R}}
\newenvironment{solution}
{\renewcommand\qedsymbol{QED}\begin{proof}[Solution]}
{\end{proof}}
\begin{document}
\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 = 2]
\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 = 2]
\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}
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} \}$
\end{example}
\begin{tikzpicture}[scale = 2]
\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}
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 = 2]
\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."
\end{example}
\begin{tikzpicture}[scale = 3]
\draw[<->, > = stealth, thick] (3.5, 0) -- (7, 0);
\foreach \x in {4, 4.5, ..., 6.5} \draw (\x, 2pt)--(\x, -2pt) node [below] {\x};
\end{tikzpicture}
\end{document}