0

This is driving me nuts.

I need to find a way to have use Chinese characters in LuaLaTeX with the KOMA-script document format, however all the options for typesetting Chinese either force me to use a chinese document format or use a Japanese document format. I think I can move to XeTeX but i don't know if it's neccessary. I want to try ConTeXt but the name is counterproductive and it's documentation are horrible.

Here's the text i wanted to typeset:

\title{
    漢文文範\\
    Hán văn văn phạm 
}
\subtitle{
    使用詞彙與格讀漢越\\
    sử dụng từ vựng và cách đọc Hán Việt
}
\author{
    武克富強\\
    Võ Khắc Phú Cường
}

10
  • Please provide some code. A minimal document with some Chinese content. I have no idea how to input Chinese, even if I see it, but I've been known to typeset it. You are perhaps looking for polyglossia? I have no idea what's wrong with ConTeXt's name but please decide which format and engine you want to use!
    – cfr
    Nov 20 at 5:12
  • I'm asking which is the best way to display chinese using lualatex. Nov 20 at 5:19
  • 2
    So please edit your question, provide code for a minimal document with some Chinese content and make it clear you want to use LuaLaTeX. Saying you're willing to switch to XeLaTeX is fine, if that's true, but saying you really want to use ConTeXt makes this a different question. ConTeXt is a different format. It is not LaTeX.
    – cfr
    Nov 20 at 5:21
  • Your sample code suggests that you need to be able to typeset both Vietnamese and Chinese text. Is this correct? And, are you interested in Traditional Chinese or Simplified Chinese glyphs?
    – Mico
    Nov 20 at 5:53
  • Yes, Traditional Chinese only. Nov 20 at 5:55

5 Answers 5

2

Use the ctex bundle which is developed for typesetting CJK characters. According to different compilation engines, ctex will automatically choose different methods to support Chinese typesetting from the lower-level (For lualatex case, it depends on LuaTeX-ja). Here is a demo:

\documentclass{scrartcl}
\usepackage{ctex}
\title{
    漢文文範\\
    Hán văn văn phạm 
}
\subtitle{
    使用詞彙與格讀漢越\\
    sử dụng từ vựng và cách đọc Hán Việt
}
\author{
    武克富強\\
    Võ Khắc Phú Cường
}
\begin{document}
\maketitle
\end{document}

enter image description here

If you need to use, say, Noto Serif TC font, then install that font in your machine and use \setCJKmainfont to select it:

\documentclass{scrartcl}
\usepackage[fontset=none]{ctex}
\setCJKmainfont[BoldFont = NotoSerifTC-Bold]{NotoSerifTC-Regular}
\title{
    漢文文範\\
    Hán văn văn phạm 
}
\subtitle{
    使用詞彙與格讀漢越\\
    sử dụng từ vựng và cách đọc Hán Việt
}
\author{
    武克富強\\
    Võ Khắc Phú Cường
}
\begin{document}
\maketitle
\end{document}

enter image description here

6
  • How can I change the font? IDK Chinese so i can't read the documentation. Nov 20 at 14:53
  • @AdrikIvanov What’s your operating system? macOS or windows?
    – Stephen
    Nov 20 at 15:23
  • Windows, but perferably without need for a change to the operating system @Stephen Nov 20 at 23:32
  • @AdrikIvanov What chinese font do you need to use?
    – Stephen
    Nov 21 at 2:19
  • some personal font that is based on Noto Serif CJK. But why do you ask? Just put Noto Serif CJK. Nov 21 at 6:49
4

If you need it only for short text or a few words you can define for lualatex a fallback font, see the luaotfload documentation for details. For more sophisticated setups check babel which too offers various commands to define a fallback font and language switch based on script.

\documentclass{scrartcl}
\usepackage{fontspec}
\directlua
 {luaotfload.add_fallback
   ("JPfallback",
     {"Noto Sans CJK JP:mode=harf;"}
   )
 }

\setmainfont{Arial}[RawFeature={fallback=JPfallback}]
\setsansfont{Arial}[RawFeature={fallback=JPfallback}]
\title{
  漢文文範\\
  Hán văn văn phạm 
}
\subtitle{
  使用詞彙與格讀漢越\\
  sử dụng từ vựng và cách đọc Hán Việt
}
\author{
  武克富強\\
  Võ Khắc Phú Cường
}

\begin{document}
\maketitle
\end{document}

enter image description here

2

Yet another option, this time with babel (see the page on Chinese in the babel site for further info).

\documentclass{scrartcl}

\usepackage[vietnamese]{babel}
\babelprovide[import, onchar=ids fonts]{chinese}
\babelfont[chinese]{rm}{IPAexMincho}
\babelfont[chinese]{sf}{IPAexGothic}

\title{
    漢文文範\\
    Hán văn văn phạm 
}
\subtitle{
    使用詞彙與格讀漢越\\
    sử dụng từ vựng và cách đọc Hán Việt
}
\author{
    武克富強\\
    Võ Khắc Phú Cường
}
\begin{document}

\maketitle

\end{document}

enter image description here

1

I can't read either of the languages you are using, neither do I know good fonts for them, but I used KokoroMinchoutai for Chinese and the default Latin Modern for Vietnamese in this document. I have compiled it with XeLaTeX. Feel free to change it to some other fonts you know.

\documentclass{scrartcl}
\usepackage{fontspec}
\newfontfamily{\chinesefont}{KokoroMinchoutai}
\usepackage[Chinese,Latin]{ucharclasses}
\setDefaultTransitions{\normalfont}{}
\setTransitionsForChinese{\chinesefont}{}
\setTransitionsForLatin{\normalfont}{}
\title{
  漢文文範\\
  Hán văn văn phạm 
}
\subtitle{
  使用詞彙與格讀漢越\\
  sử dụng từ vựng và cách đọc Hán Việt
}
\author{
  武克富強\\
  Võ Khắc Phú Cường
}

\begin{document}
\maketitle
\end{document}

1

0

To typeset chinese with ConTeXt you can use the font fallback mechanism to add missing characters to the main font. The example below combines the regular Noto font with the CJK Noto font.

To enable line breaking for chinese text you need the \setscript command.

\definefallbackfamily [mainface] [rm] [Noto Serif CJK TC]     [preset=range:chinese]
\definefallbackfamily [mainface] [ss] [Noto Sans CJK TC]      [preset=range:chinese]
\definefallbackfamily [mainface] [tt] [Noto Sans Mono CJK TC] [preset=range:chinese]

\definefontfamily [mainface] [rm]        [Noto Serif]
\definefontfamily [mainface] [ss]        [Noto Sans]
\definefontfamily [mainface] [tt]        [Noto Sans Mono]
\definetypeface   [mainface] [mm] [math] [stixtwo]

\setupbodyfont [mainface]

\mainlanguage [chinese]

\setscript [hanzi]

\starttext

\startalignment[middle]
  \startfont[Sans sa 3]\setupinterlinespace
    漢文文範\par
    Hán văn văn phạm\par
  \stopfont
  \blank
  \startfont[Sans sa 2]\setupinterlinespace
    使用詞彙與格讀漢越\par
    sử dụng từ vựng và cách đọc Hán Việt\par
  \stopfont
  \blank
  \startfont[Serif sa 2]\setupinterlinespace
    武克富強\par
    Võ Khắc Phú Cường\par
    \blank
    \currentdate
  \stopfont
\stopalignment

\stoptext

enter image description here

You must log in to answer this question.

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