edward-martyr / kanbun

Easily typeset kanbun-kundoku (漢文訓読) with (Lua)LaTeX
15 stars 1 forks source link

Ruby typeset for multikanji might be misplaced when `unit` is not `1\zw` #7

Open lemniscati opened 4 months ago

lemniscati commented 4 months ago

Ruby typeset for multikanji might be misplaced when unit is not 1\zw

How to reproduce

A test input is:

\documentclass{ltjtarticle}
\usepackage{kanbun}
\begin{document}

\begingroup
\parindent0\zw%
\setkanbun{kumi=beta, unit=1\zw}%
\Kanbun
壱弐参‘所以’(ゆゑん)。
\EndKanbun
\printkanbun
\endgroup

\begingroup
\parindent0\zw%
\setkanbun{kumi=beta, unit=2\zw}%
\Kanbun
壱弐参‘所以’(ゆゑん)。
\EndKanbun
\printkanbun
\endgroup

\begingroup
\parindent0\zw%
\setkanbun{kumi=beta, unit=3\zw}%
\Kanbun
壱弐参‘所以’(ゆゑん)。
\EndKanbun
\printkanbun
\endgroup

\begingroup
\parindent0\zw%
\setkanbun{kumi=aki, unit=1\zw}%
\Kanbun
壱弐参‘所以’(ゆゑん)。
\EndKanbun
\printkanbun
\endgroup

\begingroup
\parindent0\zw%
\setkanbun{kumi=aki, unit=2\zw}%
\Kanbun
壱弐参‘所以’(ゆゑん)。
\EndKanbun
\printkanbun
\endgroup

\begingroup
\parindent0\zw%
\setkanbun{kumi=aki, unit=3\zw}%
\Kanbun
壱弐参‘所以’(ゆゑん)。
\EndKanbun
\printkanbun
\endgroup

\end{document}

Process it with lualatex and, we will get a result: kanbun-test-multikanji-ruby.pdf

Expected Results

For any unit, the ruby ゆゑん for multikanji 所以 should be placed only along with the characters of multikanji.

lemniscati commented 4 months ago

The cause seems that kanbunzwtosp in lua is not updated when unit, or \kanbun_zw is changed.