Amsmath + Multicol + 任务环境:减少解决方案框与说明之间的垂直空间

Amsmath + Multicol + 任务环境:减少解决方案框与说明之间的垂直空间

对于下面显示的数学问题集,我想减少每次添加带有说明的新文本行时创建的垂直空间。下面屏幕截图中的红色箭头显示了我想减少的垂直空间的位置,以便在页面上容纳更多问题。

在此处输入图片描述

文本行由以下代码创建:

\task![]\fullwidth{\textbf{Simplify.(Add exponents)}}

我不知道红色箭头指示的垂直间距是由上面的命令控制还是由序言中的某些内容控制。

非常感谢您的帮助。谢谢!

母语:

\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{xcolor}
\usepackage{soul}
\pagestyle{head}
\header{Algebra II: Unit 13 A\&B Fractional Exponents}
       {}
       {Due 05/02/23} 

\newcommand{\pagetop}{%
%\noindent 
\bigskip
  \vspace{0.5mm}
}
\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 <<<<<<<<<  
}

\begin{document}
%definition for bigskip = 1 line to replace all \bigskip
\def\bigskip{\vskip\bigskipamount}
\begin{tasks}
[style=enumerate](3)
\task![]\fullwidth{\textbf{Change to fractional exponents.}}
% Prob #1
\task 
$\sqrt[6]{a}$
\begin{solutionorbox}[5cm]
\colorbox{yellow}{$a^{1/6}$}
\end{solutionorbox}
%\vspace{0.25cm}
%%%%
%Prob #2
\task 
$\sqrt[4]{5}$
\begin{solutionorbox}[5cm]
\colorbox{yellow}{$5^{1/4}$}
\end{solutionorbox}
%\vspace{0.25cm}
%%%%
%Prob #3
\task 
$\sqrt[3]{x^2}$
\begin{solutionorbox}[5cm]
\colorbox{yellow}{$x^{2/3}$}
\end{solutionorbox}
%\vspace{0.25cm}
%%%% Prob #9
\task![]\fullwidth{\textbf{Change to radicals.}}
\task 
$x^{3/10}$
\begin{solutionorbox}[5cm]
\colorbox{yellow}{$\sqrt[10]{x^3}$}
\end{solutionorbox}
\vspace{0.25cm}
%%
%%%% Prob #10
\task
$w^{4/7}$
\begin{solutionorbox}[5cm]
\colorbox{yellow}{$\sqrt[7]{x^4}$}
\end{solutionorbox}
\vspace{0.25cm}
%%
%%%% Prob #13
\task
$(ab)^{3/4}$
\begin{solutionorbox}[5cm]
\colorbox{yellow}{$\sqrt[4]{a^3}\sqrt[4]{b^3}=\sqrt[4]{a^3b^3}$}
\end{solutionorbox}
\vspace{0.25cm}
%%
\task![]\fullwidth{\textbf{Simplify.(Add exponents)}}
%% Prob #17
\task
$x^{3/4}\bm{\cdot}x^{1/4}$
\begin{solutionorbox}[5cm]
$x^{3/4+1/4}$
\bigskip
\colorbox{yellow}{$x^{4/4}=x$}
\end{solutionorbox}
%% Prob #18
\task
$a^{1/2}\bm{\cdot}a^{2/3}$
\begin{solutionorbox}[5cm]
$x^{1/2+2/3}$
\bigskip
\colorbox{yellow}{$x^{3/6+4/6}=x^{7/6}$}
\end{solutionorbox}
%% Prob #19
\task
$b^{3/4}\bm{\cdot}b^{1/10}$
\begin{solutionorbox}[5cm]
$b^{3/4+1/10}$
\bigskip
\colorbox{yellow}{$b^{15/20+2/20}=x^{17/20}$}
\end{solutionorbox}
%% Prob #20
\task
$5^{1/4}\bm{\cdot}5^{3/4}$
\begin{solutionorbox}[5cm]
$5^{1/4+3/4}$
\bigskip
\colorbox{yellow}{$5^{4/4}=5$}
\end{solutionorbox}
%% Prob #21
\task
$8^{1/3}\bm{\cdot}8^{1/4}$
\begin{solutionorbox}[5cm]
$8^{1/3+1/4}$
\bigskip
\colorbox{yellow}{$8^{4/12+3/12}=x^{7/12}$}
\end{solutionorbox}
%% Prob #22
\task
$z^{3/4}\bm{\cdot}z^{1/2}\bm{\cdot}z$
\begin{solutionorbox}[5cm]
$z^{3/4+1/2+1}$
\bigskip
\colorbox{yellow}{$z^{3/4+2/4+4/4}=x^{9/4}$}
\end{solutionorbox}
\task![]\fullwidth{\textbf{Simplify.(Subtract exponents)}}
\end{tasks}
\end{document}

答案1

代替\task![]\fullwidth{\textbf{Change to radicals.}}

使用\task![]\hspace{-\lwidth}\textbf{Change to radicals.}

