summaryrefslogtreecommitdiff
path: root/language/japanese/pxrubrica/pxrubrica-en.tex
blob: 6ad593e02f2bdb55b447a53e7c9b56ba05f0646c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
\documentclass[a4paper]{article}
\usepackage[scale=0.8]{geometry}
\usepackage{setspace}
\usepackage{pxrubrica}
\newcommand*{\vb}{\symbol{`\|}}
\newcommand*{\Opt}[1]{\texttt{#1}}
\newcommand*{\PKN}[1]{\textsf{#1}}
\newcommand*{\Eg}{E.\,g.\mbox{}}
\newcommand*{\eg}{e.\,g.\mbox{}}
\newcommand*{\ie}{i.\,e.\mbox{}}
\newcommand*{\myfileversion}{1.3d}
\newcommand*{\myfiledate}{2021/03/06}
\newsavebox{\myexample}
\begin{document}

\title{The \PKN{pxrubrica} package}
\author{Takayuki YATO\quad (aka ``ZR'')}
\date{v\myfileversion \quad[\myfiledate]}
\maketitle

\setstretch{1.5}

\section{Package Loading}

There is no options available.

\begin{quote}\small\begin{verbatim}
\usepackage{pxrubrica}
\end{verbatim}\end{quote}

\section{Basic Usage}

\subsection{Very Basic}

\begin{itemize}
\item Mono ruby (\Opt{m} option): one ruby block per one kanji.\\
\Eg\quad
\verb+\ruby[m]{$BBk(B}{$B$?$+(B}+ $\rightarrow$ \ruby[m]{$BBk(B}{$B$?$+(B}\quad
\verb+\ruby[m]{$Brt(B}{$B$&$0$$$9(B}+ $\rightarrow$ \ruby[m]{$Brt(B}{$B$&$0$$$9(B}
\item Group ruby (\Opt{g} option): one ruby block per kanji sequence.\\
\Eg\quad
\verb+\ruby[g]{$B1@?}(B}{$B$R$P$j(B}+ $\rightarrow$ \ruby[g]{$B1@?}(B}{$B$R$P$j(B}\quad
\verb+\ruby[g]{$BITG!5"(B}{$B$[$H$H$.$9(B}+ $\rightarrow$ \ruby[g]{$BITG!5"(B}{$B$[$H$H$.$9(B}
\item Jukugo ruby (\Opt{j} option): one ruby block per kanji, but read as whole.\\
\Eg\quad
\verb+\ruby[j]{$B9&?}(B}{$B$/(B|$B$8$c$/(B}+ $\rightarrow$ \ruby[j]{$B9&?}(B}{$B$/(B|$B$8$c$/(B}\quad
\verb+\ruby[j]{$B<7LLD;(B}{$B$7$A(B|$B$a$s(B|$B$A$g$&(B}+ $\rightarrow$ \ruby[j]{$B<7LLD;(B}{$B$7$A(B|$B$a$s(B|$B$A$g$&(B}\\
The current implementation uses the following strategy:
if none of the ruby string per a kanji causes protrusion,
then the whole is typeset as mono-ruby;
otherwise, the whole is typeset as group-ruby,
ignoring the ruby grouping.

\item A \verb+|+ symbol in a ruby string denotes the boundary of reading for each kanji
(\ie\ $B9&(B = $B$/(B and $B?}(B = $B$8$c$/(B).
It is not needed in group ruby.
\item Comparison of typeset results:
\begin{quote}\begin{tabular}{ll@{\ }l@{\ }c*3{@{\quad}c}}
Mono & (\verb+\ruby[m]{$B>.H7(B}{$B$3(B|$B$P$H(B}+) & $\rightarrow$
  & \ruby[m]{$B>.H7(B}{$B$3(B|$B$P$H(B}
  & \ruby[m]{$Bs5ry(B}{$B$;$-(B|$B$l$$(B}
  & \ruby[m]{$BMkD;(B}{$B$i$$(B|$B$A$g$&(B}
  & \ruby[m]{$B1m(B}{$B$D$P$a(B}
\\
Group & (\verb+\ruby[g]{$B>.H7(B}{$B$3$P$H(B}+) & $\rightarrow$
  & \ruby[g]{$B>.H7(B}{$B$3$P$H(B}
  & \ruby[g]{$Bs5ry(B}{$B$;$-$l$$(B}
  & \ruby[g]{$BMkD;(B}{$B$i$$$A$g$&(B}
  & \ruby[g]{$B1m(B}{$B$D$P$a(B}
\\
Jukugo & (\verb+\ruby[j]{$B>.H7(B}{$B$3(B|$B$P$H(B}+) & $\rightarrow$
  & \ruby[j]{$B>.H7(B}{$B$3(B|$B$P$H(B}
  & \ruby[j]{$Bs5ry(B}{$B$;$-(B|$B$l$$(B}
  & \ruby[j]{$BMkD;(B}{$B$i$$(B|$B$A$g$&(B}
  & \ruby[j]{$B1m(B}{$B$D$P$a(B}
\end{tabular}\end{quote}
Usually When a jukugo has per-character reading then jukugo ruby
(\Opt{j}) is preferred, otherwise (\Opt{g}) is.
If you particularly intend to show the per-character reading
for a jukugo, you might use the \Opt{m} option.
Note that all of \Opt{m}, \Opt{g} and \Opt{j} lead to
the same result for ruby to a single kanji.
\item You can give a default value of option
using the \verb+\rubysetup+ command;
\verb+\rubysetup{g}\ruby{$B737\(B}{$B$7$c$b(B}+ is
equivalent to \verb+\ruby[g]{$B737\(B}{$B$7$c$b(B}+.
The ``default of default'' is \Opt{|cjPeF|}.
\end{itemize}

\subsection{Intrusion/Protrusion}

\begin{itemize}
\item Control of ruby intrusion:
\begin{center}\begin{tabular}{ll@{\ }l@{\ }c*2{@{\quad}c}}
No intrusion & \verb+$B$3$N(B\ruby[|-|]{$Bs'(B}{$B$+$5$5$.(B}$B$N(B+ & $\rightarrow$
 & $B$3$N(B\ruby[|-|]{$Bs'(B}{$B$+$5$5$.(B}$B$N(B
 & $B$3$N(B\ruby[|-|]{$BsA(B}{$B$3$&$N$H$j(B}$B$N(B
 & $B$3$N(B\ruby[|-|]{$B1-(B}{$B$&(B}$B$N(B
\\
Small intrusion & \verb+$B$3$N(B\ruby[(-)]{$Bs'(B}{$B$+$5$5$.(B}$B$N(B+ & $\rightarrow$
 & $B$3$N(B\ruby[(-)]{$Bs'(B}{$B$+$5$5$.(B}$B$N(B
 & $B$3$N(B\ruby[(-)]{$BsA(B}{$B$3$&$N$H$j(B}$B$N(B
 & $B$3$N(B\ruby[(-)]{$B1-(B}{$B$&(B}$B$N(B
\\
Big intrusion & \verb+$B$3$N(B\ruby[<->]{$Bs'(B}{$B$+$5$5$.(B}$B$N(B+ & $\rightarrow$
 & $B$3$N(B\ruby[<->]{$Bs'(B}{$B$+$5$5$.(B}$B$N(B
 & $B$3$N(B\ruby[<->]{$BsA(B}{$B$3$&$N$H$j(B}$B$N(B
 & $B$3$N(B\ruby[<->]{$B1-(B}{$B$&(B}$B$N(B
\end{tabular}\end{center}
\item If you require ``ruby output may intrude to kana but not to kanji,''
then you might want to do ``\verb+$B$3$N(B\ruby[<-|]{$Bs'(B}{$B$+$5$5$.(B}$BEy(B+''
to get ``$B$3$N(B\ruby[<-|]{$Bs'(B}{$B$+$5$5$.(B}$BEy(B.''
\item To specify a basic mode (\Opt{m}/\Opt{g}/\Opt{j})
and intrusion at a time, you can use option strings
such as \Opt{|g|} and \Opt{|m>}.
In fact, the symbol \Opt{-} works as placeholder
for basic mode and means the use of default value.
\item Control of ruby protrusion:
the string \Opt{||} supresses the protrusion.
\begin{quote}
\begin{lrbox}{\myexample}
\small$\leftarrow$ \verb+\ruby[||->]{$B?}(B}{$B$9$:$a(B}+
\end{lrbox}
\fbox{\parbox{.42\linewidth}{%
\ruby[||->]{$B?}(B}{$B$9$:$a(B}$B$N!D(B
\quad \usebox{\myexample}%
\rule{0pt}{12pt}\\
$B%$%s%3$N(B
}}\quad vs.\quad
\begin{lrbox}{\myexample}
\small$\leftarrow$ \verb+\ruby[|->]{$B?}(B}{$B$9$:$a(B}+
\end{lrbox}
\fbox{\parbox{.42\linewidth}{%
\ruby[|->]{$B?}(B}{$B$9$:$a(B}$B$N!D(B
\quad \usebox{\myexample}%
\rule{0pt}{12pt}\\
$B%$%s%3$N(B
}}
\end{quote}
\end{itemize}

\subsection{More Commands}

\begin{itemize}
\item \verb+\aruby+: attaches ruby to an alphabet (non-CJK) string.
\par\noindent\Eg\quad
\verb+\aruby{Get out}{$B%2%i%&%C(B}!+ $\rightarrow$
  \aruby{Get out}{$B%2%i%&%C(B}!
\item \verb+\rubyfontsetup+: specifies the font used for ruby output.
For example, when you want to attach mincho-font ruby
to gothic-font kanji string you can do as follows:
\par\noindent
{\small
\verb+\rubyfontsetup{\mcfamily}$B$3$N(B{\gtfamily \ruby[j]{$BL@D+BN(B}{$B$_$s(B|$B$A$g$&(B|$B$?$$(B}}+}
$\rightarrow$
{\rubyfontsetup{\mcfamily}$B$3$N(B{\gtfamily \ruby[j]{$BL@D+BN(B}{$B$_$s(B|$B$A$g$&(B|$B$?$$(B}}}
\end{itemize}

\end{document}