# How can I insert the black little square at the end of each question in LaTeX like this picture? [duplicate]

How can I insert the black little square at the end of each question in LaTeX like this picture?

• If you're willing to use a theorem-like environment, and amsthm, this question provides a method: tex.stackexchange.com/q/201956 Commented Dec 26, 2022 at 21:34

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}

\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.

• This really makes the question a duplicate. Commented Dec 27, 2022 at 17:35