microtype icon indicating copy to clipboard operation
microtype copied to clipboard

The `\SetTracking` command does not override the inter-word spacing setup of a previous `\SetTracking` unless the tracking values are also different

Open linguisticturn opened this issue 3 weeks ago • 2 comments

Description

The \SetTracking command does not override the inter-word spacing setup of a previous \SetTracking command unless the tracking values are different as well in the two commands. Tested with pdflatex and all TeXLive versions from 2014 to 2024 (i.e. all versions of TeXLive available on OverLeaf).

First reported on the TeX StackExchange here: https://tex.stackexchange.com/questions/736655/microtypes-settracking-command-does-not-override-the-inter-word-spacing-setup .

The issue is not limited to the spacing optional argument, but also appears for e.g. outer spacing , outer kerning, and probably all other optional arguments (though I haven't tested all of them).

Minimal example demonstrating the issue

\documentclass[12pt]{report}
\usepackage{microtype}
\microtypesetup{tracking=true,spacing=true,activate=true} % I don't think this is necessary, but I'm including it just in case
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{calc}
\usepackage[left=0.25in,top=0.25in]{geometry}
\usepackage{parskip}
%
\begin{document}

{
\SetTracking[spacing={600*,,}]{encoding = * }{ 160 }
Stop \textls{stealing sheep}!\\
}
{ 
\SetTracking[spacing={6000*,,}]{encoding = * }{ 160 } % if this is used, the inter-word spacing remains 600*
% \SetTracking[spacing={6000*,,}]{encoding = * }{ 161 } % if this is used, the inter-word spacing does become 6000*
Stop \textls{stealing sheep}!
}
\end{document}

in the .log file, one finds the following (here the name of the compiled file is spacing.tex):

Package microtype Warning: tracking amount list 'spacing.tex/17' will
(microtype)                            override list 'spacing.tex/13' for
(microtype)                            font 'T1////' on input line 17.

So it seems like the second \SetTracking command should override the first. But that only happens if the tracking value in the second \SetTracking command is even a little bit different from that in the first, i.e. if it's 160 in the first and 161 in the second.

linguisticturn avatar Feb 06 '25 21:02 linguisticturn