Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LaTeX: To combine ul-lua and LuaTeX-ja
% LuaLaTeX document
\documentclass[a6paper]{ltjsarticle}%for Japanese
\usepackage{lua-ul}
\begin{document}% mix of Japanese and English phrases
色は匂へど、
\underLine{散りぬるを(alas)、
「我が世」誰ぞ、“常”ならむ?
有為の奥山今日越えて(go on!)、
浅き夢見じwow yeah}酔ひもせず……。
\end{document}
@zr-tex8r

This comment has been minimized.

Copy link
Owner Author

@zr-tex8r zr-tex8r commented Oct 28, 2020

lua-ul-japanese-1

Got:

lua-ul-japanese-1-1

Expected:

lua-ul-japanese-1-2

@zr-tex8r

This comment has been minimized.

Copy link
Owner Author

@zr-tex8r zr-tex8r commented Oct 28, 2020

The document class ltjsarticle loads the package luatexja for proper typesetting of the Japanese language, which involves the insertion of glues between characters. I’m afraid luatexja is huge and highly complicated, but the issue can be as simple as the matter of execution order of callbacks.

@zauguin

This comment has been minimized.

Copy link

@zauguin zauguin commented Oct 28, 2020

The document class ltjsarticle loads the package luatexja for proper typesetting of the Japanese language, which involves the insertion of glues between characters. I’m afraid luatexja is huge and highly complicated, but the issue can be as simple as the matter of execution order of callbacks.

The callbacks are executed in the right order, but luatexja sets the new glue attributes to the attributes active at the end of the paragraph and not at the point of the insertion. (That also means that if the \par is in the \underLine argument, you get the reverse issue: The glue is underlined even if it shouldn't be.)

That's straight-forward to fix, but it has to happen in luatexja. I'll prepare a patch for them.

@cereda

This comment has been minimized.

Copy link

@cereda cereda commented Oct 29, 2020

ooh a fix 🦆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.