6
  • I want to mix Chinese an English in one document.
  • For each languages, I will use paragraphs (not just short sentences).
  • I want to use Google's Noto fonts.
  • The problem is, that the Latin characters look different when I use English within a Chinese environment.
  • When I replace \babelfont{rm}{Noto Serif} with \babelfont{english}{Noto Serif}, then the result is different but still not ok.
  • My goal is, to have the same Latin characters (same font) in both, English and Chinese environment

\documentclass{article}

\usepackage[english]{babel}
% babelprovide for *english* (default language of the document)
\babelprovide[
    main,
    import,
    language = Default]
    {english}

% babelprovide for *chinese-simplified*
\babelprovide[
    import,
    language = Chinese Simplified]
    {chinese-simplified}

%% Choose actual fonts for different font variants.
\babelfont{rm}{Noto Serif}
%\babelfont{english}{Noto Serif}
\babelfont[chinese-simplified]{rm}{Noto Serif CJK SC}

\begin{document}

\selectlanguage{english}ABCabc
\selectlanguage{chinese-simplified}ABCabc

\end{document}

enter image description here


%\babelfont{rm}{Noto Serif}
\babelfont{english}{Noto Serif}

enter image description here


Related: babel: Mixing English and Chinese Using Google NotoFonts

4 Answers 4

2

With a recent babel (see What's new in babel-3.38), you just have to tell it to switch the language (the line breaking rules) and the font based on the script in the following way :

\documentclass{article}

\usepackage[english]{babel}

% Don't reload english, just modify it to switch the language and the
% font depending of the script:    
\babelprovide[onchar=ids fonts]{english}

\babelprovide[
    import,
    language = Chinese Simplified]
    {chinese-simplified}

%% Choose actual fonts for different font variants.
\babelfont{rm}{Noto Serif}
\babelfont[chinese-simplified]{rm}{Noto Serif CJK SC}

\begin{document}

\selectlanguage{english}ABCabc
\selectlanguage{chinese-simplified}ABCabc

\end{document}
10
  • +1: I don't have access to a computer at the moment. I will test it out. Mar 3, 2020 at 15:39
  • Will the Latin letters look the same? Mar 3, 2020 at 15:40
  • 1
    @Dr.ManuelKuehner Sure, because the font is the same. Actually, you can switch the font in the English part to the Chinese one, too, if you add onchar=ids fonts to the second \babelprovide. Mar 3, 2020 at 15:55
  • 1
    From the manual, about onchar: This option is much like an ‘event’ called when a character belonging to the script of this locale is found. There are currently two ‘actions’ [...]: with ids the \language and the \localeid are set to the values of this locale; with fonts, the fonts are changed to those of this locale (as set with \babelfont). Mar 3, 2020 at 16:24
  • 1
    @Dr.ManuelKuehner Donations are most welcome, of course. babel is part of the LaTeX Project. See tug.org/donate.html . Mar 3, 2020 at 17:00
3

You could try the (new) multiscript option. But you will get a few warning from fontspec:

\documentclass{article}


\usepackage[english]{babel}
% babelprovide for *english* (default language of the document)
\babelprovide[
    main,
    import,
    language = Default]
    {english}

% babelprovide for *chinese-simplified*
\babelprovide[
    import,
    language = Chinese Simplified]
    {chinese-simplified}
\directlua{
luaotfload.add_multiscript
 ("latn-hani",
  {
    Hani = "Noto Serif CJK SC:mode=node;script=hani;",
  }
 )
}
\babelfont{rm}[RawFeature={multiscript=latn-hani}]{Noto Serif}


\begin{document}

\selectlanguage{english}ABCabc 你好
\selectlanguage{chinese-simplified}ABCabc 你好

\end{document}

enter image description here

6
  • Thanks for the answer. Can you explain why I get the described problem? Or, is there another (best practice) way without luaotfload.add_multiscript? I am still hoping, that there is a "easy" solution :). Maybe if I only use the Chinese font for English and Chinese?! Mar 2, 2020 at 20:03
  • 1
    well obviously Noto Serif and Noto Serif CJK SC are different. If you want the same font you will have to use the same font. Always using Noto Serif CJK SC will probably work too. Mar 2, 2020 at 20:05
  • I see. Do you understand why \babelfont{rm} and \babelfont{english} give a different result? Mar 2, 2020 at 20:24
  • 2
    \babelfont{english}{Noto Serif} is the wrong syntax, you meant \babelfont[english]{rm}{Noto Serif} Mar 2, 2020 at 20:35
  • Thanks - that's embarrassing for me... I wait if there's another approach before I accept your answer. I am still confused, that the Noto font uses different Latin "fonts". Mar 2, 2020 at 20:37
3

It is indeed the case that the Latin glyphs from "Noto Serif CJK SC" is notably lighter than the corresponding weights from "Noto Serif". I am not aware of any documents explaining this design choice. However, it is worth noting that the Latin glyphs from "Noto Serif" would look like a (slight) emphasis within a span of Chinese text. One can see this in Ulrike's answer. An alternative is to explicitly mark the Latin characters with a language:

ABCabc

{\selectlanguage{chinese-simplified} 简化字总表 ABCabc 简化字总表}

{\selectlanguage{chinese-simplified} 简化字总表 \foreignlanguage{english}{ABCabc} 简化字总表}

ABCabc

enter image description here

