Fonts & Character SetsWhat is wrong with microtype in this code?

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

What is wrong with microtype in this code?

Post by Cham »

I'm getting several warnings in the console during compilation of this MWE code:

Code: Select all

\RequirePackage[l2tabu,orthodox]{nag}
\documentclass[11pt,twoside]{book}
\usepackage{microtype}
\usepackage{amsmath}
\usepackage[separate-uncertainty=true]{siunitx}

\begin{document}

Blabla :
	\begin{align*}
		\si{\nano} (\text{nano}) &= \num{e-9}, \\[6pt]
		\si{\micro} (\text{micro}) &= \num{e-6}, \\[6pt]
	\end{align*}

\end{document}
Here are the warnings I'm getting after compilation:
Package microtype Warning: Unknown slot number of character
(microtype) `\textminus '
(microtype) in font encoding `TS1' in protrusion list
(microtype) `textcomp'.

Package microtype Warning: Unknown slot number of character
(microtype) `\texttrademark '
(microtype) in font encoding `TS1' in protrusion list
(microtype) `textcomp'.

Package microtype Warning: Unknown slot number of character
(microtype) `\textcopyright '
(microtype) in font encoding `TS1' in protrusion list
(microtype) `textcomp'.

Package microtype Warning: Unknown slot number of character
(microtype) `\textregistered '
(microtype) in font encoding `TS1' in protrusion list
(microtype) `textcomp'.

Package microtype Warning: Unknown slot number of character
(microtype) `\textdegree '
(microtype) in font encoding `TS1' in protrusion list
(microtype) `textcomp'.
I don't understand what's going on here. I don't see what I have done wrong. How can I fix that code?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

What is wrong with microtype in this code?

Post by Cham »

There's another description of this problem here :

https://tex.stackexchange.com/questions ... s-warnings

It's indeed the micro symbol (weird shape of \mu) that causes the warnings.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

What is wrong with microtype in this code?

Post by Stefan Kottwitz »

Hi Cham,

indeed, and simply loading the textcomp package fixes it, since siunitx supports textcomp symbols.

\usepackage{textcomp}

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

What is wrong with microtype in this code?

Post by Cham »

What difference may I see if I load textcomp ?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

What is wrong with microtype in this code?

Post by Stefan Kottwitz »

The warnings go away, microtype can work with it, and proper fonts are used.

Otherwise, without textcomp, siunitx just uses its own symbols, that's more a workaround by this package.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

What is wrong with microtype in this code?

Post by Cham »

I mean will I see any differences in the main text and equations that aren't using any siunitx commands ?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

What is wrong with microtype in this code?

Post by Stefan Kottwitz »

Probably not!

textcomp only provides additional symbols, for example, math symbols (arrows, delimiters), currency symbols, diacritics, and greek symbols that can be used in text mode. I would use it by default, just in case. The author of siunitx (Joseph, he is a moderator here on latex.org btw.) would prefer textcomp too, but he did not want to enforce users to load it so he provides some symbols, such as the micro symbol, himself.

If you did not use it before, you won't see a difference.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

What is wrong with microtype in this code?

Post by Cham »

Thanks. I will keep it then.

Case is solved. :)
Post Reply