Edit Links |
LyX /
Unicode
<< | Page list | >>
Instructions on setting up and using Unicode in LyX Unicode!Please fill in. Unsupported unicode charactersIf you come across a unicode character that is not yet supported by LyX, you can enter it here. CJK and UnicodeEven though LyX 1.5.x says it supports CJK, it's a little tricky to get it working straight out of the box. This page has a small tutorial on how to get it working. I have only had experience doing this on my Windows XP machine, but it's worked through all the 1.5.0 betas as well as the (as of now) current 1.5.1. As of now, this method does not work for Korean - but I suppose if someone was handy enough with creating packages of these tfms and fds it should be easy if you have a good truetype font. Most of this info has come off of Jan Poland's helpful site. The instructions are more or less copied here. When I refer to "texmf" throughout this document, I refer to your main LaTeX folder - on my computer it's the Miktex folder in Program Files. Note: The method described here is clumsy, because you have to use ERT in the document, or preamble definitions. If you install appropriate bitmap fonts (jsso12 for Japanese, cyberbit for Chinese). LyX will work out of the box at least for Japanese and Chinese. There's a step-by-step tutorial on how to install the cyberbit fonts here. I didn't find a tutorial for the jsso12 fonts. However, if you're running linux, installing the hbf-kanji48 package is sufficient. a.) Install font metric files Download this zip file found on Jan Poland's site or create your own using his instructions. Place them in texmf/fonts/tfm/IPA b.) Download and install ipam.ttf The Open Printing Project provides ipam.ttf for free in their package, which can be found here. It should be in the folder "ipafont". Place this file in texmf/fonts/truetype or a subdirectory. c.) Install font definition files Download this file and place the extracted files in a subdirectory of texmf/tex/latex - Alternatively you can create them using the instructions given. d.) Find and edit ttfonts.map Find ttfonts.map on your system and append the following to the end of the file: ipam-uni@Unicode@ ipam.ttf
e.) Refresh file name database Refresh your file name database - with Miktex it's accessed through the "settings" program. f.) Create a test file Now it's time to create a test file with some Japanese or
Chinese text. First, make sure your document is set to utf8
encoding (found under Document Settings-> Language -> Encoding).
Now that that's set, create two ERT blocks: the first should
contain An alternate method which does not require the ERT blocks was offered up by Marc Flerackers on the mailing list: If you add the following preamble, you don't need to add the \begin{CJK}
\def\CJKhook{\CJKenc{UTF8}}
\ifx\CJKpreproc\undefined
\def\CJKpreproc{cjk-enc}
\RequirePackage[global]{CJK}
\AtBeginDocument{\begin{CJK*}{UTF8}{ipam}\CJKspace}
\AtEndDocument{\end{CJK*}}
\else
\CJKhook
\fi
\usepackage[overlap, CJK]{ruby}
\CJKencfamily{UTF8}{ipam}
\renewcommand{\rubysep}{-0.3ex}
I have not personally tried this, but it supposedly works with mixed text documents. I may put up some test files once I get the password to upload with, if that would be helpful. I can also try to get permission from Jan to upload his files here. Devanagari and Unicode(to be filled in soon by me) See also http://www.wikihow.com/Create-Devanagari-Documents-in-Lyx-Using-Xelatex Greek and UnicodeMath and UnicodeIn LyX<=1.5.x, don't insert Unicode characters in Math fields: only standard latex commands will work. A tricky example are symbols such as the greek letters (\alpha, ...): when copied and pasted from other sources, the editor will not complain. BUT, as soon as you try to compile the tex/ps/pdf output, the process will stop, most of the times without *any* error or warning. If you manually proceed step by step and convert the files yourself, you'll get an error like: "Basic::_M_convert_to_external call error", without reference on the source of the error. The solution is of course to use non-multibyte characters in Math fields (possibly plain ascii only). |