左侧的 \qedhere 和 \tag 组合

左侧的 \qedhere 和 \tag 组合

如果我将 a 放在\qedhere与 的组合中,\tag{2}但在左侧,则会出现错误:Package amsmath 错误:多个 \tag。错误还说要查阅文档,我做了一件事,在\mbox周围放了一个\qedhere,这消除了错误,但正如您所见,我的对齐不正确,框不在行尾:

在此处输入图片描述

平均能量损失

\documentclass[10pt,twoside]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{lemma}{Lemma}
\makeatletter
\newcommand{\leqnos}{\tagsleft@true\let\veqno\@@leqno}
\newcommand{\reqnos}{\tagsleft@false\let\veqno\@@eqno}
\reqnos
\makeatother
\begin{document}
\chapter{Some}
\section{Introduction}

\begin{lemma} \label{lem:lemma1}
Without error but no \verb|\qedhere|
\end{lemma}
\begin{proof}
We have
\leqnos \begin{gather*}
\tag{1}
3=2+1\\
\tag{2}
2=1 +1
\end{gather*}
\end{proof}

\begin{lemma} \label{lem:lemma2}
No error but bad alignement
\end{lemma}
\begin{proof}
We have
\leqnos \begin{gather*}
\tag{1}
3=2+1\\
\tag{2}
2=1 +1
\mbox{\qedhere}
\end{gather*}
\end{proof}

\end{document}

答案1

如果您使用ntheorem(以及 qed 符号的自动放置)执行此操作,则没有问题。

笔记:如果您ntheorem使用选项加载amsthm,则只需定义lemma环境。

\documentclass[10pt,twoside]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, amssymb}

 \usepackage[thmmarks, thref, amsmath]{ntheorem}
 \theoremstyle{plain}
 \theoremheaderfont{\bfseries}
 \theorembodyfont{\mdseries}
\theoremseparator{.}
 \newtheorem{theorem}{Theorem}[chapter]
 \newtheorem{lemma}{Lemma}
 \theoremstyle{nonumberplain}
 \theoremheaderfont{\itshape}
 \theoremsymbol{\ensuremath{\Box}}
 \newtheorem{proof}{Proof}
\makeatletter
\newcommand{\leqnos}{\tagsleft@true\let\veqno\@@leqno}
\newcommand{\reqnos}{\tagsleft@false\let\veqno\@@eqno}
\reqnos
\makeatother

\begin{document}

\chapter{Some}
\section{Introduction}

\begin{lemma} \label{lem:lemma1}
Without error but no \verb|\qedhere|
\end{lemma}
\begin{proof}
We have
\leqnos \begin{gather*}
\tag{1}
3=2+1\\
\tag{2}
2=1 +1
\end{gather*}
\end{proof}

\begin{lemma} \label{lem:lemma2}
No error but bad alignment
\end{lemma}
\begin{proof}
We have
\leqnos
 \begin{gather}
\tag{1}
3=2+1\\
\tag{2}
2=1 +1
\end{gather}
\end{proof}

\end{document} 

在此处输入图片描述

相关内容