<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I use XeLaTeX with vertically typeset CJK, using some custom macros:<br>
<br>
% ----------------------------------------------------------------<br>
% ruby markup stuff<br>
% ----------------------------------------------------------------<br>
<br>
\usepackage{accsupp}<br>
<br>
% ----------------------------------------------------------------<br>
% ruby and rubystack for for use in tables.<br>
% This needs extra spacing to ensure visually appealing alignment,<br>
% but rather than using an extra argument, it figured it'd be more<br>
% readable, and overall less space-taking to just copy the plain<br>
% macro and rename it<br>
% ----------------------------------------------------------------<br>
<br>
\newcommand*{\rtrubystack}[2]{{\relscale{0.5}%<br>
\begin{tabular}[b]{@{}c@{}}%<br>
{#1}\\%<br>
{\textscale{2}{#2}}%<br>
\end{tabular}}%<br>
}<br>
<br>
\DeclareRobustCommand*{\rtruby}[2]{%<br>
\mbox{%<br>
\setlength{\parskip}{0ex}%<br>
\BeginAccSupp{method=pdfstringdef,ActualText={#1}}%<br>
\rtrubystack{\phantom{#2}}{#1}%<br>
\llap{%<br>
\rtrubystack{#2}{\phantom{#1}}%<br>
}%<br>
\EndAccSupp{}%<br>
}%<br>
}<br>
<br>
% --------------------------------------------------------------<br>
% ruby and rubystack macro, effecting ghost furigana in the PDF <br>
% --------------------------------------------------------------<br>
<br>
\newcommand*{\rubystack}[2]{{\relscale{0.5}%<br>
\begin{tabular}[b]{@{}c@{}}%<br>
{#1}\\%<br>
{\textscale{2}{#2}}%<br>
\end{tabular}}%<br>
}<br>
<br>
\DeclareRobustCommand*{\ruby}[2]{%<br>
\mbox{%<br>
\setlength{\parskip}{0ex}%<br>
% \BeginAccSupp{method=pdfstringdef,ActualText={#1 (#2)}}%<br>
\BeginAccSupp{method=pdfstringdef,ActualText={#1}}%<br>
\rubystack{\phantom{#2}}{#1}%<br>
\llap{%<br>
\rubystack{#2}{\phantom{#1}}%<br>
}%<br>
\EndAccSupp{}%<br>
}%<br>
}<br>
<br>
%
--------------------------------------------------------------------------<br>
% helper macro: adds space between the text and the [T]op \hline in
a table<br>
%
--------------------------------------------------------------------------<br>
<br>
\newcommand\T{\rule{0pt}{2.5ex}}% zero width, 2.5ex vertical
spacing, ensures a visually appealing vertical alignment<br>
<br>
%
--------------------------------------------------------------------------<br>
% vertical typesetting for CJK<br>
%
--------------------------------------------------------------------------<br>
<br>
\DeclareRobustCommand*{\vruby}[2]{%<br>
\mbox{%<br>
\setlength{\parskip}{0ex}%<br>
\BeginAccSupp{method=pdfstringdef,ActualText={#1}}%<br>
\rule{0pt}{1.7em}\rubystack{\phantom{#2}}{#1}%<br>
\llap{%<br>
\rule{0pt}{1.7em}\rubystack{\smaller #2}{\phantom{#1}}%<br>
}%<br>
\EndAccSupp{}%<br>
}%<br>
}<br>
<br>
\newcommand{\vertical}[4]{%<br>
\XeTeXinterchartokenstate = 0 %<br>
\begin{center}%<br>
\rotatebox{-90}{%<br>
\begin{varwidth}{\textwidth}%<br>
\fontsize{#2pt}{#2pt}<br>
\fontspec[RawFeature=vertical, Script=CJK]{#1}#4<br>
\vspace{#2pt}%<br>
\vspace{#2pt}% this padding should only exist if ruby is present,
for visual offset<br>
\vspace{#2pt}%<br>
\end{varwidth}}%<br>
\\<br>
\vspace{12pt}<br>
\XeTeXinterchartokenstate = 1 %<br>
\fontsize{8pt}{10pt}#3<br>
\end{center}%<br>
\XeTeXinterchartokenstate = 1 %<br>
}<br>
<br>
<br>
I then use it as:<br>
<br>
\vertical<span style="color: rgb(0, 0, 0); font-family: 'Lucida
Grande', Verdana, Lucida, Helvetica, Arial, sans-serif; font-size:
13px; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal; orphans: 2;
text-align: justify; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); display: inline !important;
float: none;">{Kozuka Mincho Pro}{21}{The いろは poem, with classical
kana transcription}</span>{色は匂へど...}<br>
<br>
so it has baked in font name, font size, "block title", and then the
actual text to typeset. This typesets the text top-down, right to
left.<br>
<br>
- Mike "Pomax" Kamermans<br>
</body>
</html>