為什麼 QED 符號顯示在句尾之後並且不能顯示右對齊(如下圖)?

為什麼 QED 符號顯示在句尾之後並且不能顯示右對齊(如下圖)?
\documentclass[twoside,11pt]{book}
\usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm,papersize={15.5cm,23.5cm}]{geometry}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}.}
\renewcommand{\thesubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}.}
\usepackage{amsthm}
\newtheorem{definition}{Definition}[section]
\newtheorem{theorem}{Theorem}[section]
\renewcommand{\thetheorem}{\thesection\arabic{theorem}}
\renewenvironment{proof}{{\noindent\bfseries Proof.}}{\qedsymbol}
\renewcommand{\qedsymbol}{\rule{1ex}{1ex}}

\begin{document}
    \chapter{ABC}
    blablabla
    \section{ONE}
    \begin{theorem}
        dddd
    \end{theorem}
\begin{proof}
    It is clear.
\end{proof}
\end{document}

我想要文字證明是大膽的。所以我寫:

\renewenvironment{proof}{{\noindent\bfseries Proof.}}{\qedsymbol}

現在,我想要 QED 符號是黑色方塊,所以我寫

\renewcommand{\qedsymbol}{\rule{1ex}{1ex}}

為什麼 QED 符號顯示在句尾之後並且不能顯示右對齊(如下圖)?怎樣製作呢?

在此輸入影像描述

我想:

在此輸入影像描述

答案1

我的建議是使用https://tex.stackexchange.com/a/251251/4427也重新定義了\qedsymbol.

\documentclass{article}

\usepackage{amsthm}
\usepackage{xpatch}

\providecommand{\proofnamefont}{\itshape}% the default
\xpatchcmd{\proof}{\itshape}{\normalfont\proofnamefont}{}{}
\renewcommand{\proofnamefont}{\bfseries}% your preference

\renewcommand{\qedsymbol}{\rule{1ex}{1ex}}

\begin{document}

\begin{proof}
Obvious, isn't it?
\end{proof}

\end{document}

在此輸入影像描述

答案2

從你的 中MWE,了解到你需要面Proof中的名稱Bold,並且 應該qedsymbol是實心黑色方塊,因此不需要重新定義環境,你可以根據需要proof修改\proofname和,修改後的為:\qedsymbolMWE

\documentclass[twoside,11pt]{book}
\usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm,papersize={15.5cm,23.5cm}]{geometry}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}.}
\renewcommand{\thesubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}.}
\usepackage{amsthm}
\newtheorem{definition}{Definition}[section]
\newtheorem{theorem}{Theorem}[section]
\renewcommand{\thetheorem}{\thesection\arabic{theorem}}
%\renewenvironment{proof}{{\noindent\bfseries Proof.}}{\qedsymbol}
\renewcommand{\proofname}{\upshape\textbf{Proof}}
\renewcommand{\qedsymbol}{\rule{1ex}{1ex}}

\begin{document}
    \chapter{ABC}
    blablabla
    \section{ONE}
    \begin{theorem}
        dddd
    \end{theorem}
\begin{proof}
    It is clear.
\end{proof}
\end{document}

輸出是:

在此輸入影像描述

答案3

您可以按如下方式重新定義\proofname\qedsymbol。沒有必要透過規則命令建立黑色方塊,因為套件\blacksquare中有一個命令amssymb可以產生與(白色)方塊大小相同的黑色方塊。

\documentclass[twoside,11pt]{book}
\usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm,papersize={15.5cm,23.5cm}]{geometry}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}.}
\renewcommand{\thesubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}.}
\usepackage{amsthm}
\newtheorem{definition}{Definition}[section]
\newtheorem{theorem}{Theorem}[section]
\renewcommand{\thetheorem}{\thesection\arabic{theorem}}

\renewcommand{\proofname}{\upshape\bfseries Proof}
\usepackage{amssymb}
\renewcommand{\qedsymbol}{\ensuremath\blacksquare}

\begin{document}
    \chapter{ABC}
    blablabla
    \section{ONE}
    \begin{theorem}
        dddd
    \end{theorem}
\begin{proof}
    It is clear.
\end{proof}
\end{document}

輸出如下。

在此輸入影像描述


順便說一句,章節編號不應該是羅馬字母,因為章節編號中的前綴是阿拉伯語。此外,沒有必要在章節編號後面加上點,因為章節編號後面沒有點。

相關內容