Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

85

The easiest way is (for Simplified Chinese document only): % UTF-8 encoding % Compile with latex+dvipdfmx, pdflatex, xelatex or lualatex % XeLaTeX is recommanded \documentclass[UTF8]{ctexart} \begin{document} 文章内容。 \end{document} or \documentclass{article} \usepackage[UTF8]{ctex} ... It is designed for Chinese typesetting. Font sizes, indentation, name ...


57

1. XeLaTeX For XeLaTeX, the document should be saved in UTF-8 encoding. 1.1. xeCJK package I advice you to use XeLaTeX with package xeCJK. An example: \documentclass{article} \usepackage{xeCJK} \setCJKmainfont{MS Mincho} % for \rmfamily \setCJKsansfont{MS Gothic} % for \sffamily \begin{document} \section{日本語} お早う \textsf{こんにちわ} \end{document} See ...


34

This blog post outlines Chinese-Japanese-Korean support in LaTeX: link This is a minimal working example: \documentclass{memoir} \usepackage{CJKutf8} \begin{document} \begin{CJK}{UTF8}{min}未練なく散も桜はさくら哉\end{CJK} \\ without regret \\ they fall and scatter\ldots \\ cherry blossoms \end{document} You can compile it with the latex, dvips, ps2pdf combo or ...


26

Here is a non-fancytooltips solution that supports any driver, including xelatex, allowing you to use OpenType and TrueType fonts. It makes use of the macro \tooltip[<link text colour>]{<link text>}[<tip box colour>]{<tip text>} for generating draggable boxes in the PDF display of AdobeReader. The macro for creating an inline ...


21

Personally, I had a lot of trouble trying to get the CJK package to work. So I went on the KTUG website and found that they use the package kotex. \documentclass{article} \usepackage{kotex} \begin{document} 안녕하세요! \end{document} The good part about this was I was able to simply copy and paste hangul from websites into the LaTeX document and it worked fine....


18

I use Chinese under XeLaTeX and the XeCJK package, which allow the use of CJK together with your own fonts. It's extremely convenient. First, take a look at the explanation at Chou Pai-hsiang's website. This should get you started. There are other important comments here on tex.SE about the use of fontspec and getting the full Chinese character set from ...


17

I know only some discussion for Chinese. There are some discussions and tools for vertical Japanese, but I know little about it. I'm sorry that vertical typesetting options are still not available in xeCJK. It is indeed in the TODO list, but not urgent at all. For vertical typesetting, some techniques are needed: Rotate the glyphs. It can be obtained by ...


17

