Sat Sep 16 23:30:56 2023, original submission:
Original issue is described at https://tex.stackexchange.com/questions/696172/tipauni-xecjk-loading-xecjk-messes-up-position-of-ipa-diacritics.
---------------------------------------------
Loading tipauni with xeCJK changes the spacing of some IPA diacritics. For instance, consider the following minimal example:
```
\documentclass{article}
\usepackage[documentfont=DoulosSIL]{tipauni}
\usepackage{xeCJK} % order of loading does not matter
\begin{document}
\textipa{\|x{m}\s{m}}
\end{document}
```
This produces what is in "bad.png," instead of the expected "good.png."
As TeX Stack Exchange user egreg identified, this is related to the interchar tokens xeCJK activates. When xeCJK is not loaded:
```
....\TU/DoulosSIL(0)/m/n/10 m̽m̩
```
And when it is:
```
....\TU/DoulosSIL(0)/m/n/10 m
....\kern -0.0002
....\kern 0.0002
....\TU/DoulosSIL(0)/m/n/10 ̽
....\kern -0.0002
....\kern 0.0002
....\TU/DoulosSIL(0)/m/n/10 m
....\kern -0.0002
....\kern 0.0002
....\TU/DoulosSIL(0)/m/n/10 ̩
....\kern -0.0002
....\kern 0.0002
```
```
egreg proposes the following patch to `\textipa`:
```
\ExplSyntaxOn
\RenewDocumentCommand\textipa{ +m }
{
\group_begin:
\l__tipauni_extras_tl % <--- added
\cs_set_eq:NN \* \tipaunistar
\cs_set_eq:NN \: \tipaunicolon
\cs_set_eq:NN \; \tipaunisemicolon
\cs_set_eq:NN \! \tipaunibang
\cs_set_eq:NN \| \tipaunipipe
\cs_set_eq:NN \t \tipaunit
\seq_map_inline:Nn \l__tipauni_remove_from_accents_seq
{ \tl_remove_all:Nn \l_text_accents_tl {##1} }
\tl_set:Nx \l__tipauni_textipa_tl { \text_expand:n {#1} }
\use:x
{
\exp_not:n
{
\escapechar = `\\
\tl_set:Nx \l__tipauni_textipa_tl
{ \exp_args:No \__tipauni_act:n \l__tipauni_textipa_tl }
\escapechar =
}
\int_use:N \escapechar
}
\exp_stop_f:
\l__tipauni_textipa_tl
\__tipauni_nontipa_search:
\group_end:
}
\tl_new:N \l__tipauni_extras_tl
\NewDocumentCommand{\settipaextras}{m}
{
\tl_set:Nn \l__tipauni_extras_tl { #1 }
}
\ExplSyntaxOff
\settipaextras{\xeCJKsetup{xeCJKactive=false}}
```
This fixes the issue.
|