From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Klein Subject: Re: Exporting multilingual documents (with Japanese) to PDF Date: Tue, 8 Sep 2015 07:36:13 +0200 Message-ID: <20150908073613.1a430b93@pckr150.mpip-mainz.mpg.de> References: <50f675e03f1e1ee53526d58dea829ded@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZBZy-0006kO-PU for emacs-orgmode@gnu.org; Tue, 08 Sep 2015 01:36:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZBZu-0005Xj-Jk for emacs-orgmode@gnu.org; Tue, 08 Sep 2015 01:36:26 -0400 Received: from gate1.mpip-mainz.mpg.de ([194.95.63.248]:34510) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZBZu-0005XV-Dh for emacs-orgmode@gnu.org; Tue, 08 Sep 2015 01:36:22 -0400 In-Reply-To: <50f675e03f1e1ee53526d58dea829ded@openmailbox.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Luis Felipe =?ISO-8859-1?B?TPNwZXo=?= Acevedo Cc: emacs-orgmode@gnu.org Hi, On Mon, 07 Sep 2015 19:18:02 -0500 Luis Felipe L=C3=B3pez Acevedo wrote: > Hi, >=20 > I'm using Emacs 24.4.1 on Debian 8. I currently can export to PDF=20 > documents that mix English and Spanish, but a simple document like > the following produces a PDF with no Japanese characters at all. Only > the English and Spanish text is visible. >=20 > #+TITLE: Notes on Japanese > #+DATE: 2015-09-07 >=20 >=20 > * =EF=BC=92=EF=BC=90=EF=BC=91=EF=BC=95=E5=B9=B4=EF=BC=99=E6=9C=88=EF= =BC=97=E6=97=A5 >=20 > - =E3=81=8A=E3=81=AF=E3=82=88=E3=81=86=E3=81=94=E3=81=96=E3=81=84=E3= =81=BE=E3=81=99=EF=BC=81 > - Good morning! > - =C2=A1Buenos d=C3=ADas! >=20 > The "Org PDF LaTeX Output" shows several errors like this one: >=20 > ! Package inputenc Error: Unicode char \u8:=E5=B9=B4 not set up for = use > with LaTeX. >=20 > The complete log:=20 > https://bitbucket.org/sirgazil/dnd/downloads/nihongo.log >=20 > Searching for a solution on the Web I found this post=20 > http://blogs.fsfe.org/ciaran/?p=3D150. When I use "pdflatex JIS.tex" as=20 > indicated there, I get a good PDF with Japanese characters. >=20 > So I'm wondering how to get this working on Org mode... >=20 like Thomas Dye showed in his mail, you have to encapsulate the Japanese text in LaTeX with \begin{CJK} and \end{CJK}. You can also use links or macros (using links). An example (for Chinese, but Japanese is basically the same, except the fonts): Put the following in your .emacs: #+begin_src elisp (org-add-link-type "zh" nil (lambda (path desc format) (cond ((eq format 'html) (format "%s" desc)) ((eq format 'latex) (format "\\zh{%s}" desc))))) #+end_src Put the following in the head of your org file: #+begin_src org #+LaTeX_HEADER: %% CJK stuff #+LaTeX_HEADER: \usepackage[encapsulated]{CJK} #+LaTeX_HEADER: \usepackage[CJK, overlap]{ruby} #+LaTeX_HEADER: \usepackage{pinyin} #+LaTeX_HEADER: \newcommand{\zh}[1]{\begin{CJK}{UTF8}{gkai}\Large #1\end{CJK}} % gb2312 kai #+LaTeX_HEADER: \renewcommand{\rubysize}{0.5} #+LaTeX_HEADER: %% pinyin 1st and 3rd tone (shortened) #+LaTeX_HEADER: \usepackage{newunicodechar} #+LaTeX_HEADER: \newunicodechar{=C7=8E}{\v{a}} #+LaTeX_HEADER: \newunicodechar{=C7=90}{\v{\i}} #+Macro: zh [[zh:][$1]] #+end_src org=20 Then use CJK in your org file like this: #+begin_src org Now you can user CJK characters like {{{zh(=E4=BD=A0=E5=A5=BD=EF=BC=81)}}= } (N=C7=90 h=C7=8Eo) or [[zh:][=E4=BD=A0=E5=A5=BD=EF=BC=81]]. #+end_src Best regards Robert