How can I insert the black little square at the end of each question in LaTeX like this picture?
2 Answers
You may find your solution with AMS-theorem extension (short and long docs)
\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}
- 487
From Denoting the end of example/remark
\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}
Remove [section] if you don't want the counter to be section-dependent.
- 4,254


amsthm, this question provides a method: https://tex.stackexchange.com/q/201956 – barbara beeton Dec 26 '22 at 21:34