我已经使用找到的代码这里删除多列前的垂直空格。我想将一些方程式左对齐。我有两个问题:
- 方程式左侧的行与解之前的行没有对齐(从图中很难看出来,但在对齐环境的左侧有一个非常小的水平空间)。
- 我怎样才能使 QED 符号与解决方案的最底行对齐?
任何帮助,将不胜感激。
\documentclass[10pt]{amsart}
\usepackage{amsmath, amssymb, amsfonts, amsthm}
\usepackage{enumitem}
\usepackage{multicol}
% multi columns in enumerate
\SetEnumitemKey{twocol}{
before=\raggedcolumns\setlength{\multicolsep}{\topsep}\begin{multicols}{2},
after=\end{multicols}
}
\parindent0pt
\begin{document}
\title{Title}
\author{Author}
\date{\today}
\maketitle
Here is a problem.
\begin{enumerate}[twocol]
\item $\mathbf{a} = \langle 1, 2 \rangle$, $\mathbf{b} = \langle 3, 4 \rangle$
\columnbreak
\item $\mathbf{a} = \langle 1, 2 \rangle$, $\mathbf{b} = \langle 3, 4 \rangle$
\end{enumerate}
\begin{proof}[Solution]\hfill
\begin{enumerate}[twocol]
\item $\begin{aligned}[t]
&\mathbf{a} \cdot \mathbf{b} = (1)(3)+(2)(4) = 11 \\
&|\mathbf{a}| = \sqrt{1^2 + 2^2} = \sqrt{5} \\
&|\mathbf{b}| = \sqrt{3^2+4^2} = 5
\end{aligned}$
\item $\begin{aligned}[t]
&\mathbf{a} \cdot \mathbf{b} = (1)(3)+(2)(4) = 11 \\
&|\mathbf{a}| = \sqrt{1^2 + 2^2} = \sqrt{5}
\end{aligned}$
\end{enumerate}
\qedhere\end{proof}
Issues:
\begin{itemize}
\item The $\mathbf{a} \cdot \mathbf{b}$, $|\mathbf{a}|$, $|\mathbf{b}|$ in the solution are not left-aligned with the $\mathbf{a}$ the precedes the solution (there's a very small horizontal space).
\item The $\square$ needs to align with the lowest row in the solution.
\end{itemize}
\end{document}
答案1
这里有两种不同的操作方法,它们在qed
符号的放置上非常相似,在\qedhere
证明结束之前有一个负垂直空格。第二种方法使用环境tasks
,用于“水平”编号。我利用这个机会用命令 from定义了一个可变大小的\abs
宏(有关其用法的详细信息,请参阅 mathtools 文档)。\DeclarePairedDelimiter
mathtools
\documentclass[10pt]{amsart}
\usepackage{mathtools, amssymb, amsfonts, amsthm}%
\usepackage{enumitem}
\DeclarePairedDelimiter\abs\lvert\rvert%
\usepackage{multicol}
\usepackage{tasks}
\settasks{counter-format=(tsk[1]), label-width=1.5em}
% multi columns in enumerate
\SetEnumitemKey{twocol}{
before=\raggedcolumns\setlength{\multicolsep}{\topsep}\begin{multicols}{2},
after=\end{multicols}
}
\parindent0pt
\begin{document}
\title{Title}
\author{Author}
\date{\today}
\maketitle
Here is a problem.
\begin{enumerate}[twocol]
\item $\mathbf{a} = \langle 1, 2 \rangle$, $\mathbf{b} = \langle 3, 4 \rangle$
\columnbreak
\item $\mathbf{a} = \langle 1, 2 \rangle$, $\mathbf{b} = \langle 3, 4 \rangle$
\end{enumerate}
\begin{proof}[Solution]\hfill
\begin{enumerate}[twocol]
\item $\begin{aligned}[t]
&\mathbf{a} \cdot \mathbf{b} = (1)(3)+(2)(4) = 11 \\
&\abs[\big]{\mathbf{a}} = \sqrt{1^2 + 2^2} = \sqrt{5} \\
&\abs{\mathbf{b}} = \sqrt{3^2+4^2} = 5
\end{aligned}$
\item $\begin{aligned}[t]
&\mathbf{a} \cdot \mathbf{b} = (1)(3)+(2)(4) = 11 \\
&|\mathbf{a}| = \sqrt{1^2 + 2^2} = \sqrt{5}\
\end{aligned}$%
\end{enumerate}
\vspace*{-\dimexpr\baselineskip + \topsep}\qedhere
\end{proof}
Issues:
\begin{itemize}
\item The $\mathbf{a} \cdot \mathbf{b}$, $|\mathbf{a}|$, $|\mathbf{b}|$ in the solution are not left-aligned with the $\mathbf{a}$ the precedes the solution (there's a very small horizontal space).
\item The $\square$ needs to align with the lowest row in the solution.
\end{itemize}
\vspace{1cm}
Here is a problem.
\begin{tasks}(2)
\task $\mathbf{a} = \langle 1, 2 \rangle$, $\mathbf{b} = \langle 3, 4 \rangle$
\task $\mathbf{a} = \langle 1, 2 \rangle$, $\mathbf{b} = \langle 3, 4 \rangle$
\end{tasks}
\begin{proof}[Solution]\hfill
\begin{tasks}(2)
\task $\begin{aligned}[t]
&\mathbf{a} \cdot \mathbf{b} = (1)(3)+(2)(4) = 11 \\
&\abs{\mathbf{a}} = \sqrt{1^2 + 2^2} = \sqrt{5} \\
&\abs{\mathbf{b}} = \sqrt{3^2+4^2} = 5
\end{aligned}$
\task $\begin{aligned}[t]
&\mathbf{a} \cdot \mathbf{b} = (1)(3)+(2)(4) = 11 \\
&|\mathbf{a}| = \sqrt{1^2 + 2^2} = \sqrt{5}\\
\end{aligned}$%\vspace{1ex}\par
%\qedhere
\end{tasks}
\vspace*{-\baselineskip }\qedhere
\end{proof}
\end{document}