multicols & \enumitem:如何从 4 列更改为 3 列

multicols & \enumitem:如何从 4 列更改为 3 列

在下面的项目中,我想从 4 列转换为 3 列:

  1. 对于问题 #1-4,我想要 4 列。该命令有效:[style=enumerate](4)

从问题 #5 开始,我需要切换到 3 列以允许更宽的解决方案框。枚举应该继续,例如 5、6、7 等。

更改代码[style=enumerate](3)无法呈现所需的 3 列格式。

在此处输入图片描述

在此处输入图片描述

非常感谢您花时间查看并回复这篇文章!

母语:

\documentclass[12pt]{exam}
\printanswers
% un-comment to print solutions.
\renewcommand{\solutiontitle}{}
\usepackage{amsmath}
\usepackage{cancel}
\usepackage{framed}
\usepackage{bm}
\usepackage{multicol}
\usepackage[nice]{nicefrac}
\usepackage{tasks}
\usepackage[a4paper,margin=0.5in,include head]{geometry}
\usepackage{color}
\usepackage{soul}
\pagestyle{head}
\header{Algebra II: Unit 13 A\&B Fractional Exponents}
{}
{Due 05/02/23} 

\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

%******************************************** added <<<<<<<<<<
\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}
[style=enumerate](4)
\task![]\fullwidth{\textbf{Show all work on separate paper.}}
\bigskip
\task![]\fullwidth{\textbf{Change to log form.}}

\task![]\fullwidth{\textbf{Change to exponential form.}}
[style=enumerate](3)
%%% Prob #9
\task
$\log_{3}{9}=2$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$3^2=9$}
\end{solutionorbox}
\vspace{0.25cm}
%%% Prob #10
\task
$\log_{4}{16}=2$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$4^2=16$}
\end{solutionorbox}
\vspace{0.25cm}
%%% Prob #11
\task
$\log_{b}{c}=a$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$b^a=c$}
\end{solutionorbox}
\vspace{0.25cm}
%%% Prob #12
\task
$\log_{c}{r}=n$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$c^n=r$}
\end{solutionorbox}
\vspace{0.25cm}
%%%%%
\task![]\fullwidth{\textbf{Solve for $x$}}
%%% Prob #19
\task
$\log_{2}{(1/8)}=x$
\begin{solutionorbox}[\SolutionSpace]
Apply the log rule:\bigskip
$\log{a}{(1/x)}=-\log_{a}{x}$
\bigskip
$-\log_{2}{8}=x$
\bigskip
Rewrite 8 in exponential form $=2^3$
\bigskip
$-\log_{2}{2^3}=x$
\bigskip
Roll the exponent.
\bigskip
$-3\log_{2}{2}=x$
\bigskip
Apply log rule" $\log_{a}{a}=1$
\colorbox{yellow}{$x=-3$}
\end{solutionorbox}
%%% Prob #20
\task
$8^{x-4}=204$
\begin{solutionorbox}[\SolutionSpace]
With no common base, we must take the log of both sides:
\bigskip
$\log_{}8^{(x+1)}=\log_{}{208}$
\bigskip
Now apply log rule:
\medskip
$\log_{a}{x^b}=b\log_{a}{x}$
\bigskip
$(x+1)\log_{}{8}=1\log_{}208$
\bigskip
$\dfrac{(x+1)\log_{}{8}}{\log_{}{8}}=\dfrac{\log_{}208}{\log_{}{8}}$
\bigskip
\colorbox{yellow}{$x=3$}
\end{solutionorbox}
%%% Prob #21
\task
\begin{solutionorbox}[\SolutionSpace]
$4^{x-1}=4^2$\bigskip
$x-1=2$
\colorbox{yellow}{$x=3$}
\end{solutionorbox}
%%% Prob #22
\task
\begin{solutionorbox}[\SolutionSpace]
$4^{x-1}=4^2$\bigskip
$x-1=2$
\colorbox{yellow}{$x=3$}
\end{solutionorbox}

\end{tasks}
\end{document}

答案1

