2

I've found this answer and I also referred to the links I posted in a previous question.

What I came up with is the following:

\documentclass{book}
\usepackage{luatexja-fontspec}
\usepackage{iftex}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures={TeX}}
\setmainfont{Noto Serif}
\setsansfont{Noto Sans}
\setmonofont{Noto Sans Mono}
\usepackage[english, russian]{babel}
\begin{document}

\begin{tabular}{lll}
  鮫     & 私が見た & 魚\\
  акула  & видела & рыбу\\
  scùàlò & vìde   & péscè\\
\end{tabular}

\end{document}

which has a relatively ugly rendering of cyrillic (I have no idea how nice the japanese is rendered, though),

enter image description here

which would be good if I didn't include the luatexja-fontspec package, at the expense of not showing japanese characters at all,

enter image description here

Quite funny, while I write the question, I see the browser has a better clearer idea of the fonts (except that it doesn't render the japanese characters as monospace; but this is not what I'm trying to do):

enter image description here

2
  • The babel package has a commands \babelfont and \foreignlanguage that let you select a particular font for a particular language. See babel docs, pages 4 and 5. But I do not know how it would work, in your case.
    – user287367
    Commented Feb 12, 2023 at 19:12
  • A quick answer (I can prepare a more extended one tomorrow). Add just after loading babel the following: \babelprovide[onchar=ids fonts]{japanese} \babelfont[japanese]{rm}{IPAexMincho}, and delete \usepackage{luatexja-fontspec}. However, I wonder if there is a way to render correctly with the latter the Russian text without the CJK full width spacing. Commented Feb 12, 2023 at 20:05

2 Answers 2

6

luatexja splits characters in two classes. By default cyrillic is handled as a JAchar. You can change that to ALchar:

\documentclass{book}
\usepackage{luatexja-fontspec}
\ltjsetparameter{jacharrange={-2}} %range 2 is now ALchar
\usepackage{iftex}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures={TeX}}
\setmainfont{Noto Serif} \setsansfont{Noto Sans} \setmonofont{Noto Sans Mono} 
\usepackage[english, russian]{babel}
\begin{document}

\begin{tabular}{lll}
  鮫     & 私が見た & 魚\\
  акула  & видела & рыбу\\
  scùàlò & vìde   & péscè\\
\end{tabular}

\end{document}

enter image description here

1

Although Ulrike solved the issue with your MWE, in case you just need Japanese for some words or phrases, here is how you can do it:

\documentclass{book}
\usepackage[english, russian]{babel}
\babelprovide[onchar=ids fonts]{japanese}
\babelfont{rm}{Noto Serif}
\babelfont[japanese]{rm}{IPAexMincho}
\babelfont{sf}{Noto Sans}
\babelfont{tt}{Noto Sans Mono}

\begin{document}

\begin{tabular}{lll}
  鮫     & 私が見た & 魚\\
  акула  & видела & рыбу\\
  scùàlò & vìde   & péscè\\
\end{tabular}

\end{document}

Edit. The output is identical to Ulrike’s answer.

7
  • Showing the result as in the other answer would certainly make it better :D
    – Enlico
    Commented Feb 18, 2023 at 18:03
  • 1
    It’s identical to Ulrike’s. No need, I think, to post an image that is basically the same. But I’ve edited my answer to point this out. Commented Feb 18, 2023 at 18:09
  • Oh, ok, the comment is equivalent, thanks.
    – Enlico
    Commented Feb 18, 2023 at 19:01
  • Regarding in case you just need Japanese for some words or phrases, as opposed to what? As in, what is this solution not giving that Ulrike's solution does? I'm asking this because yes, I only need a few words, but that's true also for the cyrillic, so maybe your answer would be even different, considering this?
    – Enlico
    Commented Feb 18, 2023 at 21:06
  • I get a File `japanese.sty' not found.. Would you please give a hint as to how to install it on Linux via tlmgr?
    – Enlico
    Commented Feb 18, 2023 at 23:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .