Fonts & Character SetsSmall Caps don't work with the name "Nigel"

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
petersfreeman
Posts: 19
Joined: Wed Apr 28, 2021 9:40 am

Small Caps don't work with the name "Nigel"

Post by petersfreeman »

Here is my problem. I am using the Garamond Libre font and have found that if the sequence "Nig" is being small capped as in "Nigel" but not "Anigelina" the "ig" is not small capped. Wierd!

Code: Select all

% !TEX TS-program = xelatex
% !TeX encoding = UTF-8
% !TeX spellcheck = en_CA

\documentclass[]{article}

\usepackage[]{fontspec}

\setmainfont[]{Garamond Libre}

\begin{document}
	\textsc{Nigel}
	
	\textsc{Migel}
	
	\textsc{Nagel}
	
	\textsc{Nizel}
	
	\textsc{Nigal}
	
	\textsc{Nigelina, here I come}
	
	\textsc{Anigelina}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Small Caps don't work with the name "Nigel"

Post by Ijon Tichy »

Seems to be a ligature problem with the font:

Code: Select all

\documentclass[]{article}

\usepackage[]{fontspec}

\setmainfont{Garamond Libre}

\begin{document}
	\textsc{Ni\/gel}
	
	\textsc{Migel}
	
	\textsc{Nagel}
	
	\textsc{Nizel}
	
	\textsc{Ni\/gal}
	
	\textsc{Ni\kern 0pt gelina, here I come}
	
	\textsc{Anigelina}
\end{document}
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Small Caps don't work with the name "Nigel"

Post by Stefan Kottwitz »

Indeed,

Code: Select all

\setmainfont[]{Garamond Libre}[Ligatures=NoRequired]
also changes that. Just for testing, I would not do that globally just because there's an issue with some specific word in small caps. I would use what Ijon said, I guess I would make a macro \Nigel for this if it occures several times in the document.

Also, there's a way with the microtype package:

Code: Select all

\DisableLigatures{encoding = *, shape = sc*}
but that seems to work only with pdfLaTeX, not XeLaTeX.

Or how about this:

Code: Select all

\documentclass[]{article}
\usepackage[]{fontspec}
\setmainfont[]{Garamond Libre}[SmallCapsFeatures= {RawFeature={+smcp,-rlig,-clig,-dlig,-hlig,-liga}}]
\begin{document}
	\textsc{Nigel fi ff fl ffl}
	Nigel fi ff fl ffl
\end{document}
You can see that ligatures are removed for small caps, while they are still used in regular text.

Stefan
LaTeX.org admin
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Small Caps don't work with the name "Nigel"

Post by Ijon Tichy »

To globally disable the ligatures for SmallCaps only use:

Code: Select all

\documentclass[]{article}

\usepackage[]{fontspec}

\setmainfont{Garamond Libre}[SmallCapsFeatures={Ligatures=NoRequired}]

\begin{document}
	\textsc{Nigel}
	
	\textsc{Migel}
	
	\textsc{Nagel}
	
	\textsc{Nizel}
	
	\textsc{Nigal}
	
	\textsc{Nigelina, here I come}
	
	\textsc{Anigelina}
\end{document}
See Section 3, »Different features for different font shapes«, of the fontspec manual for more information.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Small Caps don't work with the name "Nigel"

Post by Stefan Kottwitz »

Ijon's suggestion looks good, I would extend it a bit do prevent the other ligatures too, with small caps:

Code: Select all

\documentclass[]{article}
\usepackage[]{fontspec}
\setmainfont[]{Garamond Libre}[SmallCapsFeatures= {Ligatures={NoRequired,NoCommon,NoDiscretionary,NoHistoric,NoContextual}}]
\begin{document}
	\textsc{Nigel fi ff fl ffl}
	Nigel fi ff fl ffl
\end{document}
Stefan
LaTeX.org admin
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Small Caps don't work with the name "Nigel"

Post by Ijon Tichy »

Yes, I've not tested, if the font provides any SmallCaps ligatures. If not, switching of all of them indeed would be a good idea.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply