我怎样才能像这张图片一样在 LaTeX 中在每个问题末尾插入黑色小方块?

我怎样才能像这张图片一样在 LaTeX 中在每个问题末尾插入黑色小方块?

我怎样才能像这张图片一样在 LaTeX 中在每个问题末尾插入黑色小方块?

我怎样才能像这张图片一样在 LaTeX 中在每个问题末尾插入黑色小方块?

答案1

您可以使用 AMS 定理扩展找到解决方案(短的长的文档)

\documentclass{article}
\usepackage{amsthm}
\begin{document}
    \theoremstyle{definition} % default is plain
    \renewcommand{\qedsymbol}{$\blacksquare$} % standard is white
    \newtheorem{myquestion}{Question} % prefix numbering
    \section{Test}
    \begin{myquestion}
        Countries acros the world have been growing persistently since at least year 1200.
    \end{myquestion}
    \begin{myquestion}
        We use a logarithmic scale to plot the graph of a variable.
    \end{myquestion}
\end{document}

答案2

表示例子/评论的结束

\documentclass{article}

\usepackage{amsmath,amsthm}

\providecommand*{\blacksquare}{\rule{1ex}{1ex}}

\theoremstyle{definition}
\newtheorem{question}{Question}[section]
\AtBeginEnvironment{question}{%
  \pushQED{\qed}\renewcommand{\qedsymbol}{$\blacksquare$}%
}
\AtEndEnvironment{question}{\popQED\endquestion}

\begin{document}

\section{First Section}

\begin{question}
  Countries across the world have been growing persistently since at
  least year 1200.
\end{question}

\begin{question}
  We use the logarithmic scale to plot the graph of a variable so that
  the same growth rates at different levels of that variable appear as
  the same slopes of the graph.
\end{question}

\end{document}

[section]如果您不希望计数器依赖于部分,请删除。

在此处输入图片描述

相关内容