![2列; 左揃えの前にスペース; QEDシンボルの配置](https://rvso.com/image/353043/2%E5%88%97%3B%20%E5%B7%A6%E6%8F%83%E3%81%88%E3%81%AE%E5%89%8D%E3%81%AB%E3%82%B9%E3%83%9A%E3%83%BC%E3%82%B9%3B%20QED%E3%82%B7%E3%83%B3%E3%83%9C%E3%83%AB%E3%81%AE%E9%85%8D%E7%BD%AE.png)
見つけたコードを使用しましたここ段組み前の垂直スペースを削除します。いくつかの数式を左揃えにしたいのですが、問題が 2 つあります。
- 方程式は、解の前の行の左側に揃っていません (画像からはわかりにくいですが、揃っている環境の左側に非常に小さな水平方向のスペースがあります)。
- 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
以下に、その方法の 2 つのバリエーションを示します。どちらも、シンボルの配置が非常に似ておりqed
、\qedhere
証明終了の直前に負の垂直スペースが先行します。2 番目のバリエーションでは、環境を使用します。これは、「水平」番号付けに使用されます。私は、コマンド from を使用してtasks
可変サイズの\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}