How do I produce the equivalent of the symbols \square
and \Diamond
from amsfonts
if I'm using TeX Gyre Termes or TeX Gyre Pagella?
For example, XeLaTeXing the following gives Undefined control sequence
at \square
(and similarly for \Diamond
if the line with \square
is commented out).
From http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/unicode-math/unimath-symbols.pdf, I am aware of the unicode-math symbols \enclosequare
and \enclosediamond
, but the former is larger than the amsfonts \square
and the latter is just a rotated square rather than the slimmer amsfonts \Diamond
; also, the ams symbols have leading space that the corresponding unicode-math symbols do not. (To see the differences, uncomment the line % \RequirePackage{amsfonts}
.)
\documentclass{article}
\RequirePackage{fontspec}
\setmainfont[Ligatures=TeX]{TeX Gyre Termes}
\RequirePackage{unicode-math}
% Need amsmath first to avoid conflict for \dddot, etc.
\RequirePackage{amsmath}
\setmathfont{TeX Gyre Termes Math}
% Won't following overwrite def's of TeX Gyre Math symbols?
% \RequirePackage{amsfonts}
\begin{document}
$x=2$\\
$\enclosesquare$\\
$\enclosediamond$\\
$\square$\\
$\Diamond$
\end{document}
Purpose: I want these symbols to use strictly for end-of-proof and, analogously, end-of-example. I've added a proposed answer giving my solution.