为了改变“列”的数量,您需要停止并重新启动任务。请注意使用\lasttask来重置计数器(任务)。

\documentclass[12pt]{exam}
\printanswers
% un-comment to print solutions.
\renewcommand{\solutiontitle}{}
\usepackage{amsmath}
\usepackage{cancel}
\usepackage{framed}
\usepackage{bm}
\usepackage{multicol}
\usepackage[nice]{nicefrac}
\usepackage{tasks}
\usepackage[a4paper,margin=0.5in,include head]{geometry}
\usepackage{color}
\usepackage{soul}
\pagestyle{head}
\header{Algebra II: Unit 13 A\&B Fractional Exponents}
{}
{Due 05/02/23} 

\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

%******************************************** added <<<<<<<<<<
\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}
[style=enumerate](4)
\task![]\fullwidth{\textbf{Show all work on separate paper.}}
\bigskip
\task![]\fullwidth{\textbf{Change to log form.}}
%%% Prob #1
\task 
$2^4=16$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$\log16_{2} =4$}
\end{solutionorbox}
\vspace{0.25cm}
%%%%
%%%%Prob #2
\task 
$3^3=27$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$\log27_{3}=3$}
\end{solutionorbox}
\vspace{0.25cm}
%%%Prob #3
\task 
$a^2=b$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$\log{a}_{b}=2$}
\end{solutionorbox}
\vspace{0.25cm}
%%% Prob #4
\task 
$c^r=m$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$\log{c}_{m}=r$}
\end{solutionorbox}
%\vspace{0.25cm}
\end{tasks}\unskip
\edef\lasttask{\arabic{task}}%
\begin{tasks}[style=enumerate](3)
\task![]\fullwidth{\textbf{Change to exponential form.}}%
\setcounter{task}{\lasttask}
%%% Prob #9
\task
$\log_{3}{9}=2$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$3^2=9$}
\end{solutionorbox}
\vspace{0.25cm}
%%% Prob #10
\task
$\log_{4}{16}=2$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$4^2=16$}
\end{solutionorbox}
\vspace{0.25cm}
%%% Prob #11
\task
$\log_{b}{c}=a$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$b^a=c$}
\end{solutionorbox}
\vspace{0.25cm}
%%% Prob #12
\task
$\log_{c}{r}=n$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$c^n=r$}
\end{solutionorbox}
\vspace{0.25cm}
%%%% Prob #13
\task
$\log_{4}{(1/4)=-1}$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$4^{-1}=1/4$}
\end{solutionorbox}
\vspace{0.25cm}
%%% Prob #14
\task
$\log_{6}{36}=2$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$6^2=36$}
\end{solutionorbox}
\vspace{0.25cm}
%%%%%
\task![]\fullwidth{\textbf{Solve for $x$}}
%%% Prob #15
\task
$\log_{5}{25}=x$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$x=2$}
\end{solutionorbox}
%%% Prob #16
\task
$\log_{9}{81}=x$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$x=2$}
\end{solutionorbox}
%%% Prob #17
\task
$\log_{4}{2}=x$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$x=16$}
\end{solutionorbox}
%%% Prob #18
\task
$\log_{1/2}{(1/2)}=x$
\begin{solutionorbox}[\SolutionSpace]
\colorbox{yellow}{$x=1$}
\end{solutionorbox}
%%% Prob #19
\task
$4^{x-1}=16$
\begin{solutionorbox}[\SolutionSpace]
$4^{x-1}=4^2$\bigskip
$x-1=2$
\colorbox{yellow}{$x=3$}
\end{solutionorbox}
%%% Prob #20
\task
$8^{x-4}=204$
\begin{solutionorbox}[\SolutionSpace]
\parskip=1ex
Take the natural log of both sides:
\par
$\ln8^{(x+1})=\ln{204}$
\par
apply log rule:
\par
$\log_{a}{x^b}=b\log_{a}{x}$
\par
$(x-4)\ln(8) = \ln(204)$
\par
$x-4=2.557$
\colorbox{yellow}{$x=6.557$}
\end{solutionorbox}
\end{tasks}
\end{document}

相关内容