40  Technical How-Tos

40.1 Missing Unicode characters

Markdown manuscript are in unicode, which allow us to enter many languages directly and a range of special symbols.

LaTeX issues a warning if a character is missing from your chosen font, for instance:

Missing character: There is no ὀ (U+1F40) (U+1F40) in font STIXTwoText:mode=node;script

In LaTeX/PDF output there are three solutions for this:

  1. generate missing characters by combining other characters of the same font (typically a diacritic plus a character)
  2. generate missing characters by using a math symbol command (typical for symbols)
  3. use a different font for specific Unicode ranges

Methods 1-2 rely on the newunicodechar package. Method 3 on fontspec.

It’s good to have a character table for your font. See for instance STIX font docs: the character table indicates which characters can be built from others.

40.1.1 Unicode from math

You could use use LaTeX’s (inputenc’s) DeclareUnicodeChar command, if you know the character’s UTF-8 number:

\DeclareUnicodeCharacter{2234}{\ensuremath{\therefore}}
\DeclareUnicodeCharacter{2713}{\ensuremath{\checkmark}}

Or the newunicodechar package, which allows you to use the character itself:

\usepackage{newunicodechar}
\newunicodechar{∴}{\ensuremath{\therefore}}
\newunicodechar{✓}{\ensuremath{\checkmark}}

Either option requires a header-includes or a modification of your LaTeX template.

We use a metadata variable instead. This allows us to enter the desired character directly or as a HTML entity (which Pandoc converts to the desired char before passing it on to our LaTeX template):

unicodefrommath:
- char: '∴'
  is: \therefore
- char:
  is: \checkmark

This is supported as follows in our Pandokoma template:

$if(unicodefrommath)$
\usepackage{newunicodechar}
$for(unicodefrommath)$
  $if(it.char)$
    $if(it.is)$\newunicodechar{$it.char$}{\ensuremath{$it.is$}}$endif$
  $endif$
$endfor$
$endif$

40.1.2 Provide Unicode characters

For LaTeX/PDF, use \DeclareUnicodeCharacter or newunicodechar.

We use pandokoma’s yaml declaration. Here’s our declaration for the Greek extended block:

newunicodechar:
- char:
  command: α\symbol{"0313"}
