I am using TexLive 2015 on Debian Jessie with what I believe to be a complete installation (including Debian packages such as cjk-latex, texlive-fonts-extra, and latex-cjk-chinese-arphic-bsmi00lp).
I have a predominantly English document in which I would like to insert just a very few Chinese ideograph characters:
- dragon, 龍,
U+F9C4(byte patterne9 be 8din UTF-8) - dream, 夢,
U+5922(byte patterne5 a4 a2in UTF-8) - fish, 魚,
U+9B5A(byte patterne9 ad 9ain UTF-8)
Running file -bi myfile.tex reports text/x-tex; charset=utf-8. Near the top, my file contains
\usepackage[utf8]{inputenc}
\usepackage{CJKutf8}
I also defined
\newcommand{\chinesechar}[1]{{\CJKfamily{bsmi}#1}}
When I attempt to use this in the body of my document, compilation with pdflatex is successful:
\chinesechar{} => nothing is output
\chinesechar{abc} => the 3 characters "abc" are output
Then, I have tried two ways of inserting the dragon character directly into the file. The first way was to use emacs' built-in command C-x 8 RET f9c4 to insert the dragon character into the file. The second way was to start with abc, then use a hex editor to change the three bytes into e9 9b a8 (which is the UTF-8 encoding of U+f9c4). In either case, I will then see dashed square brackets representing the ideograph, and will the same error message upon running pdflatex:
Package inputenc Error: Unicode char \u8:[] not set up for use with LaTeX. (Except, the [] that appears is dashed, not solid. Even outside the editor, the Chinese character when pasted from this web question appears with the dashed square brackets in the terminal (which is xterm).)
(Note: Someone commented below that I should use a smarter editor, but I believe this problem is more correctly understood as being with the subsequent processing of the character by LaTeX rather than the task of entering the character itself into the editor.)
Changing \usepackage[utf8]{inputenc} to \usepackage[utf8x]{inputenc} merely yields a different error under pdflatex:
LaTeX error: Option clash for package inputenc.
I have seen XeLaTeX mentioned as a good option for documents in which Chinese is the main language, but attempting to switch also caused me problems. Viewing the content of other questions posted on this site such as such as How can I write an English document with a few words of Thai, Japanese, and Chinese? has not enabled me to achieve my goal.
How to insert three Chinese characters? has been suggested as a potential duplicate of this question. I do not see it as such: I was asking about using text rather than images. That said, I am open to the possibility that what I would like to do cannot in fact be done using text, that instead one must use images as outlined in that post. Thus, I went and attempted to try that solution. Specifically, I wrote this file using dragon (龍):
\documentclass{standalone}
\usepackage{CJK}
\begin{document}
\begin{CJK}{UTF8}{gbsn}
龍
\end{CJK}
\end{document}
(I also tried using dream (夢) and fish(魚) alone on the line.)
When I run pdflatex on the above file using dream (U+5922) or fish (U+9B5A), a .pdf file is output, but viewing it (with evince) shows no character. [However, trying rain (U+96E8) does in fact work!]
when I run pdflatex on the above file using dragon (U+F9C4), I end up seeing
This is METAFONT, Version 2.7182818 (Tex Live 2015/dev/Debian) (preloaded base=mf)
kpathsea: Running mktexmf gbsnuf9
! I can't find file `gbsnuf9'.
<*> ...=ljfour; mag:=1; nonstopmode; input gbsnuf9
Please type another input file name
! Emergency stop.
<*> ...=ljfour; mag:=1; nonstopmode; input gbsnuf9
Transcript written on mfput.log.
grep: gbsnuf9.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input gbsnuf9' failed to make gbsnuf9.tfm.
kpathsea: Appending font creation commands to missfont.log.
! Font C70/gbsn/m/n/10/f9=gbsnuf9 at 10.0pt not loadable: Metric (TFM) file not found.
<to be read again>
relax
l.12 龍
So, this workaround appears to not work.
To summarize the question:
How can I succeed in including a few Chinese ideograph characters (ideally, as actual text) while using pdflatex?