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

Enlico
  • 2,592
  • 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. – rallg Feb 12 '23 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. – Javier Bezos Feb 12 '23 at 20:05

2 Answers2

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

Ulrike Fischer
  • 327,261
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.

Javier Bezos
  • 10,003
  • Showing the result as in the other answer would certainly make it better :D – Enlico Feb 18 '23 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. – Javier Bezos Feb 18 '23 at 18:09
  • Oh, ok, the comment is equivalent, thanks. – Enlico Feb 18 '23 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 Feb 18 '23 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 Feb 18 '23 at 23:30
  • @Enlico japanese.sty is not required. – Javier Bezos Feb 19 '23 at 07:58
  • @Enlico So, from your comment I deduce your question is, «I’d like to typeset a document in English, with some words in Russian and Japanese». Right? Japanese has very special typographical requirements, like vertical writing, which are available in frameworks like luatexja. However, for more or less straightforward and simple texts, babel should be enough. – Javier Bezos Feb 19 '23 at 08:06