5

Minimal example:

\documentclass[12pt,a4paper,english]{abntex2}
\usepackage[utf8]{inputenc}

\usepackage[full]{textcomp}
\usepackage{mathcomp}
\usepackage{helvet}

\renewcommand{\familydefault}{\sfdefault}

\begin{document}

N → bo.

\end{document}

Compiling it results in:

./main.tex:12: Package textcomp Error: Symbol \textrightarrow not provided by
(textcomp)                font family phv in TS1 encoding.
(textcomp)                Default family used instead.

See the textcomp package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.12 N →
           bo.
./main.tex:12:  ==> Fatal error occurred, no output PDF file produced!

If I remove the \renewcommand{\familydefault}{\sfdefault} or \usepackage{helvet}, it works fine without any error.

If I remove \usepackage[full]{textcomp}, then, the error is:

./main.tex:12: Package inputenc Error: Unicode char → (U+2192)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.12 N →
           bo.
./main.tex:12:  ==> Fatal error occurred, no output PDF file produced!

How can I make the \renewcommand{\familydefault}{\sfdefault} work properly?

Related:

  1. textcomp \textarrow not found in font family ppl TS1 encoding
  2. \renewcommand{\familydefault}{\sfdefault} Only Changes the Font in Bold
  3. textcomp vs TS1 font encoding
root@debian9:~# latex --version
pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian)
kpathsea version 6.2.2
Copyright 2016 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.28; using libpng 1.6.28
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.48.0
2
  • 3
    You can avoid the error with \usepackage[full,warn]{textcomp} , but the arrow will be not be from helvet, as the font doesn't have it. Commented Nov 20, 2019 at 8:16
  • @UlrikeFischer would you extend your comment to an answer. I searched the internet for \usepackage[full,warn]{textcomp} and this string did not appear in my search engine results (google). It seems that including this in the posted document is a good answer.
    – corporal
    Commented Nov 20, 2019 at 10:06

2 Answers 2

4

The helvet font doesn't have the arrow. You can change the error to a warning with the warn option. Then textcomp will only add a warning to the log and substitute the arrow from another font. Using tgheros instead of helvet is better:

\documentclass[12pt,a4paper,english]{abntex2}
\usepackage[utf8]{inputenc}

\usepackage[full,warn]{textcomp}
\usepackage{mathcomp}
\usepackage{helvet}

\renewcommand{\familydefault}{\sfdefault}

\begin{document}

N → bo.

\end{document}

The arrow then

1
  • +1 good answer as usual
    – corporal
    Commented Nov 20, 2019 at 10:42
7

The helvet package uses only the characters provided by the original Helvetica that is part of the PostScript default fonts, most of the time via Nimbus Sans (URW Clone). TeX Gyre Heros is an extension of Nimbus Sans that supports the right arrow in text mode. Assuming that the class is actually unrelated to your problem:

\documentclass[12pt,a4paper,english]{article}
\usepackage[utf8]{inputenc}

\usepackage[full]{textcomp}
\usepackage{mathcomp}
\usepackage{tgheros}

\renewcommand{\familydefault}{\sfdefault}

\begin{document}

N → bo.

\end{document}

Result:

enter image description here

Since you are using Debian, you need to have fonts-texgyre installed.

You must log in to answer this question.

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