Change tracking for sans serif font

I want to change the tracking (space between the characters) for a sans serif font. I found that I can use the microtype package to change the tracking of the smallcaps font (\textsc{foo}), but I can't figure out how to make \textsc{} a sans serif font.

• did you try \textsf? – barbara beeton Oct 14 '16 at 15:27
• I don't know how to make the tracking package modify testsf instead of testsc... Hm. Let me try... – vy32 Oct 14 '16 at 15:29
• No, it didn't work – vy32 Oct 14 '16 at 15:30
• you can only make textsc into a sans serif font if you have a sans serif small caps font (most font sets do not) microtype will apply if you have such a font. – David Carlisle Oct 14 '16 at 15:51
• Well, my goal remains — I want to change the tracking between the characters in a sans serif font. I don't know how to do this. Do you have a suggestion? – vy32 Oct 14 '16 at 15:59

Do you mean, you want to 'set tracking' only for your sans serif font? (Because I hope you don't want to 'make' small caps be sans serif ... rather you should choose a sans serif that contains a small caps schape, as in the below example.)

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{libertine}

\usepackage[tracking=true]{microtype}
\DeclareMicrotypeSet*[tracking]{my}
{ encoding = *,
font = */sf*/*/*/*,
}
\SetTracking[
%  spacing = {500*,166, }
]{
encoding = *,
family = sf*,
}{ 500 }
\SetTracking[]{encoding = *, family = rm* }{ 10 }
\SetTracking[]{encoding = *, shape = sc }{ 100 }

\def\test{I want to change the tracking (space between the characters)
for a sans serif font. I found that I can use the microtype package
to change the tracking of the smallcaps font
({\ttfamily\textbackslash textsc\{foo\}}), but I can't figure out
how to make {\ttfamily\textbackslash textsc{}} a sans serif font.}

\begin{document}
\parskip 12pt
\parindent 0pt

RM:

\test

SF:

{\sffamily\test}

SC (RM):

{\scshape\test}

SF+SC:

{\sffamily\scshape\test}

TT:

{\ttfamily\test}

\end{document}

• I tried compiling that and got this error: ! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts. – vy32 Oct 16 '16 at 1:39
• By Tracking, I mean that I want the text to look like this: T H E   T E X T – vy32 Oct 16 '16 at 2:00
• I know what you want to achieve. I choose a deliberately exaggerated value for your sans serif family. But I don't know why you get that pdfTeX error. (I am using TeX Live 2016:  pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016); libertine.sty 2014/11/25; microtype.sty 2016/05/14.) If you are using MikTeX, then maybe this question is of value: tex.stackexchange.com/q/283960/8528 ..? – jon Oct 16 '16 at 2:06
• okay. apparently Macports corrupted my LaTeX installation (again???) and I had to wipe it and download TeXLive. Now it works great. Thanks! – vy32 Oct 17 '16 at 13:54
• @vy32 -- Glad it works! – jon Oct 17 '16 at 18:32