[XeTeX] Latex philosophy and tips & trick

Yin Dian yindian at gmail.com
Fri Jan 18 01:28:30 CET 2008


Hi Wilfred,

On 1/18/08, Wilfred van Rooijen <wvanrooijen at yahoo.com> wrote:
> Hi all,
>
> just a bit of philosophy, and a request for tips &
> tricks.
>
> I'm an intermediate level user of latex. I've written
> several reports and theses with it. When it comes to
> latex, my philosophy is that if I have an issue I need
> to deal with, someone else will have dealt with it
> earlier, and a style file is probably available. This
> philosophy works remarkably well. I have never needed
> to program any style file or class file. In that
> respect, my experience with latex is excellent,
> especially TeXLive which (in my opinion) is a definite
> improvement over teTeX for the intermediate user
> because it includes so many packages.
>
> OK, that being said, I am on this quest with xe(la)tex
> to see how good it is for Japanese. Again, I'm an
> intermediate user, and this is much more out of
> curiosity and an opportunity to learn, than out of
> necessity.
>
> I have been able to typeset vertical Japanese texts
> using xelatex, and the fontspec package. The trick to
> do is to 'rotate' the glyphs and then put those
> rotated glyphs into a \rotatebox to get vertical
> typesetting. This works remarkably well, especially
> for short pieces of text.
>
> I am trying to typeset a large portion of text
> vertically (say almost 1 page or more than one page).
> I do as follows:
>
> - put the text into a simple \rotatebox. Result: all
> text is on one line, there are no line breaks. This is
> clearly not what I intended.
>
> - I put the text in a minipage
>
> \rotatebox{-90}{
>  \begin{minipage}{\textheight}
>    blabla
>  \end{minipage}
> }
>
> Now the line breaking (thanks to the zhspacing
> package) is OK, but I cannot use any sectioning
> commands etc. Furthermore, if the text occupies more
> than 1 page, it will result in a simple 'overfull box'
> instead of putting the text over two pages.
>
> Thus, using my philosophy about latex, I am sure that
> someone must have dealt with this. Am I right, and if
> yes, who could provide pointers for the necessary
> packages? Or would there be a simple solution to put a
> bunch of text inside some rotatebox, with line
> breaking, with sectioning available and such?
>
> Another solution I could think of is using the
> geometry package to define the pages in landscape
> format, put all the text on it with rotated glyphs,
> and then turn all pages 90 degrees clockwise when
> producing the final PDF. While this would work for
> text, I foresee problems with equations and figures
> and so forth. It can be debated whether or not one
> would have equations in a vertically set text (I'm not
> 100% sure as to what is commonly done in Japan in this
> respect), but there could definitely be floats.

For long texts, you could rotate the pages. That solves nearly all problems.

When \usepackage{everyshi}, you can say
\EveryShipout{\special{pdf: put @thispage <</Rotate 90>>}}

When \usepackage{atbegshi}, you can say
\AtBeginShipout{%
  \global\setbox\AtBeginShipoutBox\vbox{%
    \special{pdf: put @thispage <</Rotate 90>>}%
    \box\AtBeginShipoutBox
  }%
}%

The former one seems to leave the first page unrotated. Have a try and
choose your solution.

>
> I am open for all tips & tricks you can think of!
>
> Thanks,
> Wilfred van Rooijen
>

HTH.

-YIN Dian


More information about the XeTeX mailing list