microtype icon indicating copy to clipboard operation
microtype copied to clipboard

XeTeX compatibility

Open appetrosyan opened this issue 2 years ago • 5 comments

Hi, I'd like to request XeTeX compatibility be considered. Currently any attempt to compile a package results in the following "error":

Package microtype Error: Letterspacing currently doesn't work with xetex.

See the microtype package documentation for explanation.
Type  H <return>  for immediate help
error: halted on potentially-recoverable error as specified

The currently part makes me hope that it is possible to re-enable the compatibility.

Rationale

https://github.com/tectonic-typesetting/tectonic uses a customised fork of XeLaTeX. Aside from that it is an incredibly convenient typesetting system: it doesn't occupy tens of gigabytes, it fetches only the packages that are needed and frankly the choice to use a more modern version of LaTeX allows it to be built for other platforms.

Currently any document that requires microtype cannot be built with tectonic, necessitating a TeXLive installation.

appetrosyan avatar Sep 15 '22 14:09 appetrosyan

First of all, you must be doing something to provoke this error message (either you're loading the package with the tracking option, or you're using the \textls command). Just loading microtype should not result in any errors, and it should run just fine with tectonic/xetex. So if you really get this error message for no apparent reason, something else would be wrong (for which I'd need a MWE).

As to whether it's possible to allow letterspacing with xetex: in principle yes, because xetex is able to add letterspacing to (OpenType) fonts via fontspec's LetterSpace option. I could integrate this into microtype's interface -- in fact this has long been on my todo list, and your report has now upped it... For the time being, you could use the interface provided by fontspec.

schlcht avatar Sep 15 '22 22:09 schlcht

(either you're loading the package with the tracking option, or you're using the \textls command)

Exactly! I didn't notice it before making the MWE.

appetrosyan avatar Sep 16 '22 06:09 appetrosyan

I'm also using tectonic and therefore a fork of xetex and would love to use the automatic font expansion option of microtype. Is it difficult to implement this for xetex?

af2005 avatar Apr 29 '24 21:04 af2005

I wonder if there can be a simple package that can convert the microtyping macros into XeTeX native instructions.

appetrosyan avatar Apr 30 '24 15:04 appetrosyan

I'm also using tectonic and therefore a fork of xetex and would love to use the automatic font expansion option of microtype. Is it difficult to implement this for xetex?

Font expansion would have to be implemented in the engine itself, so there's nothing microtype can do. (Some time ago, there were some rumours that expansion would be made available in xetex, but nothing seems to have come of it. Since development is basically frozen, I wouldn't hold my breath.)

As for the original request (letterspacing): this is feasible, and I'll have a look.

schlcht avatar May 02 '24 22:05 schlcht