MWE:
\documentclass{article}
\usepackage{textcomp}
\usepackage{mathpazo}
\begin{document}
\textrightarrow
\end{document}
It generates the error:
! Package textcomp Error: Symbol \textrightarrow not provided by
(textcomp) font family ppl in TS1 encoding.
(textcomp) Default family used instead.
The problem is independent from package inputenc
. The package mainly controls characters with character codes between 127 and 255, not the ASCII characters.
It maps them to LICRs (LaTeX internal character represnetation), e.g. ö
becomes \"o
.
Package fontenc
maps the LICRs to the font encoding slots or replacement code.
The font encoding TS1
is a little special. There are many fonts that do not cover all characters in this encoding. Therefore package textcomp
defines encoding subsets that do not define all slots for such fonts. Font ppl
(Palatino) has subset 3. It is explained in the .log
file:
Package textcomp Info: Sub-encoding information:
(textcomp) 5 = only ISO-Adobe without \textcurrency
(textcomp) 4 = 5 + \texteuro
(textcomp) 3 = 4 + \textohm
(textcomp) 2 = 3 + \textestimated + \textcurrency
(textcomp) 1 = TS1 - \textcircled - \t
(textcomp) 0 = TS1 (full)
The font project TeX Gyre extends the free available URW fonts:
TeX Gyre Pagella is based on URW Palladio L (from Palatino, designed by Hermann Zapf in the 1940s).
The text fonts can be easily replaced by TeX Gyre Pagella with package tgpagella
:
\usepackage{mathpazo}
\usepackage{tgpagella}
Package mathpazo
is kept for the math fonts, that still use Palatino.
Full example:
\documentclass{article}
\usepackage{textcomp}
\usepackage{mathpazo}
\usepackage{tgpagella}
\begin{document}
\textrightarrow $\rightarrow$
\end{document}
Here the text version comes from TeX Gyre Pagella, the math version from the default Computer Modern fonts.
Example for LuaTeX/XeTeX:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{TeX Gyre Pagella}
\usepackage{unicode-math}
\setmathfont{TeX Gyre Pagella Math}
\begin{document}
\textrightarrow → $\rightarrow →$
\end{document}
The text and math versions of TeX Gyre Pagella (Math) use a different shape for U+2192 (RIGHTWARDS ARROW).
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\DeclareUnicodeCharacter{218A}{\turnedtwo}
\DeclareUnicodeCharacter{218B}{\turnedthree}
\makeatletter
\DeclareRobustCommand{\turnedtwo}{\make@turned{2}}
\DeclareRobustCommand{\turnedthree}{\make@turned{3}}
\newcommand{\make@turned}[1]{%
\raisebox{\depth}{\scalebox{-1}[-1]{#1}}%
}
\makeatother
\begin{document}
123456789↊↋0
\end{document}
Not sure whether this renders correctly, so I provide also an image of the code.
Output for the test file:
Addition October 2021
Prompted by comments, here's a version that works with all engines. I only provide the image of the code, because just a few fonts sport the glyph (among them, Fira Code).
Best Answer
The root file was UTF-8 encoded but the child file was APC encoded. I used @Mico's suggestion to solve the problem. I still do not know how to save a file with UTF-8 encoding. Anyway, I consider my problem solved by using Mico's suggestion.