How can I place vertical Chinese text for some of the text in a document?
Asked
Active
Viewed 4,145 times
12
-
1You could try the sample code at this ctex discussion thread. In general, you'd likely have better luck at the CTEX discussion site with such in-depth CJK typesetting queries. – imnothere Dec 17 '11 at 07:39
-
See this thread in CTeX forum for datailed discussion. I'll provide an example here. – Leo Liu Dec 17 '11 at 08:15
-
@LeoLiu Now why didn't my search on ctex turn up that thread?! I remember it but couldn't get at it just now. -_- – imnothere Dec 17 '11 at 08:40
-
@LianTzeLim: I've no idea. Anyway, it's easy for me to find it out ^_^ – Leo Liu Dec 17 '11 at 08:54
-
1The link to the thread in the CTeX forum has changed, it now is http://bbs.ctex.org/forum.php?mod=viewthread&tid=45054 – brian-ammon Jan 23 '16 at 14:11
-
Related: What is UpTex / UpLaTeX?. – Rebecca J. Stones May 04 '20 at 03:19
1 Answers
19
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 setting the font with special options.
- Rotate the whole paragraph or whole page. Use
\rotateboxfromgraphicsbundle, or use special commands of XeTeX likepdflscapepackage do. - Use correct vertical punctuations. It is a special OpenType font feature.
- Offset the glyphs a little. Like
CJKvertpackage do. We can hackxeCJKto do this. - Some extra tools like
gezhupackage. (not shown in the example below)
A full example:
\documentclass{article}
\usepackage{graphicx} % for \rotatebox
\usepackage{xeCJK}
\newfontlanguage{Chinese}{CHN}
\setCJKmainfont{SimSun}
\setCJKfamilyfont{songvert}[Script=CJK,Language=Chinese,Vertical=RotatedGlyphs]{SimSun}
\newcommand*\CJKmovesymbol[1]{\raise.35em\hbox{#1}}
\newcommand*\CJKmove{\punctstyle{plain}% do not modify the spacing between punctuations
\let\CJKsymbol\CJKmovesymbol
\let\CJKpunctsymbol\CJKsymbol}
\begin{document}
屈原《离骚》曰:
\begin{center}
\rotatebox{-90}{\fbox{\begin{minipage}{10em}
\CJKfamily{songvert}\CJKmove
『朝发轫于苍梧兮,\\
夕余至乎县圃。\\
欲少留此灵琐兮,\\
日忽忽其将暮。\\
吾令羲和弭节兮,\\
望崦嵫而勿迫。』
\end{minipage}}}
\end{center}
这里羲和便等于一名马车夫,因为
他是御日的,诗人生怕太阳赶快落了,就叫羲和慢一点走。不过话经我
一翻译,显得淘气一点,原文只是一个高贵的身分,另外不表现着什么
个性了。
\end{document}

David Carlisle
- 757,742
Leo Liu
- 77,365
-
i could not get this to work with xetex 3.1415926-2.4-0.9998 (TeX Live 2012/Debian). i just copied and pasted what you have above. i made a paste here: http://pastebin.com/0gnnWmWz – magnetar Jul 24 '12 at 11:44
-
-
@LeoLiu: This example works nicely here on TeXShop v. 2.47 on Mac OS 10.8, but I'm sorry to see that it doesn't work with the HAN NOM fonts; only with commercial Chinese fonts that I have, such as SimSun. Is there something I can do to make HAN NOM work, or is the problem irremediable at this point? – brannerchinese Oct 15 '12 at 22:40
-
-
2@LeoLiu: In my case, it was necessary to add
RawFeature={vertical;+vert}, that is,\setCJKfamilyfont{songvert}[RawFeature={vertical;+vert},Script=CJK,Language=Chinese,Vertical=RotatedGlyphs]{SimSun}in order to obtain correct vertical text in the minipage, by using the latest fontspec:fontspec.sty 2017/07/23 v2.6c. Was the fontspec changed? – Akira Kakuto Aug 02 '17 at 06:44 -
-
With fontspec 2020/02/21 v2.7i and xeCJK 2020/06/06 v3.8.4,
Vertical=RotatedGlyphsdoes not work andRawFeature={vertical}works fine. – Zeping Lee Jun 10 '20 at 07:03