# Set tracking amount with microtype

The question is this: How can I globally set the amount of tracking to be executed with microtype's \textls command?

More details:

The microtype package gives the option of setting the space between letters. This is called letterspacing or tracking. microtype will do this automatically only for upright small capitals, not for full capitals or italicized small capitals. This can, however, be set manually with the \textls command, see Tracking in full caps and italicized small caps for details.

To avoid having to specify the amount of tracking every time the \textls command is used, as shown in the linked question above, I'd like to set it globally with \SetTracking. Cf. the microtype manual under 5.3:

The \SetTracking command allows specifying the tracking amount for different fonts or font sets. It will also be evaluated by the \textls command [...].

This command has the structure \SetTracking[<options>]{<set of fonts>}{<tracking amount>}, see 5.3. The <set of fonts> is explained in the manual under 4, where it says:

If an attribute list is empty or missing [...] it does not constitute a restriction. In other words, this is equivalent to specifying all possible values for that attribute.

Given this, it should be possible to use \SetTracking{}{<tracking amount>} to set the amount of tracking used when \textls is called.

For some reason, however, this doesn't work. In the MWE below, the command \SetTracking{}{500} seems to be ignored. Only the setting letterspace = 50 as microtype option seems to be evaluated.

Question: How can I globally set the amount of tracking to be executed with \textls?

\documentclass{article}
\usepackage[tracking = true, letterspace = 50]{microtype}
\SetTracking{}{500}
\usepackage{libertine}
\begin{document}
\textls{ABCD} \textsc{abcd} \textls[500]{\textit{ABCD \textsc{abcd}}}
\end{document}


\documentclass{article}
\usepackage[tracking = true, letterspace = 50]{microtype}
\SetTracking{encoding=*}{500}
\SetTracking{encoding=*, shape=sc}{50}
\usepackage{libertine}
\begin{document}
\textls{ABCD} \textsc{abcd} \textls[500]{\textit{ABCD \textsc{abcd}}}
\end{document}

• I see that the manual uses encoding=* as well (but I didn't see an explanation for it), but it puzzles me why this is necessary. When compiling with luatex, for example, encoding isn't a relevant feature anyway. – Sverre Jun 8 '14 at 11:48
• @Sverre Yes. I couldn't find an explanation in the manual either. I posted an answer anyway just because you'd asked how to do it and not why! But it would be good to have an explanation. I didn't try with luatex but that does seem odd... – cfr Jun 8 '14 at 13:23
• Also, I see in your example that \SetTracking{encoding=*}{500} simply overrides letterspace = 50. If not then \textsc{abcd} should have come out with a letterspace of 50/1000em. So this seems to be equivalent to just setting letterspace = 500. – Sverre Jun 8 '14 at 13:49
• @Sverre See update to answer. I assume it changes the spacing for \textsc since the change affects \textls as well as other things. But the documentation is not very clear about these matters. – cfr Jun 8 '14 at 14:22
• Right, it seems like \SetTracking is simply a more detailed version of the tracking and letterspace options that lets you fine-tune the tracking according to various font features. If there's a conflict between \SetTracking and the microtype options, then the former takes precedence. The \textls command is affected by whichever setting has taken precedence. As you say, the manual doesn't spell this out very clearly. – Sverre Jun 8 '14 at 14:51