In the second line, the Latin text blends into the Chinese text while it stands out in the third line.

Now Noto comes win many different weights. If CJK-Regular is lighter than Latin-Regular, we can try to combine CJK-Regular with Latin-Light:

\documentclass{article}

\usepackage[english]{babel}
% babelprovide for *english* (default language of the document)
\babelprovide[
    main,
    import,
    language = Default]
    {english}

% babelprovide for *chinese-simplified*
\babelprovide[
    import,
    language = Chinese Simplified]
    {chinese-simplified}

%% Choose actual fonts for different font variants.
\babelfont{rm}[
  UprightFont=*-Light,
  BoldFont=*-Medium,
]{Noto Serif}
\babelfont[chinese-simplified]{rm}{Noto Serif CJK SC}

\begin{document}

ABCabc

{\selectlanguage{chinese-simplified} 简化字总表 ABCabc 简化字总表}

{\selectlanguage{chinese-simplified} 简化字总表 \foreignlanguage{english}{ABCabc} 简化字总表}

ABCabc

\end{document}

enter image description here

The match is not perfect, but quite close. In principle it would also be possible to choose a slightly darker CJK. I do not have those installed right now, though.

3
  • 1
    Perfect, thanks. In your opinion, is there a downside to use the Chinese Noto Font for everything in the document but still switch languages with babel for hyphenations etc? Mar 3, 2020 at 8:56
  • 1
    @Dr.ManuelKuehner Using "Noto Serif CJK SC" for everything might work. It does support (some) accented characters. So it is worth a try. Mar 3, 2020 at 10:53
  • I accepted the answer from the babel maintainer. I really appreciate your help. Mar 7, 2020 at 10:19
3

To expand on the latin-in-chinese topic:

Two parts:

The first part is that Babel does not change the font according to which Unicode block the glyphs are in, like package ucharclasses does. Addendum: But see the comment about recent Babel.

The second part is that Noto Serif CJK SC contains some non-CJK glyphs as well.

Noto Serif has glyphs for Latin, Cyrillic, Greek, and a few other things.

Noto Serif CJK SC has the main parts of Latin, Cyrillic and Greek, as well as hiragana, katakana, hangul, bopomofo, and of course a large part of CJK.

noto compare

ucharclasses:

ucharclasses

MWE

\documentclass[12pt]{article}
\usepackage{xcolor}
\pagecolor{red!3}
\usepackage{fontspec}
\newfontface\fcjk{Noto Serif CJK SC}
\newfontfamily\feng{Noto Serif}

\usepackage[CJK]{ucharclasses}
\setTransitionsForCJK{\fcjk}{\feng}

\begin{document}
\large
{\color{blue}Noto Serif}

\feng 
\begin{tabular}{rl}
Latin & ABC abc \\
Currency symbols & ₣₤₥₦₧₨ \\
Cyrillic  & ЄДФЦжцабвг \\
Greek & ΣΤΥΦζεδγβα  \\
IPA \& Phonetic & ɐɠɰʁ ᴟᴞᴣᴇᴈᴗ \\
Letterlike Symbols & ℜℏ℈℃ℓℒ™ℵ⅀ \\
Modifier Tones & ꜀꜂꜈꜉꜊꜋꜌ꜗꜘꜙ \\
etc & ... \\
\end{tabular} 
\bigskip

\rmfamily
{\color{blue}Noto Serif CJK SC}

\fcjk
\begin{tabular}{rl}
Bopomofo & ㄆㄇㄈㄉㄊ \\
Box Drawing & ┢┤┩╆ \\
CJK & 㑣㐦㐧㕔 \\
some Latin & ABC abc \\
some Cyrillic  & ЄДФЦжцабвг \\
some Greek & ΣΤΥΦζεδγβα  \\
Hangul &  ᅣᅦᄄᆻ \\
Hiragana & あいいうえおかが \\
Katakana & アイウエオカガ \\
Letterlike Symbols & ℜℏ℈℃ℓℒ™ℵ⅀ \\
etc & ... \\
\end{tabular} 
\bigskip

\feng
\textit{ucharclasses}: {\small Changing fonts without having to insert font-changing code} -- Latin text. Chinese text: 紫薇北斗星  Modern Greek: Διαμ πριμα εσθ ατ, κυο πχιλωσοπηια Ancient Greek: Μῆνιν ἄειδε, θεά, Πηληϊάδεω Ἀχιλῆος. And regular latin text.

\end{document}
4
  • Thanks a lot, I like the red!3 for the page color. Can I combine your approach with the standard babel usage (changing default values for "Figure" etc. and for hyphenations)? Mar 3, 2020 at 13:51
  • 2
    The following is no longer true: “The first part is that Babel does not change the font according to which Unicode block the glyphs are in”. From 3.38 on it changes not only the font but also the line breaking rules. Mar 3, 2020 at 15:38
  • 1
    @Dr.ManuelKuehner Try it. (The Latin glyphs in Noto Serif CJK SC are different to the Latin glyphs in Noto Serif - that's all. They are designed for use in the Chinese locale, I expect, whereas your locale is a Western one. Same with the Greek and Cyrillic glyphs.)
    – Cicada
    Mar 4, 2020 at 12:04
  • I accepted the answer from the babel maintainer. I really appreciate your help. Mar 7, 2020 at 10:18

You must log in to answer this question.

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