emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Exporting multilingual documents (with Japanese) to PDF


From: Thomas S . Dye
Subject: Re: [O] Exporting multilingual documents (with Japanese) to PDF
Date: Mon, 07 Sep 2015 15:24:18 -1000

Aloha Luis,

Luis Felipe López Acevedo <address@hidden> writes:

> 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...

The following illustrates one approach.  You'll probably have to augment
the definition of the LaTeX class by adding fonts, etc., but if you have
a working example on your system that should not be hard.  Note that
the example relies on the setup code, so you'll either need to read the
code from its own file or refresh the setup with C-c C-c when point is
on one of the #+ lines at the top.

#+SELECT_TAGS: export
#+EXCLUDE_TAGS: noexport
#+CREATOR: Emacs 24.5.1 (Org mode 8.3.1)
#+OPTIONS: ':nil *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline
#+OPTIONS: author:nil c:nil creator:nil d:(not "LOGBOOK") date:nil e:t
#+OPTIONS: email:nil f:t inline:t num:t p:nil pri:nil prop:nil stat:t
#+OPTIONS: tags:t tasks:t tex:t timestamp:t title:nil toc:nil todo:t |:t
#+LATEX_CLASS: japanese

* Acevedo example

#+attr_latex: :options [dnp]{JIS}{min}
#+begin_CJK*
I can write this 私はキランです in Japanese.
#+end_CJK*

* Setup code                                                       :noexport:
#+name: japanese-class
#+header: :results silent
#+begin_src emacs-lisp
(add-to-list 'org-latex-classes
                '("japanese"
                  "\\documentclass{scrartcl}
                         [NO-DEFAULT-PACKAGES]
                         [PACKAGES]
                         [EXTRA]
                   \\usepackage{CJK}
                   \\usepackage{hyperref}"
                 ("\\section{%s}" . "\\section*{%s}")
                 ("\\subsection{%s}" . "\\subsection*{%s}")
                 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
                 ("\\paragraph{%s}" . "\\paragraph*{%s}")
                 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
#+end_src


* Local variables                                                  :noexport:
# Local Variables:
# coding: euc-japan
# eval: (sbe "japanese-class")

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]