4

To save space in tables, I want to reduce the tracking in the words. To do this I am using code from here.

The code below works correctly and is displayed as expected, but for every occurence of \test I am getting a warning like this: Package microtype Warning: tracking amount list `output.tex/8' will override list `default' for font `OT1////' on input line 8. I wasn't able to figure out why this happens, maybe someone with deeper insight could help me out here.

\documentclass{article}
\usepackage{microtype}

\newcommand\narrowstyle{\SetTracking{encoding=*}{-50}\lsstyle}
\newcommand{\test}{\narrowstyle Test}
\begin{document}
\test\test\test
\end{document}
4
  • 2
    So? It's just a warning. Since you do in on purpose, it's safe to ignore.
    – Ingmar
    Aug 14 at 14:37
  • Yeah but I got a few thousand warnings it's really clogging up @Ingmar
    – Chrisstar
    Aug 14 at 16:31
  • 1
    Take a look at the silence package, then, It's very versatile.
    – Ingmar
    Aug 14 at 17:48
  • 2
    \SetTracking is meant to be used in the preamble only. You could set up a context for the narrow parts: \SetTracking[context=narrow]{encoding=*}{-50}, and then in your \narrowstyle command: \microtypecontext{tracking=narrow}
    – Robert
    Aug 14 at 17:51

2 Answers 2

3

If you're absolutely sure that the warning messages are innocuous, you could load the microtype package with the option verbose=silent.

Incidentally, I would replace

\newcommand{\test}{\narrowstyle Test}

with

\newcommand{\test}{{\narrowstyle Test}}

in order to limit the scope of \narrowstyle.

For more on this option, see section 3.5, entitled "Miscellaneous options" of the user guide of the microtype package.

enter image description here

\documentclass{article}
\usepackage[verbose=silent]{microtype}
\newcommand\narrowstyle{\SetTracking{encoding=*}{-50}\lsstyle}
\newcommand{\test}{{\narrowstyle Test}}

\begin{document}
\test\test\test --- looks dreadful

TestTestTest --- default
\end{document}
1

I ended up using \textls instead, which works fine and without errors and doesn't require silencing any errors (though that is also a helpful option):

\documentclass{article}
\usepackage{microtype}
\newcommand\narrowstyle[1]{\textls[-50]{#1}}
\newcommand{\test}{\narrowstyle{Test}}

\begin{document}
\test\test\test
\end{document}

Note that if you wanted to keep the original semantics, @Roberts answer is probably the best option:

\SetTracking[context=narrow]{encoding=*}{-50}
\newcommand\narrowstyle{\microtypecontext{tracking=narrow}}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .