Chinese support: What is relationship between Lyx, CJK, and xetex?

2009-01-17 Thread Paul Johnson
In our Linux lab, a student asked for installation of Chinese support.
We have machines with TeXLive-2007 and LyX 1.5.6 or 1.6.1.   I spent
most of the afternoon and evening trying to figure out what might be
the bare minimum change needed so that a person can write  print
documents in Chinese via LyX. It is confusing mainly because there are
a lot of half-finished ways to do this. Should we use the separate
package LyX-CJK or LyX with Unicode font support or LyX with CJK font
support.

After installing a lot of packages for latex-cjk support and the scim
tool for multi-language input, I arrived at a working version of LyX
that could accept Chinese characters that would show on the screen,
but none of the Lyx View options would work.  I was stuck on that
problem for a long time. Errors kept saying that the Chinese symbols
were not recognized or fonts were missing. It may be I did not have
the preamble or Language options specified correctly, I tried many
things.  I saw on the LyX Wiki that Japanese and Chinese are supposed
to work out of the box, (  ) but I don't see how

The Debian readme with latex-cjk explains how a commercial font
Cyberbit.ttf can be obtained and installed (Wow, that's a big
project).  After that, I do succeed with latex in compiling a example
file UTF8.tex that comes with latex-cjk. I even succeeded in building
a LyX file that does work!   It surprised me a bit that the proper
character is simply utf8 and the language English. None of the
encodings for CJK worked.

I put the pdf output and the lyx file here so you can see for
yourselves.  (Remember, the fonts from Cyberbit.ttf are needed).
http://pj.freefaculty.org/latex/UTF8.pdf
http://pj.freefaculty.org/latex/UTF8.lyx

I don't know if the result is nice looking in the eyes of a Chinese
reader, but I bet I'll find out later.

If you have a lyx file that works with Chinese characters that does
not require such an exotic font, I wish you'd share your example.

We found another alternative that seems to work.  XeTeX is described
in the LyX wiki (http://wiki.lyx.org/LyX/XeTeX).

I took the document xetex.lyx and followed its instructions and, to my
surprise, xelatex did work! If you look to the bottom of the pdf, you
see the Chinese characters do print.

http://pj.freefaculty.org/latex/xetex.lyx
http://pj.freefaculty.org/latex/xetex.pdf

I was even able to use LyX preferences to create a new output format
PDF(xetex) and configure it so the Lyx View menu would trigger xetex.
It would be hard to describe the pointing and clicking, but here is
the bit from my LyX preferences file, and I believe if you add these
lines under FORMATS and CONVERTERS, then you will have same benefit.

#
# FORMATS SECTION ##
#
\format pdf4 pdf PDF(xelatex)  xdg-open  document,vector
#
# CONVERTERS SECTION ##
#
\converter pdflatex pdf4 xelatex $$i  latex
#
lyx

At the end of the day, I suppose I've made some progress, but the road
forward does not seem so clear to me. Should I tell the students to
focus on using Xetex or latex with Unicode.


-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas


Chinese support: What is relationship between Lyx, CJK, and xetex?

2009-01-17 Thread Paul Johnson
In our Linux lab, a student asked for installation of Chinese support.
We have machines with TeXLive-2007 and LyX 1.5.6 or 1.6.1.   I spent
most of the afternoon and evening trying to figure out what might be
the bare minimum change needed so that a person can write  print
documents in Chinese via LyX. It is confusing mainly because there are
a lot of half-finished ways to do this. Should we use the separate
package LyX-CJK or LyX with Unicode font support or LyX with CJK font
support.

After installing a lot of packages for latex-cjk support and the scim
tool for multi-language input, I arrived at a working version of LyX
that could accept Chinese characters that would show on the screen,
but none of the Lyx View options would work.  I was stuck on that
problem for a long time. Errors kept saying that the Chinese symbols
were not recognized or fonts were missing. It may be I did not have
the preamble or Language options specified correctly, I tried many
things.  I saw on the LyX Wiki that Japanese and Chinese are supposed
to work out of the box, (  ) but I don't see how

The Debian readme with latex-cjk explains how a commercial font
Cyberbit.ttf can be obtained and installed (Wow, that's a big
project).  After that, I do succeed with latex in compiling a example
file UTF8.tex that comes with latex-cjk. I even succeeded in building
a LyX file that does work!   It surprised me a bit that the proper
character is simply utf8 and the language English. None of the
encodings for CJK worked.

I put the pdf output and the lyx file here so you can see for
yourselves.  (Remember, the fonts from Cyberbit.ttf are needed).
http://pj.freefaculty.org/latex/UTF8.pdf
http://pj.freefaculty.org/latex/UTF8.lyx

I don't know if the result is nice looking in the eyes of a Chinese
reader, but I bet I'll find out later.

If you have a lyx file that works with Chinese characters that does
not require such an exotic font, I wish you'd share your example.

We found another alternative that seems to work.  XeTeX is described
in the LyX wiki (http://wiki.lyx.org/LyX/XeTeX).

I took the document xetex.lyx and followed its instructions and, to my
surprise, xelatex did work! If you look to the bottom of the pdf, you
see the Chinese characters do print.

http://pj.freefaculty.org/latex/xetex.lyx
http://pj.freefaculty.org/latex/xetex.pdf

I was even able to use LyX preferences to create a new output format
PDF(xetex) and configure it so the Lyx View menu would trigger xetex.
It would be hard to describe the pointing and clicking, but here is
the bit from my LyX preferences file, and I believe if you add these
lines under FORMATS and CONVERTERS, then you will have same benefit.

#
# FORMATS SECTION ##
#
\format pdf4 pdf PDF(xelatex)  xdg-open  document,vector
#
# CONVERTERS SECTION ##
#
\converter pdflatex pdf4 xelatex $$i  latex
#
lyx

At the end of the day, I suppose I've made some progress, but the road
forward does not seem so clear to me. Should I tell the students to
focus on using Xetex or latex with Unicode.


-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas


Chinese support: What is relationship between Lyx, CJK, and xetex?

2009-01-17 Thread Paul Johnson
In our Linux lab, a student asked for installation of Chinese support.
We have machines with TeXLive-2007 and LyX 1.5.6 or 1.6.1.   I spent
most of the afternoon and evening trying to figure out what might be
the bare minimum change needed so that a person can write & print
documents in Chinese via LyX. It is confusing mainly because there are
a lot of half-finished ways to do this. Should we use the separate
package LyX-CJK or LyX with Unicode font support or LyX with CJK font
support.

After installing a lot of packages for latex-cjk support and the scim
tool for multi-language input, I arrived at a working version of LyX
that could accept Chinese characters that would show on the screen,
but none of the Lyx View options would work.  I was stuck on that
problem for a long time. Errors kept saying that the Chinese symbols
were not recognized or fonts were missing. It may be I did not have
the preamble or Language options specified correctly, I tried many
things.  I saw on the LyX Wiki that Japanese and Chinese are supposed
to work "out of the box," (  ) but I don't see how

The Debian readme with latex-cjk explains how a commercial font
Cyberbit.ttf can be obtained and installed (Wow, that's a big
project).  After that, I do succeed with latex in compiling a example
file UTF8.tex that comes with latex-cjk. I even succeeded in building
a LyX file that does work!   It surprised me a bit that the proper
character is simply utf8 and the language English. None of the
encodings for CJK worked.

I put the pdf output and the lyx file here so you can see for
yourselves.  (Remember, the fonts from Cyberbit.ttf are needed).
http://pj.freefaculty.org/latex/UTF8.pdf
http://pj.freefaculty.org/latex/UTF8.lyx

I don't know if the result is "nice looking" in the eyes of a Chinese
reader, but I bet I'll find out later.

If you have a lyx file that works with Chinese characters that does
not require such an exotic font, I wish you'd share your example.

We found another alternative that seems to work.  XeTeX is described
in the LyX wiki (http://wiki.lyx.org/LyX/XeTeX).

I took the document xetex.lyx and followed its instructions and, to my
surprise, xelatex did work! If you look to the bottom of the pdf, you
see the Chinese characters do print.

http://pj.freefaculty.org/latex/xetex.lyx
http://pj.freefaculty.org/latex/xetex.pdf

I was even able to use LyX preferences to create a new output format
PDF(xetex) and configure it so the Lyx View menu would trigger xetex.
It would be hard to describe the pointing and clicking, but here is
the bit from my LyX preferences file, and I believe if you add these
lines under FORMATS and CONVERTERS, then you will have same benefit.

#
# FORMATS SECTION ##
#
\format "pdf4" "pdf" "PDF(xelatex)" "" "xdg-open" "" "document,vector"
#
# CONVERTERS SECTION ##
#
\converter "pdflatex" "pdf4" "xelatex $$i " "latex"
#
lyx

At the end of the day, I suppose I've made some progress, but the road
forward does not seem so clear to me. Should I tell the students to
focus on using Xetex or latex with Unicode.


-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas