显示 Math Should End With $$ 错误消息

显示 Math Should End With $$ 错误消息

我似乎收到了与其他几个人相同的错误消息,但我不知道如何将解决方案应用到我自己的工作中。我知道错误发生在这里的某个地方:

\begin{solution}
By Trichonomy, we know that x $>$ 0, x $=$ 0, or x $<$ 0.
$x\not=0$ is given so we are left with two cases:
1--If x$>$0 then $x^2$ $=$ $x\ x$
By order axiom six--if 0$\leq $x and 0$\leq $y then 0$\leq $ $x\ y$--$x^2$ $>$ 0.

2--If x$<$0 then $x^2$ $=$ $$$-1\ x$\ -1$\ x$
               $=$ $$-1^2$\ $x^2$$
                       $=$ $1\ $x^2$$
               $=$ $x^2$ $>$ 0, completing the proof.
\end{solution}

我遇到了Display math should end with $$错误,然后还有一个错误告诉我$在最后一行(以“完成证明”结尾的那行)的开头插入另一个,这对我来说也没有意义。您能否提供一些见解,说明我做错了什么?

\documentclass[12pt]{exam}

\usepackage[dvips]{graphicx}

\usepackage{amsfonts,amssymb,amsmath,latexsym}

\pagestyle{empty}

\newcommand{\n}{\noindent}

\newcommand{\pp}{\parskip=0.25cm}

\newtheorem{tem}{{\sc Theorem}}

\newcommand{\R}{\mathbb{R}}

\newcommand{\N}{\mathbb{N}}

\begin{document}

\title{{\bf MA410.F13--Problem Set 1}}

\author{{\bf Lisa Snay }}

\date{}

\maketitle

\begin{questions}\pp

\question[10] Prove that if $a\in\R$ and $a\not=0$, then $a^2>0$

\end{questions}

\begin{solution}

By Trichonomy, we know that $x > 0$, $x = 0$, or $x < 0$.

$x\not=0$ is given so we are left with two cases:

1--If $x>0$ then $x^2 = x\ x$

By order axiom six--if $0\leq x$ and $0\leq y$ then $0\leq x\ y$ so $x^2 > 0$.

2--If $x<0$ then $x^2 = -1\ x\ -1\ x 

                      = -1^2\ x^2

              = 1\ x^2

              = x^2 > 0$, completing the proof.

\end{solution}

\end{document}

答案1

默认情况下(它在课堂评论中说)解决方案不会被打印,您需要该answers选项。错误是因为您不能在行数学中有段落中断(空行),我修复了一些(不是全部:-)其他问题,例如过时的字体命令\bf和图形包选项。

\documentclass[12pt,answers]{exam}

\usepackage{graphicx}

\usepackage{amsfonts,amssymb,amsmath,latexsym}

\pagestyle{empty}

\newcommand{\n}{\noindent}

\newcommand{\pp}{\parskip=0.25cm}

\newtheorem{tem}{\textsc{Theorem}}

\newcommand{\R}{\mathbb{R}}

\newcommand{\N}{\mathbb{N}}

\begin{document}

\title{\textbf{MA410.F13--Problem Set 1}}

\author{\textbf{Lisa Snay }}

\date{}

\maketitle

\begin{questions}\pp

\question[10] Prove that if $a\in\R$ and $a\not=0$, then $a^2>0$

\end{questions}

\begin{solution}

By Trichonomy, we know that $x > 0$, $x = 0$, or $x < 0$.

$x\not=0$ is given so we are left with two cases:

1--If $x>0$ then $x^2 = x\ x$

By order axiom six--if $0\leq x$ and $0\leq y$ then $0\leq x\ y$ so $x^2 > 0$.

2--If $x<0$ then 
\begin{align}x^2 &= -1 x -1 x\\ 
                  &= (-1)^2 x^2\\
              &= 1 x^2\\
             & = x^2 > 0
\end{align}, completing the proof.

\end{solution}

\end{document}

相关内容