emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Luis Felipe López Acevedo" <felipe.lopez@openmailbox.org>
To: Robert Klein <roklein@roklein.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: Exporting multilingual documents (with Japanese) to PDF
Date: Tue, 08 Sep 2015 12:57:32 -0500	[thread overview]
Message-ID: <81dd85ac4eb17822adead38e3ebbc30f@openmailbox.org> (raw)
In-Reply-To: <20150908073613.1a430b93@pckr150.mpip-mainz.mpg.de>

On 2015-09-08 00:36, Robert Klein wrote:
> Hi,
> 
> On Mon, 07 Sep 2015 19:18:02 -0500
> Luis Felipe López Acevedo <felipe.lopez@openmailbox.org> wrote:
> 
>> Hi,
>> 
>> 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.
>> 
>>      #+TITLE: Notes on Japanese
>>      #+DATE: 2015-09-07
>> 
>> 
>>      * 2015年9月7日
>> 
>>      - おはようございます!
>>      - Good morning!
>>      - ¡Buenos días!
>> 
>> The "Org PDF LaTeX Output" shows several errors like this one:
>> 
>>      ! Package inputenc Error: Unicode char \u8:年 not set up for use
>> with LaTeX.
>> 
>> The complete log:
>> https://bitbucket.org/sirgazil/dnd/downloads/nihongo.log
>> 
>> Searching for a solution on the Web I found this post
>> http://blogs.fsfe.org/ciaran/?p=150. When I use "pdflatex JIS.tex" as
>> indicated there, I get a good PDF with Japanese characters.
>> 
>> So I'm wondering how to get this working on Org mode...
>> 
> 
> 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{ǎ}{\v{a}}
>   #+LaTeX_HEADER: \newunicodechar{ǐ}{\v{\i}}
> 
>   #+Macro: zh [[zh:][$1]]
> #+end_src org
> 
> 
> Then use CJK in your org file like this:
> 
> #+begin_src org
>   Now you can user CJK characters like {{{zh(你好!)}}} (Nǐ hǎo) or
>   [[zh:][你好!]].
> #+end_src
> 
> Best regards
> Robert

Hmm, that's kinda complex. I think I'll limit myself to HTML exports 
then.

Thomas, mahalo nui loa; Robert, thank you very much :)

-- 
Luis Felipe López Acevedo
http://sirgazil.bitbucket.org/

  reply	other threads:[~2015-09-08 17:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-08  0:18 Exporting multilingual documents (with Japanese) to PDF Luis Felipe López Acevedo
2015-09-08  1:24 ` Thomas S. Dye
2015-09-08  5:36 ` Robert Klein
2015-09-08 17:57   ` Luis Felipe López Acevedo [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-09-07 20:56 Luis Felipe López Acevedo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81dd85ac4eb17822adead38e3ebbc30f@openmailbox.org \
    --to=felipe.lopez@openmailbox.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=roklein@roklein.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).