0

The mwe code below compiles in overleaf.com.

But the screenshots below show the error messages generated which I can't solve despite several hours of tweaks and researching tex.stack posts.

Your assistance will preserve my sanity! :)

Thank you!

mwe

\documentclass[12pt]{exam}

\usepackage{amsmath}
%\usepackage{cancel}
%\usepackage{caption} 
% allows captions in minipage envir
\usepackage{amssymb}
%\usepackage{mathrsfs}
\usepackage{framed} %box para
\usepackage{multicol}
\usepackage{tasks}
\usepackage[margin=0.5in]{geometry}
%\everymath{\displaystyle}

\setlength{\parindent}{0pt} % removes paragraph indentation

\pagestyle{head}
\header{Unit 9 Assignment: Lesson 4-7 Part 1 - Quadratic Formula Practice}
       {}
       {02/13/2023} 

\newcommand{\pagetop}{%
  %\makebox[\textwidth]%{Name:\enspace\hrulefill}\par
  \vspace{4mm}
  \fbox{\fbox{\parbox{\dimexpr\textwidth-4\fboxsep-4\fboxrule}{
    \textbf {Use the Quadratic Formula to solve each equation. Write answers in 2 forms: (1) integer or simplified radical (2) decimal approximation.}
    %\par
    %\bigskip

  }}}\par
  \vspace{0.5mm}
}

\begin{document}
\pagetop

\newcommand*{\qf}{x=\frac{-(b) \pm\sqrt{(b)^2-4(a)(c)}}{2(a)}}

\settasks{
    after-item-skip=5em,    after-skip=2cm,
    label-width=2em,
    item-indent=3em,
    label=(\arabic*),
    column-sep=2em
}
\begin{tasks}(2)
%Prob #1
\task -x^2+7x-3=0

Divide by -1 to cancel -1 on leading coefficient.

x^2-7x+3=0

\begin{aligned}
x&=\frac{-(7)\pm\sqrt{(-7)^2-4(1)(3)}}{2(1)}

&=\frac{-7\pm\sqrt{7^2-12}}{2}

&=\frac{-7\pm\sqrt{37}}{2}
\end{aligned}
%Prob #2
\task 0=-0.01x^2+1.22x+3

mutliply through by 100 to eliminate decimals.

0=-1x^2+122x+3

Since the problem asks for horizontal distance@ 30 ft height, can I write this equation:
30=-1x^2+122x+300

Set equation equal to zero by subtracting 30 from both sides.
0=-1x^2+122x+270
and then solve for x

x&=\frac{(-122)\pm\sqrt{(-122)^2-4(-1)(300)}}{2(-1)}

x&=\frac{(-122)\pm\sqrt{16084}}{2(-1)}

x=-2.17 or 124.41

\qf
\end{tasks}
\end{document}

enter image description here

4
  • as the error says you can only use aligned in math mode, you can no have $ in aligned either as it is already math. Start by removing all the \\ and all the $ Commented Feb 17, 2023 at 19:02
  • @DavidCarlisle Thanks for your quick response. As you suggested, I deleted all instances of \\ and $ . This revised code is now in the OP. However, now I've gone from 11 errors to 20 errors. Can you please peruse code and tell me if I've incorrectly applied you fix? Commented Feb 17, 2023 at 19:12
  • 1
    no edit shown.. Commented Feb 17, 2023 at 19:22
  • @DavidCarlisle Sorry. Forgot to save edit Please try now. In the edit OP mode I can't paste new image of error log. Suggestions? Thanks! Commented Feb 17, 2023 at 19:49

1 Answer 1

2

enter image description here

You just need to be careful that all math is in math mode

\documentclass[12pt]{exam}

\usepackage{amsmath}
%\usepackage{cancel}
%\usepackage{caption} 
% allows captions in minipage envir
\usepackage{amssymb}
%\usepackage{mathrsfs}
\usepackage{framed} %box para
\usepackage{multicol}
\usepackage{tasks}
\usepackage[margin=0.5in]{geometry}
%\everymath{\displaystyle}

\setlength{\parindent}{0pt} % removes paragraph indentation

\pagestyle{head}
\header{Unit 9 Assignment: Lesson 4-7 Part 1 - Quadratic Formula Practice}
       {}
       {02/13/2023} 

\newcommand{\pagetop}{%
  %\makebox[\textwidth]%{Name:\enspace\hrulefill}\par
  \vspace{4mm}
  \fbox{\fbox{\parbox{\dimexpr\textwidth-4\fboxsep-4\fboxrule}{
    \textbf {Use the Quadratic Formula to solve each equation. Write answers in 2 forms: (1) integer or simplified radical (2) decimal approximation.}
    %\par
    %\bigskip

  }}}\par
  \vspace{0.5mm}
}

\begin{document}
\pagetop

\newcommand*{\qf}{$x=\frac{-(b) \pm\sqrt{(b)^2-4(a)(c)}}{2(a)}$}

\settasks{
    after-item-skip=5em,    after-skip=2cm,
    label-width=2em,
    item-indent=3em,
    label=(\arabic*),
    column-sep=2em
}
\begin{tasks}(2)
%Prob #1
\task $-x^2+7x-3=0$

Divide by $-1$ to cancel $-1$ on leading coefficient.
\[
x^2-7x+3=0
\]
\begin{align*}
x&=\frac{-(7)\pm\sqrt{(-7)^2-4(1)(3)}}{2(1)}\\
&=\frac{-7\pm\sqrt{7^2-12}}{2}\\
&=\frac{-7\pm\sqrt{37}}{2}
\end{align*}


%Prob #2
\task $0=-0.01x^2+1.22x+3$

mutliply through by $100$ to eliminate decimals.
\[
0=-1x^2+122x+3
\]
Since the problem asks for horizontal distance@ 30 ft height, can I write this equation:
\[
30=-1x^2+122x+300
\]
Set equation equal to zero by subtracting $30$ from both sides.
\[
0=-1x^2+122x+270
\]
and then solve for $x$
\begin{align*}
x&=\frac{(-122)\pm\sqrt{(-122)^2-4(-1)(300)}}{2(-1)}\\
x&=\frac{(-122)\pm\sqrt{16084}}{2(-1)}
\end{align*}

$x=-2.17$ or $124.41$

\qf
\end{tasks}
\end{document}
2
  • Can't thank you enough! After so many hours of fruitless effort, it brings me great joy to experience the code compiling without error. Hats off to you! Question marked solved. Commented Feb 17, 2023 at 20:38
  • Very Good! But correct the math error (in the original code) in the second column... Commented Feb 17, 2023 at 22:39

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.