6

I need to use some Russian text fragment in ltjsarticle class, which provides the Japanese settings like Japanese caption for LuaLaTeX.

In the current MWE,

  • There are big intervals between Russian letters.
  • There is no hyphenation.
  • The table name becomes to Russian, however the main language in my document is Japanese, so I need to keep the Japanese names (there is no Japanese language in babel or polyglossia packages, so I can't to assign as \setmainlanguage neither Japanese and Russian).

enter image description here

\documentclass[a4paper]{ltjsarticle} 
\usepackage{luatexja-fontspec}

\setmainjfont[BoldFont=HGMinchoB]{MS Mincho}
\setsansjfont[BoldFont=KozGoPro-Bold]{MS Gothic}

\setmainfont[Ligatures=TeX]{TeX Gyre Pagella}
\setsansfont[Ligatures=TeX,Scale=MatchLowercase]{TeX Gyre Heros}
\usepackage{fontspec}

\usepackage{array}
\usepackage{booktabs}

\usepackage[russian]{babel}
\usepackage{multicol}

\begin{document}

此れは日本語の試験です。表示されるようです。

\begin{table}\centering
\begin{tabular}{|c|c|c|c|c|} \toprule 
あ&い&う&え&お\\ \hline
か&き&く&け&こ\\ \hline
さ&し&す&せ&そ\\ \midrule
\dots&\dots&\dots&\dots&\dots\\ \midrule
わ&ゐ&ん&ゑ&を\\ \bottomrule
\end{tabular}\caption{You must to see [表] before table number, \textbf{not} [Table] or [Таблица]}
\end{table}

Теперь русский. The letters is too wide, isn't it?

\begin{multicols}{3}
Now the hyphenation test. There are no the [-] symbol, isn't it? Тест переносов. Так как осуществляется набор в три колонки, то и вероятность того, что произойдёт перенос слова, значительно возрастает.
\end{multicols}

\begin{table}[ht!]\centering
\begin{tabular}{|c|c|c|c|c|} \toprule 
あ&い&う&え&お\\ \hline
か&き&く&け&こ\\ \hline
さ&し&す&せ&そ\\ \midrule
\dots&\dots&\dots&\dots&\dots\\ \midrule
わ&ゐ&ん&ゑ&を\\ \bottomrule
\end{tabular}\caption{You must to see [表] before table number, \textbf{not} [Table] or [Таблица]}
\end{table}

\end{document}

I know about some commands like \setotherlanguage or \newfontfamily\cyrillicfont, but I didn't desired result with these commands, too.

  • Note: Maybe you have not got the fonts. Please replace fonts commands, if so.
  • Note: If you need ltjsarticle class, you can get it here.
2
  • Curiously enough, Cyrillic letters are typeset using the font for Japanese.
    – egreg
    Jan 8, 2015 at 22:15
  • Just an update (2023). Currently both babel (for sure) and polyglossia (I think) support Japanese. Feb 18, 2023 at 17:58

1 Answer 1

8
+150

Reading the documentation reveals that characters are classified in “ALchars” and ”JAchars” and that Cyrillic is assigned to “JAchars”.

Just reassign:

\ltjsetparameter{jacharrange={-1, -2, +3, -4, -5, +6, +7, +8}}

(the standard declaration has +2, see section 4.1 of the documentation).

Of course you have to use a font that supports Cyrillic, which TeX Gyre Pagella doesn't.

\documentclass[a4paper]{ltjsarticle} 
\usepackage{luatexja-fontspec}

\setmainjfont{Hiragino Mincho Pro}
\setsansjfont{Hiragino Sans GB}

\setmainfont[Ligatures=TeX]{Linux Libertine O}
\setsansfont[Ligatures=TeX]{Linux Biolinum O}

\ltjsetparameter{jacharrange={-1, -2, +3, -4, -5, +6, +7, +8}}

\usepackage{array}
\usepackage{booktabs}

\usepackage[russian]{babel}
\usepackage{multicol}

\begin{document}

此れは日本語の試験です。表示されるようです。

\begin{table}\centering
\begin{tabular}{|c|c|c|c|c|} \toprule 
あ&い&う&え&お\\ \hline
か&き&く&け&こ\\ \hline
さ&し&す&せ&そ\\ \midrule
\dots&\dots&\dots&\dots&\dots\\ \midrule
わ&ゐ&ん&ゑ&を\\ \bottomrule
\end{tabular}\caption{You must to see [表] before table number, \textbf{not} [Table] or [Таблица]}
\end{table}

Теперь русский. The letters is too wide, isn't it?

\begin{multicols}{3}
Now the hyphenation test. There are no the [-] symbol, isn't it? Тест переносов. Так как осуществляется набор в три колонки, то и вероятность того, что произойдёт перенос слова, значительно возрастает.
\end{multicols}

\begin{table}[ht!]\centering
\begin{tabular}{|c|c|c|c|c|} \toprule 
あ&い&う&え&お\\ \hline
か&き&く&け&こ\\ \hline
さ&し&す&せ&そ\\ \midrule
\dots&\dots&\dots&\dots&\dots\\ \midrule
わ&ゐ&ん&ゑ&を\\ \bottomrule
\end{tabular}\caption{You must to see [表] before table number, \textbf{not} [Table] or [Таблица]}
\end{table}

\end{document}

enter image description here

There is no real integration of luatexja with babel, so doing \usepackage[russian]{babel} overrides all settings. As far as I can see, only Japanese and English are supported.

You can correct this by doing \usepackage[russian,english]{babel}. If you need longer passages in Russian, with correct hyphenation, use

\begin{otherlanguage*}{russian}
...
\end{otherlanguage*}

For shorter parts \foreignlanguage{russian}{...} can be used (or nothing at all for a single word, that however won't be hyphenated).

I provide some fixes for babel in luatexja, but be prepared to find other places where something can go wrong.

\documentclass[a4paper]{ltjsarticle} 
\usepackage{luatexja-fontspec}

\setmainjfont{Hiragino Mincho Pro}
\setsansjfont{Hiragino Sans GB}

\setmainfont[Ligatures=TeX]{Linux Libertine O}
\setsansfont[Ligatures=TeX]{Linux Biolinum O}

\ltjsetparameter{jacharrange={-1, -2, +3, -4, -5, +6, +7, +8}}

\usepackage{array}
\usepackage{booktabs}

\usepackage[russian,english]{babel}
\usepackage{multicol}

\makeatletter
\renewcommand\captionsenglish{%
  \renewcommand{\prepartname}{\if@english Part~\else 第\fi}%
  \renewcommand{\postpartname}{\if@english\else 部\fi}%
  \renewcommand{\presectionname}{}%  第
  \renewcommand{\postsectionname}{}% 節
  \renewcommand{\contentsname}{\if@english Contents\else 目次\fi}%
  \renewcommand{\listfigurename}{\if@english List of Figures\else 図目次\fi}%
  \renewcommand{\listtablename}{\if@english List of Tables\else 表目次\fi}%
  \renewcommand{\refname}{\if@english References\else 参考文献\fi}%
  \renewcommand{\bibname}{\if@english Bibliography\else 参考文献\fi}%
  \renewcommand{\indexname}{\if@english Index\else 索引\fi}%
  \renewcommand{\figurename}{\if@english Fig.~\else 図\fi}%
  \renewcommand{\tablename}{\if@english Table~\else 表\fi}%
  \renewcommand{\appendixname}{\if@english \else 付録\fi}%
  \renewcommand{\abstractname}{\if@english Abstract\else 概要\fi}%
}
\makeatother



\begin{document}

此れは日本語の試験です。表示されるようです。

\begin{table}\centering
\begin{tabular}{|c|c|c|c|c|} \toprule 
あ&い&う&え&お\\ \hline
か&き&く&け&こ\\ \hline
さ&し&す&せ&そ\\ \midrule
\dots&\dots&\dots&\dots&\dots\\ \midrule
わ&ゐ&ん&ゑ&を\\ \bottomrule
\end{tabular}\caption{You must to see [表] before table number, \textbf{not} [Table] or [Таблица]}
\end{table}

Теперь русский. The letters is too wide, isn't it?

\begin{multicols}{3}
Now the hyphenation test. There are no the [-] symbol, isn't it? Тест переносов. Так как осуществляется набор в три колонки, то и вероятность того, что произойдёт перенос слова, значительно возрастает.
\end{multicols}

\begin{table}[ht!]\centering
\begin{tabular}{|c|c|c|c|c|} \toprule 
あ&い&う&え&お\\ \hline
か&き&く&け&こ\\ \hline
さ&し&す&せ&そ\\ \midrule
\dots&\dots&\dots&\dots&\dots\\ \midrule
わ&ゐ&ん&ゑ&を\\ \bottomrule
\end{tabular}\caption{You must to see [表] before table number, \textbf{not} [Table] or [Таблица]}
\end{table}

\end{document}

enter image description here

1
  • Great work! Please solve the table name problem and I'll give you the reputation prize. (If everything okay, you will see 表1instead of Таблица 1.) Of cource, I need the \picturename, \partname etc. will be kept in Japanese too. I don't care if it's becomes necessary to use the environment '\begin{russian}' to display russian. Jan 22, 2015 at 6:22

You must log in to answer this question.

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