The following defines commands \cmark
and \xmark
to produce the Unicode characters with codes U+2718 and U+2714, respectively.
Question:
Is there some simpler, or alternative, way that the following to specify an individual character, from a different font than the main one in use — when only one or two characters from that font are going to be used?
% !TeX program =xelatexmk
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Termes}
\setmathfont{TeX Gyre Termes Math}
% How create command for character that has Unicode U+2718?
\newfontfamily{\xmarkfont}{LibertinusMath-Regular.otf}
\newcommand{\xmark}{\xmarkfont\char"2718}
\newfontfamily{\cmarkfont}{TeX Gyre Pagella Math}
\newcommand{\cmark}{\xmarkfont\char"2714}
\begin{document}
\begin{tabular}{lc}
Wrong & \xmark\\
Right & \cmark
\end{tabular}
\end{document}
Related: How find out name of ballot x mark in a unicode font with XeLaTeX?
bbding
package and type\CheckmarkBold
or\XSolidBrush
?