1

Despite related questions and answers, I am still confused. In xelatex, how do I insert a unicode character like, http://unicode.scarfboy.com/?s=U%2bfdfb ?

(In my workflow I need to insert the character after certain words.)

blackened
  • 4,181

1 Answers1

6

To begin with, you need to find a font on your machine that has the glyph. Then it's easy:

\documentclass{article}
\usepackage{fontspec}
\usepackage{newunicodechar}

\newfontface{\arabtype}{Damascus}[Scale=1.2]

\newunicodechar{ﷻ}{{\arabtype ﷻ}}

\begin{document}

This is ﷻ in a standard document

\end{document}

enter image description here

For pdflatex the easiest is to prepare a document named fdfb-char.tex

\documentclass{standalone}
\usepackage{fontspec}
\usepackage{newunicodechar}

\newfontface{\arabtype}{Damascus}[Scale=1.2]

\newunicodechar{ﷻ}{{\arabtype ﷻ}}

\begin{document}

ﷻ 

\end{document}

and compile it with XeLaTeX. Then the following will work for all engines.

\documentclass{article}
\usepackage{ifxetex}
\usepackage{graphicx}

\ifxetex
  \usepackage{fontspec}
  \usepackage{newunicodechar}
  \newfontface{\arabtype}{Damascus}[Scale=1.2]
  \newunicodechar{ﷻ}{{\arabtype ﷻ}}
\else
  \usepackage[utf8]{inputenc}
  \DeclareUnicodeCharacter{FDFB}{%
    \raisebox{-.6\dp\strutbox}{%
      \includegraphics[height=1.2\ht\strutbox]{fdfb-char}%
    }%
  }
\fi

\begin{document}

This is ﷻ in a standard document

{\LARGE This is ﷻ in a standard document}

\end{document}
egreg
  • 1,121,712
  • Is there also a straightforward workflow for pdflatex, or does that have to a separate question? – blackened Nov 09 '17 at 06:13
  • 1
    @blackened I’d make a PDF file with the glyph and insert it when needed with \includegraphics. Can you please edit your question specifying you want it in output rather than in input, so it can be reopened? – egreg Nov 09 '17 at 09:01
  • Edited the question. Is your approach suitable for the described workflow? – blackened Nov 09 '17 at 10:41