From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Luis_Felipe_L=C3=B3pez_Acevedo?= Subject: Re: Exporting multilingual documents (with Japanese) to PDF Date: Tue, 08 Sep 2015 12:57:32 -0500 Message-ID: <81dd85ac4eb17822adead38e3ebbc30f@openmailbox.org> References: <50f675e03f1e1ee53526d58dea829ded@openmailbox.org> <20150908073613.1a430b93@pckr150.mpip-mainz.mpg.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZN9T-0003V6-4c for emacs-orgmode@gnu.org; Tue, 08 Sep 2015 13:57:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZN9O-0007VD-Od for emacs-orgmode@gnu.org; Tue, 08 Sep 2015 13:57:50 -0400 Received: from mail2.openmailbox.org ([62.4.1.33]:55555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZN9O-0007UC-HL for emacs-orgmode@gnu.org; Tue, 08 Sep 2015 13:57:46 -0400 In-Reply-To: <20150908073613.1a430b93@pckr150.mpip-mainz.mpg.de> 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: Robert Klein Cc: emacs-orgmode@gnu.org On 2015-09-08 00:36, Robert Klein wrote: > Hi, >=20 > On Mon, 07 Sep 2015 19:18:02 -0500 > Luis Felipe L=C3=B3pez Acevedo wrote: >=20 >> Hi, >>=20 >> I'm using Emacs 24.4.1 on Debian 8. I currently can export to PDF >> 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 f= or use >> with LaTeX. >>=20 >> The complete log: >> https://bitbucket.org/sirgazil/dnd/downloads/nihongo.log >>=20 >> Searching for a solution on the Web I found this post >> http://blogs.fsfe.org/ciaran/?p=3D150. When I use "pdflatex JIS.tex" a= s >> indicated there, I get a good PDF with Japanese characters. >>=20 >> So I'm wondering how to get this working on Org mode... >>=20 >=20 > like Thomas Dye showed in his mail, you have to encapsulate the > Japanese text in LaTeX with \begin{CJK} and \end{CJK}. >=20 > You can also use links or macros (using links). An example (for > Chinese, but Japanese is basically the same, except the fonts): >=20 > Put the following in your .emacs: >=20 > #+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 >=20 > Put the following in the head of your org file: >=20 > #+begin_src org > #+LaTeX_HEADER: %% CJK stuff > #+LaTeX_HEADER: \usepackage[encapsulated]{CJK} > #+LaTeX_HEADER: \usepackage[CJK, overlap]{ruby} > #+LaTeX_HEADER: \usepackage{pinyin} >=20 > #+LaTeX_HEADER: \newcommand{\zh}[1]{\begin{CJK}{UTF8}{gkai}\Large > #1\end{CJK}} % gb2312 kai #+LaTeX_HEADER: \renewcommand{\rubysize}{0.5} >=20 > #+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}} >=20 > #+Macro: zh [[zh:][$1]] > #+end_src org >=20 >=20 > Then use CJK in your org file like this: >=20 > #+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 >=20 > Best regards > Robert Hmm, that's kinda complex. I think I'll limit myself to HTML exports=20 then. Thomas, mahalo nui loa; Robert, thank you very much :) --=20 Luis Felipe L=C3=B3pez Acevedo http://sirgazil.bitbucket.org/