The Basic grid behing the character is shown, also there is a new command added \Grid{}, to insert the needed glyph inside a specific grid: \documentclass{article} \usepackage{xeCJK} \usepackage{tikz} \setCJKmainfont{KaiTi} % \newcommand\Grid[1]{% \tikz[baseline=(char.base)]{% \draw[xstep=1ex,ystep=1ex,help lines] (-1ex,-1ex) grid (1ex,1ex); \node[...


16

You can use the CJK package. A little example (taken from CJKutf8.tex): \documentclass{article} \usepackage[T1]{fontenc} \usepackage{CJKutf8} \usepackage[english]{babel} \begin{document} \begin{CJK}{UTF8}{mj} 이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로 모아 엮어졌습니다. \end{CJK} This FAQ list was made to summarize some frequently asked questions and their ...


16

1. Quick solution First, let me answer your question in short: feel free to use \v{e}, \'\i and \={\"u} to typeset ě, í and ǖ. You don't need pinyin package for this. And pinyin package itself is just a shortening for these accents. 2. A better implementation Honestly, pinyin package on CTAN is not at all well implemented. It is dangerous to redefine, for ...


15

I recently ran into this on Fedora 16. You're seeing nothing due to not selecting the correct Chinese font, which is different on Windows, Mac and Linux. The trick to finding the right font for a language on Linux is: $ fc-list :lang=zh the default Chinese font on Fedora 16 is: WenQuanYi Zen Hei,文泉驛正黑,文泉驿正黑:style=Regular and on your Fedora 13 system ...


14

Using CJK If you use CJK package, you can use CJK environment at the beginning and the end of the document only once. So you don't need to worry about where to put the CJK environment when you type the text. Say, you can (and you should) simply use \documentclass{book} \usepackage{CJKutf8} \begin{document} \begin{CJK*}{UTF8}{gbsn} \chapter{某章} 内容…… \...


13

Not a (La)TeX solution, but the Commons Stroke Order Project "aims to create a complete set of high quality and free illustrations to clearly show the stroke orders of Han characters (hanzi, kanji, kana, hantu, and hanja)". For example, the stroke order illustration of 山 is available at http://commons.wikimedia.org/wiki/File:山-bw.png , but you will perhaps ...


13

For problem (1), the nameaddon field can hold the CJK name for only a single author. This approach is no good for works by multiple authors and name lists in other fields, such as editor. One way around this is to reserve the name affix for the CJK name: author = {Li, 李无未, Wuwei and Keane, Michael} and modify the name formatting directives. This is ...


13

Just use luatexja. The Chinese TeX community decide not to develop a new package but use luatexja, because the tools designed for Chinese and Japanese usually work the same. The developer version of our ctex package will provide a Chinese customized interface for luatexja. Now you can use luatexja directly. Here is an example: % !TEX encoding = UTF-8 % !...


12

This is not a bug. xeCJK treats ambigious punctuations as CJK punctuations. The ellipsis is treated as CJK punctuation thus it uses STSong font (华文宋体) and the following spaces are ignored. You can use \ldots, \dots or \textellipsis to get the proper ellipsis for western languages. (In fact xeCJK patches theses macros specially using \makexeCJKinactive.) ...


12

It seems that you can set the \rubysep parameter to a negative value to get the effect you want. %!TEX TS-program = xelatex \documentclass[12pt]{article} \usepackage{xeCJK} \usepackage{ruby} \setCJKmainfont{Hiragino Mincho Pro} \renewcommand{\rubysep}{-4ex} \pagestyle{empty} \begin{document} On this line \ruby{学}{がく}\ruby{生}{せい} \end{document} Here's ...


12

Control sequences and packages about font (plain) TeX level control sequences about font There are several control sequences (or say command) about font in the original TeX (TeX primitive and/or plain TeX level command). \/, can be used to regulate the space after italic characters (see the difference between {\itshape italic} normal and {\itshape italic}\...


11

Well, you can freely use \setCJKfamilyfont to define as many fonts as you need. And you can use \CJKfamily to change the font. This is quite similar to the way you have used. On the other hand, current xeCJK does not have the ability to define different fonts for Chinese, Japanese and Korean individually. In fact, the three languages shares a lot of ...


11

There's nothing new in beamer. Recommended solution: % Compile with XeLaTeX, with Chinese fonts installed with Windows as default. \documentclass{beamer} \usepackage[noindent,UTF8]{ctexcap} \renewcommand\CJKfamilydefault{\CJKsfdefault} \begin{document} \begin{frame}{中文} 在 beamer 中使用中文。 \end{frame} \end{document} If you use latest version of ctex package ...


11

The ucs and inputenc package must not be used with XeLaTeX as well as fontenc, in general, but the last one may have its uses; never load ae and aecompl: they are obsolete. CJKutf8 package is a mixture of CJK package and inputenc package with utf8 option. it is also not used in XeLaTeX. You don't need any CJK package in order to print some glyphs: just ...


11

ctex bundle use Chinese fonts for Windows by default. You can use the fonts installed in Mac. % !TEX program = XeLaTeX % !TEX encoding = UTF-8 \documentclass[UTF8,nofonts]{ctexart} \setCJKmainfont[BoldFont=STHeiti,ItalicFont=STKaiti]{STSong} \setCJKsansfont[BoldFont=STHeiti]{STXihei} \setCJKmonofont{STFangsong} \begin{document} 文章内容。 \end{document} There ...


11

CJKutf8 package is a part of CJK bundle, it is designed for documents in UTF-8 encoding only, and it actually loads CJK package internally. The main aim of CJKutf8 package is, to use utf8 option in inputenc package together with CJK package. That is to say, CJKutf8 patches original CJK package to make it work well with inputenc. And it loads inputenc ...


10

Just use xeCJK for Japanese. A simple example: \documentclass{article} \usepackage{xeCJK} \setCJKmainfont{MS Mincho} % for \rmfamily \begin{document} おはよう VS Good morning \end{document} See also: How to write Japanese with LaTeX? xeCJK handles automatic font switching, line breaking, punctuation and spacing between characters. It was originally designed ...


10

I use a simple approach to generate the list. It may cost too much memory and can be improved using better algorithm. \documentclass{article} \usepackage[scale=0.8,centering]{geometry} \usepackage[nofonts]{ctex} \setCJKmainfont{SimSun} \parindent=0pt \usepackage{pgfcore,pgffor} \pgfmathsetseed{2} % set seed if you wish \begin{document} \foreach \i in {1,......


10

From package documentation CJKutf8.txt: If you get the error message: `\CJK... undefined' or other `... undefined ...' messages and you can't find an error, try inserting \newpage, \clearpage, or \cleardoublepage (the latter for two-column printing) before saying \end{CJK} or \end{CJK*}. This can happen if LaTeX 2e writes ...


10

It depends on the font whether it has a full range of accents. The following are some serifed fonts that have the full range of accents. Other than Times New Roman, all are free, OpenType fonts. Charis SIL Gentium Plus Linux Libertine O CMU Serif DejaVu Serif Times New Roman.


10

Now I add another answer using LI Qing's xpinyin package. It's rather easy to use: \documentclass{ctexart} \usepackage{xpinyin} \begin{document} \Huge\sffamily \begin{pinyinscope} 床前明月光,疑是地上霜。举头望明月,低头思故乡。 \end{pinyinscope} \xpinyin*{床前明月光,疑是地上霜。举头望明月,低头思故乡。} \end{document}


10

To use Thai fonts, we do not need to load CJK package, but babel package. To use the fonts in C90 encoding, we can use thaicjk option of babel package. \documentclass{article} \usepackage[utf8x]{inputenc} % English is the main language \usepackage[thaicjk,english]{babel} \addto\extrasthaicjk{\fontencoding{C90}\selectfont} % Hack into CJKutf8 package for ...


10

The Unicode of the character 𡰞 is U+21C1E. So it is in font HanaMinB rather than HanaMinA. There are two mechanisms to deal with such problems in xeCJK. The first one is the fallback font feature. Say \documentclass[12pt,letterpaper]{article} \usepackage{xeCJK} %% enable fallback font feature \xeCJKsetup{AutoFallBack} \setCJKmainfont{HanaMinA} % set ...


Only top voted, non community-wiki answers of a minimum length are eligible