![Две колонки; Пробел перед выравниванием по левому краю; размещение символа QED](https://rvso.com/image/353043/%D0%94%D0%B2%D0%B5%20%D0%BA%D0%BE%D0%BB%D0%BE%D0%BD%D0%BA%D0%B8%3B%20%D0%9F%D1%80%D0%BE%D0%B1%D0%B5%D0%BB%20%D0%BF%D0%B5%D1%80%D0%B5%D0%B4%20%D0%B2%D1%8B%D1%80%D0%B0%D0%B2%D0%BD%D0%B8%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5%D0%BC%20%D0%BF%D0%BE%20%D0%BB%D0%B5%D0%B2%D0%BE%D0%BC%D1%83%20%D0%BA%D1%80%D0%B0%D1%8E%3B%20%D1%80%D0%B0%D0%B7%D0%BC%D0%B5%D1%89%D0%B5%D0%BD%D0%B8%D0%B5%20%D1%81%D0%B8%D0%BC%D0%B2%D0%BE%D0%BB%D0%B0%20QED.png)
Я использовал найденный кодздесьдля удаления вертикального пробела перед мультиколонками. Я хочу выровнять по левому краю некоторые уравнения. У меня две проблемы:
- Уравнения не выровнены слева по линии, предшествующей решению (на рисунке это трудно заметить, но слева от выровненной среды имеется очень маленькое горизонтальное пространство).
- Как сделать так, чтобы символ 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
, которое делается для «горизонтальной» нумерации. Я воспользовался возможностью определить \abs
макрос переменного размера с помощью \DeclarePairedDelimiter
команды from mathtools
(см. подробности по его использованию в документации 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}