0

This project is an exam class maths worksheet with print/no print options in multicol format wherein the number of columns changes several times.

The first column change (from 2 to 3 cols) executed as expected with continued enumeration and no log warnings:

\edef\lasttask{\arabic{task}}
\begin{tasks}[style=enumerate](3)
\setcounter{task}{\lasttask}
mwe

But the final column number change immediately after Problem #51 caused:

(1) enumeration to restart @ #1:

enter image description here

(2) Warning log message (which was not generated with the first column number change):

enter image description here

(3) Entering a text question after changing to 1 col destroys the remaining code lines.

Thanks very much for taking time to read and respond to my post!

mwe

\documentclass[12pt]{exam}
\usepackage[a4paper,margin=0.5in,include head]{geometry}
\printanswers
% un-comment to print solutions.
\renewcommand{\solutiontitle}{}
\usepackage{amsmath}
\usepackage{cancel}
\usepackage{framed}
\usepackage{bm}
\usepackage{multicol}
\usepackage[nice]{nicefrac}
\usepackage{tasks}
\usepackage{xcolor} 
%%%% Lines 15 - 18 fix color def warning
\renewcommand{\colorfbox}[2]{%
  \colorlet{currentColor}{.}%
  {\color{#1}\fbox{\color{currentColor}#2}}%
}

\usepackage{tikz} \usetikzlibrary{arrows.meta} \tikzset{arr/.style = {blue,-{Triangle[angle=60:1pt 3]}, thick, shorten <=2mm, shorten >=2mm} } \newcommand\arr{\tikz[baseline=-0.65ex] % <--- new \draw[blue,-{Triangle[angle=60:1pt 3]}, very thick, % <--- arrow's style shorten <=2mm, shorten >=2mm
% shortened visible part of arrow (for gap around it) ] (0,0) -- ++ (1,0); % length for arrow space is 1cm } \pagestyle{head} \header{\textbf{ Algebra II: Q4 Final Exam R E V I E W (Units 12-15)\ Part 2 of 2}} {} {} \newcommand{\pagetop}{% } \newlength{\lwidth}% added <<<<< \settowidth{\lwidth}{(99)\enspace} % added \settasks{after-item-skip=1em, after-skip=2cm, label-width=\lwidth, % changed <<<<<<<<< item-indent=0pt, % changed <<<<<<<<<< %label-format = \bfseries, %add \bf to make numbers bold <<<<<<<<<< label=(\arabic), % label-offset = -\lwidth,% added <<<<< item-format = \hspace{\lwidth},% added <<<<< column-sep=2em, % changed <<<<<<<<<
} \makeatletter \renewcommand{\fullwidth}[1]{% \vbox{%
\leftskip=-\lwidth \rightskip=0pt \advance\linewidth@totalleftmargin% @totalleftmargin=0pt% #1}% \nobreak } \makeatother \newlength{\SolutionSpace} \ifthenelse{\boolean{printanswers}} {\setlength{\SolutionSpace}{5cm} \colorsolutionboxes \definecolor{SolutionBoxColor}{gray}{0.8}}% solutions are printed {\setlength{\SolutionSpace}{0cm} \colorsolutionboxes \definecolor{SolutionBoxColor}{gray}{1}}% solutions are not being printed %
******************************************** \begin{document} %definition for bigskip = 1 line to replace all \bigskip \def\bigskip{\vskip\bigskipamount} \begin{tasks} %code changes start # to 44 style=enumerate,start=44 \task![]\fullwidth{\textbf {Simplify each expression to a single value without using a calculator. \emph{Show work.}\(NO calculators)}} %%% Prob #44 \task $1/2\bm{\cdot}\log{25}+\log{20}$ \begin{solutionorbox}[\SolutionSpace] $\log{25}\strut^{1/2}\bm{\cdot}\log{20}\arr \log{25}\strut^{1/2}=\sqrt{25}=5$\bigskip $\log5+\log{20}=\log{(5 \bm{\cdot}20})$\bigskip
$\log{100}\arr 10^x=100$\hphantom{(}\hphantom{(}\hphantom{(} \colorbox{yellow}{$x=2$} \end{solutionorbox}

%%%%%%%%Prob #45 \task $2\bm{\cdot}\log_2{6}-1/2\bm{\cdot}\log_2{81}$ \begin{solutionorbox}[\SolutionSpace] $\log_2{6^2}-\log_2{81}\strut^{1/2}\arr \log_2{36}-\log_2{9}$\bigskip $\log_2\biggl(\dfrac{36}{9}\biggr)=\log_{\textcolor{red}{2}}{\textcolor{blue}{4}}$\bigskip $\textcolor{red}{2}^x=\textcolor{blue}{4}$\hphantom{(}\hphantom{(}\hphantom{(} \colorbox{yellow}{$x=2$} \end{solutionorbox} \bigskip \end{tasks}\unskip \edef\lasttask{\arabic{task}} \begin{tasks}style=enumerate \task![]\fullwidth{\textbf {Compute each logarithm using the change of base property. Round answers to the nearest \emph{hundredth}.}}\bigskip \setcounter{task}{\lasttask} $\log_{\textcolor{red}{a}}{\textcolor{blue}{b}}=\dfrac{\log_c{\textcolor{blue}{b}}}{\log_c{\textcolor{red}{a}}}$ %%%Prob #46 \task $\log_7{145}$ \begin{solutionorbox}[\SolutionSpace] Hint: Use $\log_{10}$ (aka: $\log$) as the new base.\bigskip $\log_7{145}= \dfrac{\log{145}}{\log{7}}$ \hphantom{(}\hphantom{(}\hphantom{(} \colorbox{yellow}{$\approx 2.56$} \end{solutionorbox} \bigskip %%% Prob #47 \task $\log_3{124}$ \begin{solutionorbox}[\SolutionSpace] $\log_3{124}= \dfrac{\log{124}}{\log{3}}$ \bigskip \colorbox{yellow}{$\approx 4.39$} \end{solutionorbox} %% Prob #48 \task $\log_8{1200}$ \begin{solutionorbox}[\SolutionSpace] $\log_8{1200}= \dfrac{\log{1200}}{\log{8}}$ \bigskip \colorbox{yellow}{$\approx 3.41$} \end{solutionorbox} \bigskip \task![]\fullwidth{\textbf {Solve each equation for $x$. (NO calculators)}}

%%% Prob #49 \task $\log_2{32}=x$ \begin{solutionorbox}[\SolutionSpace] $2^x=32$\bigskip \colorbox{yellow}{$x=5$} \end{solutionorbox}

%%% Prob #50 \task $\log_5{x}=3$ \begin{solutionorbox}[\SolutionSpace] $5^3=x$\bigskip \colorbox{yellow}{$x=125$} \end{solutionorbox}

%%% Prob #51 \task $\log_x{7}=1/2$ \begin{solutionorbox}[\SolutionSpace] $x\strut^{1/2}=7 \arr \sqrt{x}=7$ \bigskip $(\sqrt{x})^2=7^2$ \arr \colorbox{yellow}{$x=49$} \end{solutionorbox} \bigskip \task![]\fullwidth{\textbf {Solve each equation for $x$. Round answers to the nearest \emph{hundredth} \emph{Show work}.}}

%%% Prob #52 \task $3^{x-1}=85$ \begin{solutionorbox}[\SolutionSpace] $\log{3^{x-1}}=\log{85}$ \bigskip $(x-1)\log{3}=\log{85}$ \bigskip $\dfrac{(x-1)\cancel{\log{3}}}{\cancel{\log3}}=\dfrac{\log{85}}{\log3}$\bigskip $x=\dfrac{\log{85}}{\log3}+1$\bigskip \colorbox{yellow}{$x\approx5.04$} \end{solutionorbox} %%% Prob #53 \task $\log_4(3x-8)=3$ \begin{solutionorbox}[\SolutionSpace] $4^3=3x-8$ \bigskip $64=3x-8$\bigskip $3x=72$\bigskip \colorbox{yellow}{$x=24$} \end{solutionorbox}

%%% Prob #54 \task $\log_5{250}=x$ \begin{solutionorbox}[\SolutionSpace] $5^x=250$\bigskip $\log(5^x)=\log{250}$\bigskip $x\log(5)=\log{250}$\bigskip $\dfrac{x\ \cancel{\log5}}{\cancel{\log5}}=\dfrac{\log{250}}{\log5}$\bigskip \colorbox{yellow}{$x\approx3.43$} \end{solutionorbox}

%%% Prob #55 \task $\log_2(x+5)-\log_2x=4$ \begin{solutionorbox}[\SolutionSpace] $\log_2\biggl(\dfrac{x+5}{x}\biggr)=4$\bigskip $2^4=\dfrac{x+5}{x}\arr 16=\dfrac{x+5}{x}$ \colorbox{yellow}{$2x^2y^3\sqrt[3]{x^2y^2}$} \end{solutionorbox}

%%% Prob #56 \task $\log9x-\log3=\log12$ \begin{solutionorbox}[\SolutionSpace] $\log\biggl(\dfrac{9x}{3}\biggr)= \log12$ \bigskip $\cancel{\log}\biggl(\dfrac{9x}{3}\biggr)= \cancel{\log}{12}$\bigskip $\dfrac{\cancel{9}x}{\cancel{3}}=12\arr 3x=12$\bigskip \colorbox{yellow}{$x=4$} \end{solutionorbox} \bigskip %%% Prob #57 \task $\log_2{2x}+\log_2{3}=\log_2{18}$ \begin{solutionorbox}[\SolutionSpace] $\log_2{(2x\bm{\cdot}3)}=\log_2{18}$\bigskip $\log_2{6x}=\log_2{18}$ \bigskip $\cancel{\log_2}{(6x)}=\cancel{\log_2}{(18)}$\bigskip ${6x=18}\arr \colorbox{yellow}{x=3}$ \end{solutionorbox}

\task![]\fullwidth{\textbf {Determine if the exponential function or situation represents growth (G) or decay (D).}}

%%% Prob #58 \task $y=4(0.8)$ \begin{solutionorbox}[\SolutionSpace] $0.8<1$\bigskip \colorbox{yellow}{decay} \end{solutionorbox}

%%% Prob #59 \task $A(t)=1500(1.05)^t$ \begin{solutionorbox}[\SolutionSpace] $1.05>1$ \colorbox{yellow}{growth} \end{solutionorbox} \bigskip

%%% Prob #60 \task $f(x)=1/4(5)^x$ \begin{solutionorbox}[\SolutionSpace] $5>1$\bigskip \colorbox{yellow}{growth} \end{solutionorbox} %%%% start 1 column \end{tasks}\unskip \edef\lasttask{\arabic{task}} \begin{tasks}style=enumerate \setcounter{task}{\lasttask} %%% Prob #61 \task \text{You open a savings account and deposit} $500. \text{Your account earns }2.5% \text{interest each year.} \vspace{.25cm} \begin{solutionorbox}[\SolutionSpace] \colorbox{yellow}{growth} \end{solutionorbox}

%%% Prob #62 \task \text{You currently have} $3,500$ \text{in your savings account. You withdraw }$3%$ \text{each month } \ \text{to pay some expenses.} \begin{solutionorbox}[\SolutionSpace] \colorbox{yellow}{decay} \end{solutionorbox}\bigskip \task![]\fullwidth{\textbf {Write an exponential function to model each situation in problems #61 and #62 above. \Find the amount of money in each account after 8 years. Assume you make \no additional withdrawals or deposits.}}

%%% Prob #63 \task $$500$ \text{invested at }$2.5%$\text{ interest each year.} \begin{solutionorbox}[\SolutionSpace] $y=a(r)^t\arr a= \text{starting amount}\arr r=\text{interest rate}\arr t=\text{time (# of years)}$\bigskip $y=500(1.025)^x$\arr \textbf{change to function notation}\arr $A(t)=500(1.025)^t$\bigskip $A(8)=500(1.025)^8$ \colorbox{yellow}{$=$609 20$} \end{solutionorbox} % Prob #64 \task $$3,500$ \text{in savings. Withdraw }$3.0%$\text{ each month.} \begin{solutionorbox}[\SolutionSpace] $y=3,500(0.97)^x$\arr \textbf{change to function notation}\arr $A(t)=3,500(0.07)^t$\bigskip $A(8)=3,500(0.97)^8$ \colorbox{yellow}{$=$2,743.10$} \end{solutionorbox}

%%% Prob #65 \task \text{In how many years will you have }$$4,500$ \text{if you earn interest at }$2.5%$ {annually.} \begin{solutionorbox}[\SolutionSpace] $4,500=500(1.025)^x$ \arr \text{divide both sides by }$500$ \bigskip $9=1.025^x$\arr \text{use common log to solve for }$x$\bigskip $\log{9}=\log (1.025)^x $\arr $\log{9}=x\ \log (1.025)$\bigskip $\log{4500}=x\log(1.025) $\bigskip $\dfrac{\log{9}}{\log(1.025)}=\dfrac{x\ \cancel{\log(1.025)}}{\cancel{\log(1.025)}}\approx$ \colorbox{yellow}{$88.98\approx89$\text{ years}} \end{solutionorbox}

%%% Prob #66 \task $\sqrt[3]{a^4b^7}$ \begin{solutionorbox}[\SolutionSpace] \colorbox{yellow}{$a^{4/3}b^{7/3}$} \end{solutionorbox} \bigskip %%% Prob #23 \task $\sqrt{a^3}$ \begin{solutionorbox}[\SolutionSpace] \colorbox{yellow}{$a^{3/2}$} \end{solutionorbox}

%%% Prob #24 \task $a^{5/3}$ \begin{solutionorbox}[\SolutionSpace] \colorbox{yellow}{$\sqrt[3]{a^5}$} \end{solutionorbox}

%%% Prob #25 \task $(a^3b^5)\strut^{1/2}$ \begin{solutionorbox}[\SolutionSpace] \colorbox{yellow}{$\sqrt{a^3b^5}$} \end{solutionorbox}

%%% Prob #26 \task $x^{1/3}$ \begin{solutionorbox}[\SolutionSpace] \colorbox{yellow}{$\sqrt[3]{x}$} \end{solutionorbox} \bigskip \task![]\fullwidth{\textbf{Simplify each expression. Write answers with rational exponents in lowest terms. \\emph{SHOW WORK.}}}

%%% Prob #27 \task $2\strut^{5/6}\bm{\cdot}2\strut^{3/4}$ \begin{solutionorbox}[\SolutionSpace] With common bases, \textbf{\emph{add}} the exponents.\bigskip $\dfrac{5}{6}+\dfrac{3}{4}=\dfrac{10}{12}+\dfrac{9}{12}$ \bigskip \colorbox{yellow}{$x\strut^{19/12}$} \end{solutionorbox} %%% Prob #28 \task $3\bm{\cdot}2^x-4=62$ \begin{solutionorbox}[\SolutionSpace] $3\bm{\cdot}2^x=66$\bigskip $2^x=22$\bigskip $x\log2=\log{22}$\bigskip $x\biggl(\dfrac{\cancel{\log2}}{\cancel{\log2}}\biggr) =\dfrac{\log{22}}{\log2}$\bigskip \colorbox{yellow}{$x\approx4.46$} \end{solutionorbox} %%% Prob #29 \task $5^{x+2}=250$ \begin{solutionorbox}[\SolutionSpace] $\log{5^{x+2}}=\log{250}$\bigskip $(x+2)\log5=\log{250}$\bigskip $(x+2)\biggl(\dfrac{\cancel{\log5}}{\cancel{\log5}}\biggr) =\dfrac{\log{250}}{\log5}$\bigskip $x=\dfrac{\log{250}}{\log5}-2$\bigskip \colorbox{yellow}{$x\approx1.43$} \end{solutionorbox} %%% Prob #30 \task $3^{2x-1}=75$ \begin{solutionorbox}[\SolutionSpace] $\log{3^{2x-1}}=\log{75}$\bigskip $(2x-1)\log3=\log{75}$\bigskip $(2x-1)\biggl(\dfrac{\cancel{\log3}}{\cancel{\log3}}\biggr) =\dfrac{\log{75}}{\log3}$\bigskip $2x=\dfrac{\log{75}}{\log3}-1$\bigskip $x=\biggl(\dfrac{\log{75}}{\log3}+1\biggr)\div 2$\bigskip \colorbox{yellow}{$x\approx1.96$} \end{solutionorbox} %%% Prob #28 \task $\log_4(3x+1)=2$ \begin{solutionorbox}[\SolutionSpace] If $\log_{\textcolor{blue}{a}}\textcolor{red}{b}=c$, then $\textcolor{red}{b}=\textcolor{blue}{a}^c$\bigskip $\textcolor{red}{3x+1}=\textcolor{blue}{4}^2$\bigskip $3x+1=16$\bigskip $3x=15$\bigskip \colorbox{yellow}{$x=5$} \end{solutionorbox} %%% Prob #29 \task $\log_5(27)=x\log_5(3)$ \begin{solutionorbox}[\SolutionSpace] When the logarithms on \ BOTH sides of the equation have the \textbf{same base}, \ cancel logs.\bigskip $\textcolor{red}{\log_5}(27)=\textcolor{red}{\log_5}(3^x)$\bigskip $\cancel{\log_5}(27)=\cancel{\log_5}(3^x)$\bigskip $27=3^x$\hphantom{(}\hphantom{(}\hphantom{(}$3^3=3^x$\bigskip \colorbox{yellow}{$x=3$} OR \colorbox{yellow}{$\dfrac{\log27}{\log3}=3$} \end{solutionorbox} %%% Prob #30 \task $\log_2(x+5)-\log_2x=4$ \begin{solutionorbox}[\SolutionSpace] $\log_{\bm{a}}(\textcolor{red}{x})-\log_{\bm{a}}(\textcolor{blue}{y})=\log_{\bm{a}} \biggl(\dfrac{\textcolor{red}{x}}{\textcolor{blue}{y}} \biggr) $\bigskip $?$ \bigskip \colorbox{yellow}{$x=3$} OR \colorbox{yellow}{$\dfrac{\log27}{\log3}=3$} \end{solutionorbox} %%% Prob #31 \task $\log_4(x+2)+\log_46=3$ \begin{solutionorbox}[\SolutionSpace] When the logarithms on \ BOTH sides of the equation have the \textbf{same base}, \ cancel logs.\bigskip $\textcolor{red}{\log_5}(27)=\textcolor{red}{\log_5}(3^x)$\bigskip $\cancel{\log_5}(27)=\cancel{\log_5}(3^x)$\bigskip $27=3^x$\hphantom{(}\hphantom{(}\hphantom{(}$3^3=3^x$\bigskip \colorbox{yellow}{$x=3$} OR \colorbox{yellow}{$\dfrac{\log27}{\log3}=3$} \end{solutionorbox} %%% Prob #32 \task $\log_57+\log_5(x)=\log_5{28}$ \begin{solutionorbox}[\SolutionSpace] When the logarithms on \ BOTH sides of the equation have the \textbf{same base}, \ cancel logs.\bigskip $\textcolor{red}{\log_5}(27)=\textcolor{red}{\log_5}(3^x)$\bigskip $\cancel{\log_5}(27)=\cancel{\log_5}(3^x)$\bigskip $27=3^x$\hphantom{(}\hphantom{(}\hphantom{(}$3^3=3^x$\bigskip \colorbox{yellow}{$x=3$} OR \colorbox{yellow}{$\dfrac{\log27}{\log3}=3$} \end{solutionorbox} %%% Prob #33 \task $\log_4(x+6)+\log_4(x)=2$ \begin{solutionorbox}[\SolutionSpace] When the logarithms on \ BOTH sides of the equation have the \textbf{same base}, \ cancel logs.\bigskip $\textcolor{red}{\log_5}(27)=\textcolor{red}{\log_5}(3^x)$\bigskip $\cancel{\log_5}(27)=\cancel{\log_5}(3^x)$\bigskip $27=3^x$\hphantom{(}\hphantom{(}\hphantom{(}$3^3=3^x$\bigskip \colorbox{yellow}{$x=3$} OR \colorbox{yellow}{$\dfrac{\log27}{\log3}=3$} \end{solutionorbox} \end{tasks} \end{document}

Siuslaw Math
  • 641
  • 3
  • 8
  • 1
    No problem found in your MWE with column changing after correcting ...and deposit \$500. in Prob #61. (Added missing \\ ) – Simon Dispa Jun 15 '23 at 20:18
  • @SimonDispa Thanks very much! I edited the code with your suggestion: \$500. Using overleaf to compile, the enumeration is still restarting at #1 (basically ignoring the command \setcounter{task}{\lasttask}. Also, the log warning still reads: Package tasks Warning: You've placed \setcounter {task}{\lasttask } before the first \task on line 450 which makes me wonder if it has something to do with restarting the numbering. Any ideas? – Siuslaw Math Jun 15 '23 at 22:15
  • 2
    tasks has a resume option... – cgnieder Jun 16 '23 at 06:10

1 Answers1

2

The tasks environment has a start option, just use it.

\stepcounter{task}%
\begin{tasks}[style=enumerate,start=\value{task}](1)
%%% Prob #61
\task
John Kormylo
  • 79,712
  • 3
  • 50
  • 120
  • ...Thanks very much! I'm not familiar with the stepcounter command. What does it do? Also, what is the function of the % character after \stepcounter{task}%. I've seen this before in other tex.se posts and have always wondered since % is often used to comment out. – Siuslaw Math Jun 20 '23 at 03:23
  • 1
    It adds 1 to a counter. See also \refstepcounter, which is needed for \label. Almost every line which ends with a brace will add a space to the text. Between paragraphs it dosn't matter, but I add % after every brace by habit. – John Kormylo Jun 20 '23 at 14:01
  • So does placing the % symbol after the brace "comment out" the added space? As you can see, I'm still a bit confused on this point. Thank you! – Siuslaw Math Jun 21 '23 at 19:46
  • 1
    Basically, yes. See also https://tex.stackexchange.com/questions/7453/what-is-the-use-of-percent-signs-at-the-end-of-lines-why-is-my-macro-creat?r=SearchResults&s=2%7C26.0807 . – John Kormylo Jun 21 '23 at 21:07
  • Thanks for link...very interesting and helpful explanations. – Siuslaw Math Jun 23 '23 at 22:55