1

I try to insert a Unicode Character \char"2756 (Black Diamond Minus White X) which is not contained in the font newcomputermodern

I need this as a paragraph separator.

So my question:

  1. how to change the font inside the document
  2. how to find this character in a LaTeX font - is it contained or not? Trial and error? Or is there a cleverer means to find it; for example in the command line?

Just to complete my question: I am writing texts in markdown with parts of LaTeX inserted. Compiling with XeTeX.

Thank you for your help

marek

4
  • "how to find this character in a font" -> have a look at the albatross command line tool. It will search all fonts you have installed on your operating system for this symbol. Jan 14 at 17:14
  • 2
    you can use albatross U+2756 on a command line to get a list of fonts, then use the fontspec command to load and use it, see the fontspec docu. Jan 14 at 17:14
  • Thank you both for the albatross suggestion. Very useful. And how to change the font inside the document? Jan 14 at 17:27
  • To make albatross working I needed to install java first. Now it is working! Amazing! Jan 15 at 8:29

1 Answer 1

2

The simplest way is to use newunicodechar and defining a font face that contains the symbol.

Or you can use the standard Zapf Dingbats Type 1 font.

\documentclass{article}

\usepackage{fontsetup} % NewComputerModern
\usepackage{newunicodechar}

\newfontface{\auxfontA}{DejaVu Sans}[Scale=MatchUppercase]

\newunicodechar{❖}{{\auxfontA ❖}}
\newcommand{\bdmwx}{❖}

\begin{document}

Some text ❖ other text \bdmwx\ other text

\end{document}

enter image description here

With Zapf Dingbats

\documentclass{article}

\usepackage{fontsetup} % NewComputerModern
\usepackage{newunicodechar}
\usepackage{pifont}

\newunicodechar{❖}{{\Pifont{pzd}\symbol{118}}}
\newcommand{\bdmwx}{❖}

\begin{document}

Some text ❖ other text \bdmwx\ other text

\end{document}

enter image description here

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .