\tasks 环境 w/ multicol:从 3 列更改为 1 列会导致意外的枚举重启

\tasks 环境 w/ multicol:从 3 列更改为 1 列会导致意外的枚举重启

该项目是一份考试类数学工作表,具有多列格式的打印/不打印选项,其中列数会多次变化。

第一列更改(从 2 列到 3 列)按预期执行,枚举持续进行且无日志警告:

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

但问题 #51 导致的最终列号立即发生变化:

(1)枚举重新启动@#1:

在此处输入图片描述

(2)警告日志消息(该消息不是随着第一次列号更改而生成的):

在此处输入图片描述

(3)切换到1列后输入文本问题会破坏剩余的代码行。

非常感谢您花时间阅读并回复我的帖子!

姆韦

\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](2)
\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](3)
\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](1)
\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}

答案1

环境tasksstart选项,就用它。

\stepcounter{task}%
\begin{tasks}[style=enumerate,start=\value{task}](1)
%%% Prob #61
\task

相关内容