tracking of fonts in small capital with frenchb from babel+ microtype [closed]

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]{\leavevmode\begingroup\kern0pt \scshape #1\endgroup}
\ifLaTeXe\else\let\scshape\relax\fi


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
\renewcommand\section{%
\penalty-9999
\@startsection {section}{1}{0em}{0\parskip}{1cm}{%
\centering\rmfamily\bfseries\scshape%
\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}


closed as unclear what you're asking by Andrew Swann, Bobyandbob, Troy, Stefan Pinnow, CarLaTeXMay 15 '18 at 10:35

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• It makes no real sense to use babel together with polyglossia. However, tracking doesn't work with xelatex and TeX Gyre Termes has no bold Small Caps. – user2478 Dec 31 '15 at 9:59
• With fontspec, you can use a command like this: \addfontfeature{LetterSpace=20.0}. – Bernard Dec 31 '15 at 13:59