Writing Japanese with XeTeX

Writing Japanese with XeTeX

- First Name の投稿
返信数: 10
I am sorry for writing in english, but my 日本語 isn't good enough for that. ;)
And that is why I am not sure if I am right here.

I want to write Japanese with XeTeX.
It means I want to set the traditonal reading direction (top to bottom, right to left).

How can I do this?

How do you do this? I hope it is something simple for you folks. ;)

Here is my sample code.

[code]
\documentclass[20pt]{scrartcl}

\usepackage{xltxtra}
\defaultfontfeatures{Mapping=tex-text}
\usepackage{polyglossia}

\setmainfont{TakaoMincho}

\begin{document}
日本語

ドイツ語
\end{document}
[/code]
First Name への返信

Re: Writing Japanese with XeTeX

- Norbert Preining の投稿
Hi
AFAIK xetex does not support vertical typesetting. You are recommended to use one of the ptex family typesetting engines. In your case a simple way to get similar output would be:
\documentclass{tarticle}
\begin{document}
日本語
ドイツ語
\end{document}
And run it through platex and dvipdfmx. Hope that helps.

Norbert
Norbert Preining への返信

Re: Writing Japanese with XeTeX

- First Name の投稿
> FAIK xetex does not support vertical typesetting

I am not sure at all. But I would say it support it in some ways.

In the past I have done vertical typesetting. But I can not remember how and I can not find the tex-file. ;)


I have never heard of platex. And the doc is not in english. I tried your code with it and it work.
But I think it is to exotic.
For example it doesn't work with the package "ruby".
Without "ruby" I am not able to write the kanji with furigana.
First Name への返信

Re: Writing Japanese with XeTeX

- Norbert Preining の投稿
As I said - AFAIK - of course you can trick vertical typesetting, but proper vertical is done with ptex. ptex and its colleague uptex are developed in Japan especially for Japanese typesettin. So if you need serious Japanese typesetting, you are advised to use it.

For casual typesetting you can of course use xetex and trick it in some way to do vertical typesetting - but I don't know how.
Norbert Preining への返信

Re: Writing Japanese with XeTeX

- 奥村 晴彦 の投稿
XeTeX does not support vertical typesetting, but you can rotate characters 90 degrees counterclockwise to mimic vertical typesetting. I think it's less than perfect, but you could try:
http://d.hatena.ne.jp/zrbabbler/20130215/1360954062
Norbert Preining への返信

Re: Writing Japanese with XeTeX

- First Name の投稿
> And run it through platex and dvipdfmx. Hope that helps.

So how can I use all my known TeX stuff with it? KOMA classes for example, biblatex, pstricks, etc

Where can I find english documentation about platex?
First Name への返信

Re: Writing Japanese with XeTeX

- Norbert Preining の投稿
(u)platex are normal LaTeX engines with some extensions. You can use biblatex normally, pstricks I guess are fine (check with dvipdfmx), KOMA, too, should be fine. For a quick testI tried:
\documentclass[20pt]{scrartcl}
\begin{document}
\vbox{\tate
日本語
ドイツ語}
\end{document}

and that worked nicely.

English documentation for platex ... hmm, that is difficult.

Norbert

Norbert Preining への返信

Re: Writing Japanese with XeTeX

- First Name の投稿
I am suprised. ;) But...

The text is set to the left side of the document. It has to appear on the right of course.
First Name への返信

Re: Writing Japanese with XeTeX

- Norbert Preining の投稿
On the left? - of course, you are doing left to right typesetting in KOMA class. How do you expect that the KOMAclasses know about vertical typesetting.

WHat is created is a vertical box and *within* that box the text is set from right to left, correclty (as you see in the order of the words). But the box itself is set to the left, as this is the default for left-to-right typosetting as defaulted to KOMA.

That is the reason why in the first example I used tarticle.

You cannot expect arbitrary LaTeX classes to be prepared for Japanese typesetting? How should this work?

You can easily fix that yourself with embedding it into an hbox and hfill or similar tricks, or wrap it into a flushright environment, or whatever you want.

But with KOMA you are fundamentally in left-to-right mode. That cannot be changed.

I would suggest *first* specifying what you actually want to do, before asking too general questions.