I have a problem in enabling tracking of small caps [whether the font has small caps or not] when I load french babel plus microtype
.
The problem appears only in my titles for the section and only when those titles have some characters !, »
and perhaps others.
If I disable the tracking
from microtype
, all goes well.
LuaTeX error /texmf-dist/tex/generic/babel-french/frenchb.lua:66: attempt to index a nil value. section{SSS! » !}
Here is a extract from the manual of frenchb
, at page 38, which says that babels tweaks the small caps :
bsc: As family names
should be written in small capitals and never be hyphenated, we
provide a command (its name comes from Boxed Small Caps) to input them
easily. Note that this command has changed with version 2 of frenchb:
a kern0pt is used instead of hbox because hbox would break
microtype’s font expansion; as a (positive?) side effect, composed
names (such as Dupont-Durand) can now be hyphenated on explicit
hyphens. Usage: Jean~bsc{Duchemin}.
DeclareRobustCommand*{bsc}[1]{leavevmodebegingroupkern0pt scshape #1endgroup}
ifLaTeXeelseletscshaperelaxfi
I have no error when lualatex
compiles with microtype
without babel
and I do not have errors when only babel
is present.
There is no error with microtype+babel
**if I do not redefine my section with scshape
.**
I need polyglossia
because I have other languages with peculiar fonts,. I have no error when I disable tracking
in microtype
, but still keep babel+polyglossia+microtype
… plus my definition of section
This is the tex
file
documentclass[oneside,a4paper, 12pt]{article}
usepackage[frenchb]{babel}%%
usepackage{fontspec}
defaultfontfeatures{
Ligatures=TeX,
%Mapping=tex-text,
SmallCapsFeatures={Renderer=Basic}
}
setmainfont{TeX Gyre Termes}
usepackage{polyglossia}
setmainlanguage{french}
makeatletter
renewcommandsection{%
penalty-9999
@startsection {section}{1}{0em}{0parskip}{1cm}{%
centeringrmfamilybfseriesscshape%
righthyphenmin=62%
}
}
makeatother
usepackage[%
babel=true,
%protrusion=true,
%expansion=true,
%%%%%activate={true,nocompatibility}
%kerning=false,
%spacing=false,
tracking=true,
%factor=1100,
%stretch=40,
%shrink=10
]{microtype}
SetTracking{encoding={*}, family= *, shape=sc}{33}
begin{document}
section{SSS! » !}
end{document}