tectonic-typesetting / tectonic

A modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive.
https://tectonic-typesetting.github.io/
Other
3.99k stars 162 forks source link

microtype `testls` command does not work #1128

Closed cgahr closed 11 months ago

cgahr commented 11 months ago

The textls command of the microtype package does not work.

Consider the following document:

% test.tex
\documentclass[12pt, a4paper]{article}

\usepackage{microtype}

\begin{document}
\textls[100]{this should work}
\end{document}

$ pdflatex test.tex$: grafik

$ tectonic test.tex -Z continue-on-errors: grafik

❯ tectonic test.tex -Z continue-on-errors
Running TeX ...
error: test.tex:6: Package microtype Error: Letterspacing currently doesn't work with xetex.

See the microtype package documentation for explanation.
Type  H <return>  for immediate help
warning: errors were issued by the TeX engine, but were ignored; use --print and/or --keep-logs for details.
Running xdvipdfmx ...
Writing `test.pdf` (3.26 KiB)
Skipped writing 1 intermediate files (use --keep-intermediates to keep them)
rm-dr commented 11 months ago

What happens if you compile with xetex?

Judging by that error, I'd assume that microtype doesn't work with xetex (which is what tectonic uses)

Neved4 commented 11 months ago

Hey @cgahr great catch! 💙

I can reproduce: when using XeTeX/tectonic the \textls[^1] macro doesn't work, as @rm-dr pointed out. Sadly, this is the expected behaviour now. It may change in the future when microtype adds support for it.[^2]

In general you'd want to use LetterSpace and WordSpace to have a document compatible across pdfTeX/XeTeX/LuaTeX/tectonic.

[^1]: Note that \textls might break small caps when not using SmallCapsFeatures={Letters=SmallCaps} with fontspec. [^2]: microtype's manual specifies that \textls only works with pdfTeX/LuaTeX at the moment.
See §7 Letterspacing revisited, pdfTeX 1.40 | LuaTeX 0.62.

cgahr commented 11 months ago

That is sad to here, it was used in an external beamer-template.

However, something like \newcommand{\textls}[2][1]{\addfontfeature{LetterSpace=40em plus.1em minus.1em} #2} was a sufficient workaround for my use-case. Thank you very much for the pointer!

If you want to reopen this issue open for tracking purposes, please do so, from my side, it can be closed.