为什么我在数学模式下输入无效?为什么我的单词连在一起了?

为什么我在数学模式下输入无效?为什么我的单词连在一起了?

请帮忙。我不明白为什么我不断收到一条消息,说“命令 \textgreater 在数学模式中无效...”。我收到 textless 的相同消息。另外,这与我的单词连在一起有什么关系吗?请帮忙。

在此处输入图片描述

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

% set page and text layout
\linespread{1.8}
\textwidth = 6.5 in
\textheight = 9 in
\oddsidemargin =  0.1 in
\evensidemargin = 0.1 in
\topmargin = 0.0 in
\headheight = 0.0 in
\headsep = 0.0 in

% set theorem numbering
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}[theorem]{Definition}

% header information
\title{F18-311 Writing Project 1}
\author{kuyguk}
\date{\today}

\begin{document}

\maketitle

\section{The Division Algorithm}

% Don't worry that the numbers won't match up exactly like in the textbook.

\begin{theorem} (Division Algorithm) Let a and b be integers, with b \textgreater 0. Then there exist unique integers q and r such that \[a=bq+r\] where 0 $\leq r \leq b$.

\end{theorem}

\begin{proof}
Existence of q and r. Let 

\[S = a - bk : k \in \mathbb{Z} and a - bk \geq 0 .\] 
\newline $If 0 \in S$, then then b divides a, and we can let q=a/b and r=0. If $0 \notin S$, we can use the Well-Ordering Principle. We must first show that S is nonempty. If $a - b * 0 \in S.$ If a \textless 0, then a - b (2a) = a (1-2b) $\in$ S. Therefore, a = bq + r, r $\leq$ 0. Then \[ a - b (q + 1) = a - bq - b = r - b \textgreater 0. \]
\newline Since 0 $\notin$ S, r $\neq$ b and so r \textless b.

Uniqueness of q and r. Suppose there exist integers r, $r^\prime$, q, and $q^\prime$ such that \[a = bq + r, 0 \leq r \textless  b and a = bq^\prime + r^\prime , 0 \leq r^\prime \textless b.\] 

\end{proof}

答案1

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

% set page and text layout
\linespread{1.8}
\textwidth = 6.5 in
\textheight = 9 in
\oddsidemargin =  0.1 in
\evensidemargin = 0.1 in
\topmargin = 0.0 in
\headheight = 0.0 in
\headsep = 0.0 in

% set theorem numbering
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}[theorem]{Definition}

% header information
\title{F18-311 Writing Project 1}
\author{kuyguk}
\date{\today}

\begin{document}

\maketitle

\section{The Division Algorithm}

% Don't worry that the numbers won't match up exactly like in the textbook.

\begin{theorem} (Division Algorithm) Let 
% not a and b
$a$ and $b$ be integers, with 
% not \textgreater
$b > 0$. Then there exist unique integers $q$ and $r$ such that \[a=bq+r\] where 
% the whole expression in math 0 $\leq r \leq b$.
$0 \leq r \leq b$.

\end{theorem}

\begin{proof}
Existence of $q$ and $r$. Let % never leave a blank line before display math
\[S = a - bk : k \in \mathbb{Z}
% and in text
\text{ and }a - bk \geq 0 
\text{.}\] 


% avoid forced line breaks\newline

$If 0 \in S$, then then $b$ divides $a$, and we can let 
% whole expression in math
$q=a/b$ and $r=0$. If $0 \notin S$, we can use the Well-Ordering Principle.
We must first show that $S$ is nonempty. If 
% . not in math
$a - b * 0 \in S$.
%whole expressions in math
 If $a < 0$, then $a - b (2a) = a (1-2b) \in S$.
Therefore, $a = bq + r$, $r \leq 0$. Then
\[ a - b (q + 1) = a - bq - b = r - b > 0. \]
Since $0 \notin S$, $r \neq b$ and so $r < b$.

Uniqueness of $q$ and $r$. Suppose there exist integers $r$, $r'$,
$q$, and $q'$ such that \[a = bq + r, 0 \leq r <  b \text{ and } a = bq' + r' , 0 \leq r' M b\text{}.\] 

\end{proof}

\end{document}

答案2

您应该阅读一些较新的文档,因为有其他方法可以设置不那样的边距,例如使用包geometry或使用 KOMA-Script 包等typearea

此外,如果您想将内容放在不同的段落中,只需在它们之间留一行空白即可。

无论如何,当某样东西是数学时,它就应该是数学。数学写$..$在文本和\[ .. \]显示样式之间。

\section{The Division Algorithm}

\begin{theorem}[Division Algorithm]
  Let $a$ and $b$ be integers, with $b > 0$. Then there exist unique integers $q$ and $r$
  such that
  \[
    a = bq + r
  \]
  where $0 \leq r \leq b$.

\end{theorem}

\begin{proof}
  Existence of $q$ and $r$. Let 
  \[
    S = a - bk : k \in \mathbb{Z} \text{ and } a - bk \geq 0.
    % instead of `\text{ and }` you can use `\ \text{and} \ ` or `\quad \text{and} \quad`
  \]

  If $0 \in S$, then then $b$ divides $a$, and we can let $q = a/b$ and $r = 0$.
  If $0 \notin S$, we can use the Well-Ordering Principle. We must first show that $S$ is
  nonempty. If $a - b * 0 \in S$. If $a < 0$, then $a - b (2a) = a (1 - 2b) \in S$.
  Therefore, $a = bq + r$, $r \leq 0$. Then
  \[
    a - b (q + 1) = a - bq - b = r - b > 0.
  \]
  Since 0 $\notin S$, $r \neq b$ and so $r < b$.

  Uniqueness of $q$ and $r$. Suppose there exist integers $r$, $r'$, $q$, and $q'$ such
  that
  \[
    a = bq + r, \ 0 \leq r < b \quad\text{and}\quad a = bq' + r' , \ 0 \leq r^' < b.
    \qedhere
  \]
\end{proof}

请注意,我刚刚更改了与数学模式相关的内容。如果变量是数学模式,则应将其置于数学模式,即使它只是一个字母。如果表达式是数学,则必须将整个表达式置于数学模式中,以便程序负责排版。

相关内容