Op 25-3-2012 9:23, Nicholas Martin schreef:
OK, I've now figured out how to write Chinese in Lyx 2.02. Apologies
for all who have no interest in this whatsoever, but since a brief
perusal of the forum shows that many have struggled with the same
problem, and that much of the advice given in the forum is now
outdated (due to the improvements since Lyx 1.4, 1.5 etc.), I thought
it might be helpful to share the instructions:
1. Write the following code into the Latex Preamble (Document
-->Settings -->Latex Preamble ):
\usepackage{CJKutf8}
\usepackage[overlap, CJK]{ruby}
\newenvironment{SChinese}{%
\CJKfamily{gbsn}%
\CJKtilde
\CJKnospace}{}
\newcommand{\cntxt}[1]{\begin{CJK}{UTF8}{}\begin{SChinese}#1\end{SChinese}\end{CJK}}
2. Then, when you want to write Chinese in the text, do the following:
Open a Tex Box (in menu, 6^th button from right). Into the Tex box
then write the following command [replacing the characters below with
whatever Chinese you want to write].
\begin{CJK}{UTF8}{}\begin{SChinese}整治\end{SChinese}\end{CJK}
Nicholas
On Mar 24, 2012, at 7:23 PM, Vincent van Ravesteijn wrote:
Op 24-3-2012 11:02, Nicholas Martin schreef:
Dear Lyx Community
I'm currently using Lyx version 2.02 and am trying to create a text
document (mainly in English) that also contains a few Chinese
characters. However, having written my text, whenever I clicked on
pdf viewer, the program said it "Could not find LaTeX command for
character '整' (code point 0x548c) and suggested I selected utf8
[i.e., Unicode] in Document --> Settings --> Language --> Encoding
and then try again. So I set Encoding to “Unicode (utf8)", but to no
avail. I got exactly the same message. I then tried "Unicode (CJK)
(utf8)" and successively all the different unicode settings, all
without success. I also tried playing around with the various other
settings under Document --> Language (i.e., setting Language to
Chinese, choosing the different Language packages [default,
automatic, always babel, custom, none]), but all without success.
Any suggestion what I could do?
Many thanks!
Nicholas
Does this help you ?
http://wiki.lyx.org/LyX/Chinese
Vincent
I tried again the instructions from this wiki page (which I wrote myself
by the way), and it still works for me.
On which platform are you ? If you are at Windows, you need to make
sure that MikTeX has installed the packages has installed "cjk" and
"arphic". Then you need to refresh the filename database of MikTeX.
I'll try "cjk-fonts" and XeTeX as well.
Vincent