1

The following MWE cannot be compiled. You can see the error messages by yourself.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{CJKutf8}
\usepackage{pst-eucl}

\def\kor#1{%
\begin{CJK}{UTF8}{mj}
#1%
\end{CJK}}

\begin{document}
\begin{pspicture}(7,8)
    \pstGeonode[PointName={\kor{지}},PosAngle=90](3,3){A}
    %\rput(3,3){\kor{웅}}
\end{pspicture}

\end{document}

PointName cannot accept CJK characters. How to fix it?

1 Answers1

2

CJK package defines CJK symbols as macros. So there are some problems in special cases.

Anyway, you can always use this trick:

\documentclass{article}
\usepackage{CJK}
\usepackage{pst-eucl}
\newsavebox\korbox
\begin{document}
\begin{CJK}{UTF8}{mj}
\begin{pspicture}(7,8)
\sbox\korbox{지}
\pstGeonode[PointName={\usebox\korbox},PosAngle=90](3,3){A}
\sbox\korbox{웅}
\pstGeonode[PointName={\usebox\korbox},PosAngle=90](5,3){B}
\end{pspicture}

\end{CJK}
\end{document}

BTW, you don't need to use CJKutf8 package unless you need \usepackage[utf8]{inputenc}. And you can use CJK environment globally, it's safe.

Leo Liu
  • 77,365
  • what package do I need to allow the characters to flow from top to bottom instead of the normal (flowing from left to right)? – kiss my armpit May 13 '13 at 01:16
  • @Bugbusters: You can't do that. You should rotate the characters and rotate the page. See Vertical Chinese text with XeTeX – Leo Liu May 13 '13 at 04:12
  • @Bugbusters: For Japanese, there is pTeX which do vertical typesetting well. There're also Korean packages, but I'm not familar with them. – Leo Liu May 13 '13 at 04:18
  • Then when do we need to use \usepackage[utf8]{inputenc}\usepackage{CJKutf8}? And what is the difference between using \usepackage{CJK}... \begin{CJK}{UTF8}{mj}...\end{CJK} and \usepackage[utf8]{inputenc}\usepackage{CJKutf8}...\begin{CJK}{UTF8}{mj}...\end{CJK}? – kiss my armpit Nov 16 '13 at 07:24
  • @DonutE.Knot: For CJK typesetting, there is no difference. inputenc with utf8 option is useful when you typeset é, ü, etc. in other languages, such as French, Germen. – Leo Liu Nov 17 '13 at 03:09
  • Sorry. Assume I don't use other languages as what you explained above so I don't use utf8 input encoding, which in turn I don't use CJKutf8 package but I just use CJK package. My question is why do we need to specify UTF8 as the second argument of CJK environment? – kiss my armpit Aug 12 '14 at 18:54
  • 2
    @cyanide-basedfood: There are various character encodings used for Chinese/Japanese/Korean. UTF-8 encoding is just one of them. CJK package need to know the encoding of the source file to process the CJK characters properly. – Leo Liu Aug 13 '14 at 02:46