A

\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{xcolor}
\usepackage{soul}
\pagestyle{head}
\header{Algebra II: Unit 13 A\&B Fractional Exponents}
{}
{Due 05/02/23} 

\newcommand{\pagetop}{%
    %\noindent 
    \bigskip
    \vspace{0.5mm}
}
\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 <<<<<<<<<  
}

\begin{document}
    %definition for bigskip = 1 line to replace all \bigskip
    \def\bigskip{\vskip\bigskipamount}
    \begin{tasks}
        [style=enumerate](3)
        \task![]\hspace{-\lwidth}\textbf{Change to fractional exponents.} % changed <<<<<<<<<<<<<
        % Prob #1
        \task 
        $\sqrt[6]{a}$
        \begin{solutionorbox}[5cm]
            \colorbox{yellow}{$a^{1/6}$}
        \end{solutionorbox}
        %\vspace{0.25cm}
        %%%%
        %Prob #2
        \task 
        $\sqrt[4]{5}$
        \begin{solutionorbox}[5cm]
            \colorbox{yellow}{$5^{1/4}$}
        \end{solutionorbox}
        %\vspace{0.25cm}
        %%%%
        %Prob #3
        \task 
        $\sqrt[3]{x^2}$
        \begin{solutionorbox}[5cm]
            \colorbox{yellow}{$x^{2/3}$}
        \end{solutionorbox}
        %\vspace{0.25cm}
        %%%% Prob #9
        \task![]\hspace{-\lwidth}\textbf{Change to radicals.}% changed <<<<<<<<<<<<<
        \task 
        $x^{3/10}$
        \begin{solutionorbox}[5cm]
            \colorbox{yellow}{$\sqrt[10]{x^3}$}
        \end{solutionorbox}
        \vspace{0.25cm}
        %%
        %%%% Prob #10
        \task
        $w^{4/7}$
        \begin{solutionorbox}[5cm]
            \colorbox{yellow}{$\sqrt[7]{x^4}$}
        \end{solutionorbox}
        \vspace{0.25cm}
        %%
        %%%% Prob #13
        \task
        $(ab)^{3/4}$
        \begin{solutionorbox}[5cm]
            \colorbox{yellow}{$\sqrt[4]{a^3}\sqrt[4]{b^3}=\sqrt[4]{a^3b^3}$}
        \end{solutionorbox}
        \vspace{0.25cm}
        %%
        \task![]\hspace{-\lwidth}\textbf{Simplify.(Add exponents)}% changed <<<<<<<<<<<<<
        %% Prob #17
        \task
        $x^{3/4}\bm{\cdot}x^{1/4}$
        \begin{solutionorbox}[5cm]
            $x^{3/4+1/4}$
            \bigskip
            \colorbox{yellow}{$x^{4/4}=x$}
        \end{solutionorbox}
        %% Prob #18
        \task
        $a^{1/2}\bm{\cdot}a^{2/3}$
        \begin{solutionorbox}[5cm]
            $x^{1/2+2/3}$
            \bigskip
            \colorbox{yellow}{$x^{3/6+4/6}=x^{7/6}$}
        \end{solutionorbox}
        %% Prob #19
        \task
        $b^{3/4}\bm{\cdot}b^{1/10}$
        \begin{solutionorbox}[5cm]
            $b^{3/4+1/10}$
            \bigskip
            \colorbox{yellow}{$b^{15/20+2/20}=x^{17/20}$}
        \end{solutionorbox}
        %% Prob #20
        \task
        $5^{1/4}\bm{\cdot}5^{3/4}$
        \begin{solutionorbox}[5cm]
            $5^{1/4+3/4}$
            \bigskip
            \colorbox{yellow}{$5^{4/4}=5$}
        \end{solutionorbox}
        %% Prob #21
        \task
        $8^{1/3}\bm{\cdot}8^{1/4}$
        \begin{solutionorbox}[5cm]
            $8^{1/3+1/4}$
            \bigskip
            \colorbox{yellow}{$8^{4/12+3/12}=x^{7/12}$}
        \end{solutionorbox}
        %% Prob #22
        \task
        $z^{3/4}\bm{\cdot}z^{1/2}\bm{\cdot}z$
        \begin{solutionorbox}[5cm]
            $z^{3/4+1/2+1}$
            \bigskip
            \colorbox{yellow}{$z^{3/4+2/4+4/4}=x^{9/4}$}
        \end{solutionorbox}
        \task![]\hspace{-\lwidth}\textbf{Simplify.(Subtract exponents)}% changed <<<<<<<<<<<<<
    \end{tasks}
\end{document}

另一种选择是重新定义命令\fullwidth

(在 前添加\begin{document}

\makeatletter
\renewcommand{\fullwidth}[1]{%
    \vbox{%     
        \leftskip=-\lwidth \rightskip=0pt
        \advance\linewidth\@totalleftmargin%
        \@totalleftmargin=0pt%
        #1}%
    \nobreak
}
\makeatother

相关内容