- char:
  command: α\symbol{"0314}
- char:
  command: α\symbol{"0313}\symbol{"0300}
- char:
  command: α\symbol{"0314}\symbol{"0300}
- char:
  command: α\symbol{"0313}\symbol{"0301}
- char:
  command: α\symbol{"0314}\symbol{"0301}
- char:
  command: α\symbol{"0313}\symbol{"00342}
- char:
  command: α\symbol{"0314}\symbol{"00342}
- char:
  command: Α\symbol{"0313}
- char:
  command: Α\symbol{"0314}
- char:
  command: Α\symbol{"0313}\symbol{"0300}
- char:
  command: Α\symbol{"0314}\symbol{"0300}
- char:
  command: Α\symbol{"0313}\symbol{"0301}
- char:
  command: Α\symbol{"0314}\symbol{"0301}
- char:
  command: Α\symbol{"0313}\symbol{"0342}
- char:
  command: Α\symbol{"0314}\symbol{"0342}
- char:
  command: ε\symbol{"0313}
- char:
  command: ε\symbol{"0314}
- char:
  command: ε\symbol{"0313}\symbol{"0300}
- char:
  command: ε\symbol{"0314}\symbol{"0300}
- char:
  command: ε\symbol{"0313}\symbol{"0301}
- char:
  command: ε\symbol{"0314}\symbol{"0301}
- char:
  command: Ε\symbol{"0313}
- char:
  command: Ε\symbol{"0314}
- char:
  command: Ε\symbol{"0313}\symbol{"0300}
- char:
  command: Ε\symbol{"0314}\symbol{"0300}
- char:
  command: Ε\symbol{"0313}\symbol{"0301}
- char:
  command: Ε\symbol{"0314}\symbol{"0301}
- char:
  command: Α\symbol{"0313}\symbol{"0342}
- char:
  command: Α\symbol{"0314}\symbol{"0342}
- char:
  command: η\symbol{"0313}
- char:
  command: η\symbol{"0314}
- char:
  command: η\symbol{"0313}\symbol{"0300}
- char:
  command: η\symbol{"0314}\symbol{"0300}
- char:
  command: η\symbol{"0313}\symbol{"0301}
- char:
  command: η\symbol{"0314}\symbol{"0301}
- char:
  command: η\symbol{"0313}\symbol{"00342}
- char:
  command: η\symbol{"0314}\symbol{"00342}
- char:
  command: Η\symbol{"0313}
- char:
  command: Η\symbol{"0314}
- char:
  command: Η\symbol{"0313}\symbol{"0300}
- char:
  command: Η\symbol{"0314}\symbol{"0300}
- char:
  command: Η\symbol{"0313}\symbol{"0301}
- char:
  command: Η\symbol{"0314}\symbol{"0301}
- char:
  command: Η\symbol{"0313}\symbol{"0342}
- char:
  command: Η\symbol{"0314}\symbol{"0342}
- char:
  command: ι\symbol{"0313"}
- char:
  command: ι\symbol{"0314}
- char:
  command: ι\symbol{"0313}\symbol{"0300}
- char:
  command: ι\symbol{"0314}\symbol{"0300}
- char:
  command: ι\symbol{"0313}\symbol{"0301}
- char:
  command: ι\symbol{"0314}\symbol{"0301}
- char:
  command: ι\symbol{"0313}\symbol{"00342}
- char:
  command: ι\symbol{"0314}\symbol{"00342}
- char:
  command: Ι\symbol{"0313}
- char:
  command: Ι\symbol{"0314}
- char:
  command: Ι\symbol{"0313}\symbol{"0300}
- char:
  command: Ι\symbol{"0314}\symbol{"0300}
- char:
  command: Ι\symbol{"0313}\symbol{"0301}
- char:
  command: Ι\symbol{"0314}\symbol{"0301}
- char:
  command: Ι\symbol{"0313}\symbol{"0342}
- char: Ἷ
  command: Ι\symbol{"0314}\symbol{"0342}
- char:
  command: ο\symbol{"0313}
- char:
  command: ο\symbol{"0314}
- char:
  command: ο\symbol{"0313}\symbol{"0300}
- char:
  command: ο\symbol{"0314}\symbol{"0300}
- char:
  command: ο\symbol{"0313}\symbol{"0301}
- char:
  command: ο\symbol{"0314}\symbol{"0301}
- char:
  command: Ο\symbol{"0313}
- char:
  command: Ο\symbol{"0314}
- char:
  command: Ο\symbol{"0313}\symbol{"0300}
- char:
  command: Ο\symbol{"0314}\symbol{"0300}
- char:
  command: Ο\symbol{"0313}\symbol{"0301}
- char:
  command: Ο\symbol{"0314}\symbol{"0301}
- char:
  command: υ\symbol{"0313"}
- char:
  command: υ\symbol{"0314}
- char:
  command: υ\symbol{"0313}\symbol{"0300}
- char:
  command: υ\symbol{"0314}\symbol{"0300}
- char:
  command: υ\symbol{"0313}\symbol{"0301}
- char:
  command: υ\symbol{"0314}\symbol{"0301}
- char:
  command: υ\symbol{"0313}\symbol{"00342}
- char:
  command: υ\symbol{"0314}\symbol{"00342}
- char:
  command: Υ\symbol{"0314}
- char:
  command: Υ\symbol{"0314}\symbol{"0300}
- char:
  command: Υ\symbol{"0314}\symbol{"0301}
- char:
  command: Υ\symbol{"0314}\symbol{"0342}
- char:
  command: ω\symbol{"0313"}
- char:
  command: ω\symbol{"0314}
- char:
  command: ω\symbol{"0313}\symbol{"0300}
- char:
  command: ω\symbol{"0314}\symbol{"0300}
- char:
  command: ω\symbol{"0313}\symbol{"0301}
- char:
  command: ω\symbol{"0314}\symbol{"0301}
- char:
  command: ω\symbol{"0313}\symbol{"00342}
- char:
  command: ω\symbol{"0314}\symbol{"00342}
- char:
  command: Ω\symbol{"0313}
- char:
  command: Ω\symbol{"0314}
- char:
  command: Ω\symbol{"0313}\symbol{"0300}
- char:
  command: Ω\symbol{"0314}\symbol{"0300}
- char:
  command: Ω\symbol{"0313}\symbol{"0301}
- char:
  command: Ω\symbol{"0314}\symbol{"0301}
- char:
  command: Ω\symbol{"0313}\symbol{"0342}
- char:
  command: Ω\symbol{"0314}\symbol{"0342}
- char:
  command: α\symbol{"0300}
- char:
  command: α\symbol{"0301}
- char:
  command: ε\symbol{"0300}
- char:
  command: ε\symbol{"0301}
- char:
  command: η\symbol{"0300}
- char:
  command: η\symbol{"0301}
- char:
  command: ι\symbol{"0300}
- char:
  command: ι\symbol{"0301}
- char:
  command: ο\symbol{"0300}
- char:
  command: ο\symbol{"0301}
- char:
  command: υ\symbol{"0300}
- char:
  command: υ\symbol{"0301}
- char:
  command: ω\symbol{"0300}
- char:
  command: ω\symbol{"0301}
- char:
  command: α\symbol{"0313}\symbol{"0345}
- char:
  command: α\symbol{"0314}\symbol{"0345}
- char:
  command: α\symbol{"0313}\symbol{"0300}\symbol{"0345}
- char:
  command: α\symbol{"0314}\symbol{"0300}\symbol{"0345}
- char:
  command: α\symbol{"0313}\symbol{"0301}\symbol{"0345}
- char:
  command: α\symbol{"0314}\symbol{"0301}\symbol{"0345}
- char:
  command: α\symbol{"0313}\symbol{"0342}\symbol{"0345}
- char:
  command: α\symbol{"0314}\symbol{"0342}\symbol{"0345}
- char:
  command: Α\symbol{"0313}\symbol{"0345}
- char:
  command: Α\symbol{"0314}\symbol{"0345}
- char:
  command: Α\symbol{"0313}\symbol{"0300}\symbol{"0345}
- char:
  command: Α\symbol{"0314}\symbol{"0300}\symbol{"0345}
- char:
  command: Α\symbol{"0313}\symbol{"0301}\symbol{"0345}
- char:
  command: Α\symbol{"0314}\symbol{"0301}\symbol{"0345}
- char:
  command: Α\symbol{"0313}\symbol{"0342}\symbol{"0345}
- char:
  command: Α\symbol{"0314}\symbol{"0342}\symbol{"0345}
- char:
  command: η\symbol{"0313}\symbol{"0345}
- char:
  command: η\symbol{"0314}\symbol{"0345}
- char:
  command: η\symbol{"0313}\symbol{"0300}\symbol{"0345}
- char:
  command: η\symbol{"0314}\symbol{"0300}\symbol{"0345}
- char:
  command: η\symbol{"0313}\symbol{"0301}\symbol{"0345}
- char:
  command: η\symbol{"0314}\symbol{"0301}\symbol{"0345}
- char:
  command: η\symbol{"0313}\symbol{"0342}\symbol{"0345}
- char:
  command: η\symbol{"0314}\symbol{"0342}\symbol{"0345}
- char:
  command: Η\symbol{"0313}\symbol{"0345}
- char:
  command: Η\symbol{"0314}\symbol{"0345}
- char:
  command: Η\symbol{"0313}\symbol{"0300}\symbol{"0345}
- char:
  command: Η\symbol{"0314}\symbol{"0300}\symbol{"0345}
- char:
  command: Η\symbol{"0313}\symbol{"0301}\symbol{"0345}
- char:
  command: Η\symbol{"0314}\symbol{"0301}\symbol{"0345}
- char:
  command: Η\symbol{"0313}\symbol{"0342}\symbol{"0345}
- char:
  command: Η\symbol{"0314}\symbol{"0342}\symbol{"0345}
- char:
  command: ω\symbol{"0313}\symbol{"0345}
- char:
  command: ω\symbol{"0314}\symbol{"0345}
- char:
  command: ω\symbol{"0313}\symbol{"0300}\symbol{"0345}
- char:
  command: ω\symbol{"0314}\symbol{"0300}\symbol{"0345}
- char:
  command: ω\symbol{"0313}\symbol{"0301}\symbol{"0345}
- char:
  command: ω\symbol{"0314}\symbol{"0301}\symbol{"0345}
- char:
  command: ω\symbol{"0313}\symbol{"0342}\symbol{"0345}
- char:
  command: ω\symbol{"0314}\symbol{"0342}\symbol{"0345}
- char:
  command: Ω\symbol{"0313}\symbol{"0345}
- char:
  command: Ω\symbol{"0314}\symbol{"0345}
- char:
  command: Ω\symbol{"0313}\symbol{"0300}\symbol{"0345}
- char:
  command: Ω\symbol{"0314}\symbol{"0300}\symbol{"0345}
- char:
  command: Ω\symbol{"0313}\symbol{"0301}\symbol{"0345}
- char:
  command: Ω\symbol{"0314}\symbol{"0301}\symbol{"0345}
- char:
  command: Ω\symbol{"0313}\symbol{"0342}\symbol{"0345}
- char:
  command: Ω\symbol{"0314}\symbol{"0342}\symbol{"0345}
- char:
  commmand: α\symbol{"0306}
- char:
  commmand: α\symbol{"0304}
- char:
  command: α\symbol{"0300}\symbol{"0345}
- char:
  command: α\symbol{"0345}
- char:
  command: α\symbol{"0301}\symbol{"0345}
- char:
  command: α\symbol{"0342}
- char:
  command: α\symbol{"0342}\symbol{"0345}
- char:
  command: Α\symbol{"0306}
- char:
  command: Α\symbol{"0304}
- char:
  command: Α\symbol{"0300}
- char:
  command: Α\symbol{"0301}
- char:
  command: Α\symbol{"0345}
- char:
  command: ι
- char:
  command: η\symbol{"0300}\symbol{"0345}
- char:
  command: η\symbol{"0345}
- char:
  command: η\symbol{"0301}\symbol{"0345}
- char:
  command: η\symbol{"0342}
- char:
  command: η\symbol{"0342}\symbol{"0345}
- char:
  command: Ε\symbol{"0300}
- char:
  command: Ε\symbol{"0301}
- char:
  command: Η\symbol{"0300}
- char:
  command: Η\symbol{"0301}
- char:
  command: Η\symbol{"0345}
- char:
  command: ι\symbol{"0306}
- char:
  command: ι\symbol{"0304}
- char:
  command: ι\symbol{"0308}\symbol{"0300}
- char:
  command: ι\symbol{"0308}\symbol{"0301}
- char:
  command: ι\symbol{"0342}
- char:
  command: ι\symbol{"0308}\symbol{"0342}
- char:
  command: Ι\symbol{"0306}
- char:
  command: Ι\symbol{"0304}
- char:
  command: Ι\symbol{"0300}
- char:
  command: Ι\symbol{"0301}
- char:
  command: υ\symbol{"0306}
- char:
  command: υ\symbol{"0304}
- char:
  command: υ\symbol{"0308}\symbol{"0300}
- char:
  command: υ\symbol{"0308}\symbol{"0301}
- char:
  command: ρ\symbol{"0313}
- char:
  command: ρ\symbol{"0314}
- char:
  command: υ\symbol{"0342}
- char:
  command: υsymbol{"0308}\symbol{"0342}
- char:
  command: Υ\symbol{"0306}
- char:
  command: Υ\symbol{"0304}
- char:
  command: Υ\symbol{"0300}
- char:
  command: Υ\symbol{"0301}
- char:
  command: Ρ\symbol{"0314}
- char:
  command: ω\symbol{"0300}\symbol{"0345}
- char:
  command: ω\symbol{"0345}
- char:
  command: ω\symbol{"0301}\symbol{"0345}
- char:
  command: ω\symbol{"0342}
- char:
  command: ω\symbol{"0342}\symbol{"0345}
- char:
  command: Ο\symbol{"0300}
- char:
  command: Ο\symbol{"0301}
- char:
  command: Ω\symbol{"0300}
- char:
  command: Ω\symbol{"0301}
- char:
  command: Ω\symbol{"0345}

40.1.3 Background on LaTeX / unicode

To print Unicode chars by number use \symbol{} or \char. For omicron (Unicode decimal 959, hexadecimal OxO3BF):

\symbol{"03BF}
\symbol{959}
\char"03BF
\char959

To combine a character with a diacritic use the character directly followed by the combining diacritic. For instance, you can create Greek small omicron with psili (Unicode U+1F40) by combining Greek small omicron (ο, U+03BF) with the combining Greek koronis (U+0343). Any of these work:

ο\symbol{"0343}
ο\char"0343
\char"03BF\char"0343
\symbol{"03BF}\char"0343
\symbol{"03BF}\symbol{"0343}
\char"03BF\symbol{"0343}

The combining Greek Koronis is usually the same as the combining comma above (U+0313), so you could use that instead.