<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%% Copyright 2022 Yuanhao Chen
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
% 
% The Current Maintainer of this work is Yuanhao Chen.
%
% This work consists of the files kanbun.sty, kanbun.lua,
% kanbun-example.tex and kanbun.tex.
% 
\documentclass[12pt]{ltxdockit}

\AfterTOCHead[toc]{\sffamily}
\makeatletter
  \def\@seccntformat#1{\protect\makebox[0pt][r]{\csname the#1\endcsname\hspace{\marglistsep}}}
\makeatother

\usepackage{fancyvrb}
\DefineShortVerb{\|}

\lstnewenvironment{example}[1][]
    {\lstset{
        basicstyle=\ja{\linespread{1}}\ttfamily,
        frame=single,
        columns=fullflexible,
        language=[LaTeX]TeX,
        moretexcs={
            Kanbun,
            EndKanbun,
            printkanbun,
            printkanbuncode,
            kanbunfont,
            furiokuri,
            multifuriokuri,
            ExplSyntaxOn,
            ExplSyntaxOff,
            kanjiunit,
            setkanbun,
        }
    }}
    {}

\usepackage{luatexja}
    \ltjdefcharrange{10}{"2E3A}
    \ltjdefcharrange{11}{"2039-"203A}
    \ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, -8, +9, +10, -11}}
\usepackage[match]{luatexja-fontspec}
\en{\defaultfontfeatures{Numbers=OldStyle, Scale=MatchLowercase}}
\ja{\defaultfontfeatures{Scale=MatchLowercase}}
\defaultjfontfeatures{Scale=MatchLowercase, YokoFeatures={JFM=ja_JP/{kaiming,prop}, RawFeature={+pkna,+kern}}}
\setmainjfont[BoldFont={*-D}]{FOT-TsukuMin Pr6N}
\setsansjfont{Sarasa Mono J}
\setmonojfont[Scale=MatchLowercase, YokoFeatures={JFM=prop, RawFeature={+kern}}]{Sarasa Mono J}
\setmainfont{Minion Pro}
\setsansfont{Myriad Pro}
\setmonofont{Sarasa Mono J}

\ja{
    \parindent=1\zw
    \renewcommand{\baselinestretch}{1.2}
}

\usepackage{luatexja-ruby}
    \ltjsetruby{
        fontcmd=\addjfontfeature{
                YokoFeatures={RawFeature={-pkna,+ruby}},
                TateFeatures={RawFeature={-pkna,+ruby}},
            },
        mode=7,
    }

\usepackage[
    rubyfontcmd=\addjfontfeature{
            YokoFeatures={RawFeature={-pkna,+ruby}},
            TateFeatures={RawFeature={-pkna,+ruby}},
        },
]{kanbun}
\newcommand{\printkanbunblock}[2]{
    {
        \parindent=0pt
        \ja{\linespread{1}}
        \vspace*{1\zw}
        \hfill
        \vbox{
            \hsize=#1\zw
            {
                \tate
                \addjfontfeature{Scale=1}
                #2
            }
        }
        \hfill
        \vspace*{1\zw}
    }
}

\usepackage{bxtexlogo}
\usepackage{realscripts}
\usepackage{microtype}

\usepackage{wallpaper}

\Kanbun
ä»¥ãƒ†[äºŒ]ç¾…(ã‚‰)è¶(ã¦ãµ)ãƒ²[ä¸€]ä½œãƒ«ã‚¬[äºŒ]æ¼¢æ–‡è¨“èª­ãƒ²[ä¸€]ç”¨(ãŸã‚)ãƒŽåŒ…(ã±ã¤ã‘ãƒ¼ã¢)
\EndKanbun
\title{\en{The \sty{kanbun} package}\ja{\sty{kanbun}ãƒ‘ãƒƒã‚±ãƒ¼ã‚¸}}
\subtitle{\normalsize\normalfont\addjfontfeature{Scale=1}\printkanbun}
\author{
    \en{Yuanhao Chen (\ruby[rubysmash=true]{é™³|å…ƒ|éŽ¬}{ã¡ã‚“|ã’ã‚“|ã“ã†})}
    \ja{
        \ruby[rubysmash=true]{é™³|å…ƒ|éŽ¬}{ã¡ã‚“|ã’ã‚“|ã“ã†} (Yuanhao Chen) 
        \footnote{æ—¥æœ¬äººã§ã¯ãªã„ã®ã§ã€æ—¥æœ¬èªžãƒã‚¤ãƒ†ã‚£ãƒ´ã®æ–¹ãŒã„ã‚‰ã£ã—ã‚ƒã‚Œã°ãƒžãƒ‹ãƒ¥ã‚¢ãƒ«ã‚’æ›¸ãç›´ã—ã¦ä¸‹ã•ã‚‹ã¨å¬‰ã—ã„ã€‚}
    }
}
\date{
    \en{\scshape 13 february 2022, v1.2}
    \ja{2022å¹´2æœˆ13æ—¥, v1.2}
}


\begin{document}

\ThisCenterWallPaper{1}{kanbun-example.pdf}
\ExplSyntaxOn
\tl_set:Nn \kanbun_kumi { beta }
\ExplSyntaxOff
\maketitle
\ja{\renewcommand{\contentsname}{ç›®æ¬¡}}
\tableofcontents


\section{\en{Introduction}\ja{ã¯ã˜ã‚ã«}}
\en{The \sty{kanbun} package, like other \emph{kanbun-kundoku} (æ¼¢æ–‡è¨“èª­) \LaTeX{} packages (such as \sty{gckanbun}), allows users to manually input macros for elements in a \emph{kanbun-kundoku} paragraph.}
\ja{\sty{kanbun}ãƒ‘ãƒƒã‚±ãƒ¼ã‚¸ã§ã¯ä»–ã®æ¼¢æ–‡è¨“èª­ã®\LaTeX{}ãƒ‘ãƒƒã‚±ãƒ¼ã‚¸ï¼ˆä¾‹ãˆã° \sty{gckanbun}ï¼‰ã¨åŒã˜ãã€æ‰‹å‹•ã§æ¼¢æ–‡è¨“èª­ã®å„è¦ç´&nbsp;ã«å¯¾å¿œã™ã‚‹ãƒžã‚¯ãƒ­ã‚’å…¥åŠ›ã§ãã‚‹ã€‚}

\en{More importantly, it accepts input with light markup in the ``\emph{kanbun} annotation'' form when used with \LuaLaTeX, which allows typesetting \emph{kanbun-kundoku} paragraphs efficiently\footnote{The idea comes from \href{https://phesoca.com/kanbun-html/}{æ¼¢æ–‡\textsc{html}} by UntPhesoca, which is a JavaScript and \textsc{css} implementation.}.}
\ja{æ›´ã«é‡è¦ãªã“ã¨ã«ã¯ã€ \LuaLaTeX{}ã§å®Ÿè¡Œã™ã‚Œã°ã€è»½é‡ãƒžãƒ¼ã‚¯ã‚¢ãƒƒãƒ—ã®ã€Œæ¼¢æ–‡ã‚¢ãƒŽãƒ†ãƒ¼ã‚·ãƒ§ãƒ³ã€ã§å®¹æ˜“ãåŠ¹çŽ‡çš„ã«æ¼¢æ–‡è¨“èª­ã‚’çµ„ç‰ˆã™ã‚‹ã“ã¨ãŒå¯èƒ½ã¨ãªã£ã¦ã„ã‚‹\footnote{JavaScriptã‚„CSSã«ã‚ˆã£ã¦å®Ÿè¡Œã™ã‚‹UntPhesocaã® \href{https://phesoca.com/kanbun-html/}{æ¼¢æ–‡HTML} ãŒå‚è€ƒã¨ãªã£ã¦ã„ãŸã€‚}ã€‚}


\section{\en{Basic example with \LuaLaTeX}\ja{\LuaLaTeX{}ã§ã®ç°¡å˜ãªå®Ÿä¾‹}}
\en{As seen in the following example, typesetting a \emph{kanbun-kundoku} paragraph with the \sty{kanbun} package requires only light annotations --- it automatically transforms the annotated plain text into \LaTeX{} macros through Lua, rather than having users type in macros themselves.}
\ja{æ¬¡ã®å®Ÿä¾‹ã®ã¨ãŠã‚Šã€ \sty{kanbun}ãƒ‘ãƒƒã‚±ãƒ¼ã‚¸ã‚’ä½¿ãˆã°ãŸã&nbsp;ã®è»½é‡ãªã‚¢ãƒŽãƒ†ãƒ¼ã‚·ãƒ§ãƒ³ã§æ¼¢æ–‡è¨“èª­ã‚’çµ„ç‰ˆã§ãã‚‹ã€‚æ‰‹å‹•ã§ãƒžã‚¯ãƒ­ã‚’å…¥åŠ›ã™ã‚‹ã§ã¯ãªãã€ãƒ—ãƒ­ã‚°ãƒ©ãƒ&nbsp;ãŒè‡ªå‹•çš„ã«ã‚¢ãƒŽãƒ†ãƒ¼ã‚·ãƒ§ãƒ³ã®ã‚ã‚‹ãƒ—ãƒ¬ãƒ¼ãƒ³ãƒ†ã‚­ã‚¹ãƒˆã‚’Luaã§å‡¦ç†ã—ã¦\LaTeX{}ãƒžã‚¯ãƒ­ã«å¤‰æ›´ã™ã‚‹ã€‚}

\begin{example}
\documentclass{ltjtarticle}
\usepackage[kumi=aki, tateaki=1]{kanbun}
\begin{document}
\Kanbun
æœˆè½ãƒçƒå•¼ã‚­ãƒ†éœœæº€ãƒ„[ãƒ¬]å¤©ãƒ‹ï¼Œ
æ±Ÿæ¥“æ¼ç«å¯¾ã‚¹[äºŒ]æ„çœ&nbsp;ãƒ‹[ä¸€]ã€‚
å§‘(ã“)è˜‡(ã)åŸŽå¤–ãƒŽå¯’å±±å¯ºï¼Œ
å¤œåŠãƒŽé˜å£°åˆ°ãƒ«[äºŒ]å®¢èˆ¹ãƒ‹[ä¸€]ã€‚
\EndKanbun
\printkanbun
\end{document}
\end{example}

\ExplSyntaxOn
\tl_set:Nn \kanbun_tateaki { 1 }
\tl_set:Nn \kanbun_kumi { aki }
\ExplSyntaxOff
\Kanbun
æœˆè½ãƒçƒå•¼ã‚­ãƒ†éœœæº€ãƒ„[ãƒ¬]å¤©ãƒ‹ï¼Œ
æ±Ÿæ¥“æ¼ç«å¯¾ã‚¹[äºŒ]æ„çœ&nbsp;ãƒ‹[ä¸€]ã€‚
å§‘(ã“)è˜‡(ã)åŸŽå¤–ãƒŽå¯’å±±å¯ºï¼Œ
å¤œåŠãƒŽé˜å£°åˆ°ãƒ«[äºŒ]å®¢èˆ¹ãƒ‹[ä¸€]ã€‚
\EndKanbun

\allowbreak
\printkanbunblock{13}{\printkanbun}
\vspace{-1.5\zw}

\en{Note that if you want to use this functionality, you have to run this document with \LuaLaTeX.}
\ja{ã“ã®æ©Ÿèƒ½ã‚’ä½¿ã†å&nbsp;´åˆã€å¿…ãš\LuaLaTeX{}ã§å®Ÿè¡Œã—ã¦ãã&nbsp;ã•ã„ã€‚}


\section{\en{Usage}\ja{ä½¿ç”¨æ–¹æ³•}}

\subsection{\en{Package options}\ja{ãƒ‘ãƒƒã‚±ãƒ¼ã‚¸ã®ã‚ªãƒ—ã‚·ãƒ§ãƒ³}}
\en{Load the package with}
\ja{ãƒ‘ãƒƒã‚±ãƒ¼ã‚¸ã®èª­ã¿è¾¼ã¿ã¯æ¬¡ã®ã‚ˆã†ã«ã—ã¦ã‚ˆã„ï¼š}
\nobreak
\begin{ltxsyntax}
    \cmditem{usepackage}\oprm{\en{\sty{kanbun} options}\ja{ \sty{kanbun}ã®ã‚ªãƒ—ã‚·ãƒ§ãƒ³}}|{kanbun}|
\end{ltxsyntax}

\en{This package provides a variety of customisable features in \emph{kanbun-kundoku}.}
\ja{ä»¥ä¸‹ã®ã‚ªãƒ—ã‚·ãƒ§ãƒ³ã§ã•ã¾ã–ã¾ãªæ¼¢æ–‡è¨“èª­ã«ãŠã„ã¦ã®ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ãƒ¼ã‚’è¨­å®šã§ãã‚‹ã€‚}

\begin{optionlist}
    \optitem[]{scale}{\prm{\en{ratio}\ja{æ¯”}}}
    \en{Sets the ratio of the size of \emph{kanji} to that of ruby texts. Default: \verb|2|.}
    \ja{ãƒ«ãƒ“æ–‡å­—ã®ã‚µã‚¤ã‚ºã«å¯¾ã™ã‚‹æ¼¢å­—ã®ã‚µã‚¤ã‚ºã®å‰²åˆã‚’è¨­å®šã™ã‚‹ã€‚åˆæœŸå€¤ï¼š \verb|2|ã€‚}
    
    \SaveVerb{fontcmd}|\addjfontfeatures{RawFeature={+trad}}|
    \optitem[]{fontcmd}{\prm{\en{font command}\ja{æ›¸ä½“ã®ã‚³ãƒžãƒ³ãƒ‰}}}
    \en{Sets the font command to use for \emph{kanji}. If \sty{luatexja-fontspec} is loaded, it is set default to \UseVerb{fontcmd} to obtain traditional \emph{kanji} if applicable.}
    \ja{æ¼¢å­—ã®æ›¸ä½“ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’è¨­å®šã™ã‚‹ã€‚\sty{luatexja-fontspec}ãƒ‘ãƒƒã‚±ãƒ¼ã‚¸ãŒèª­ã¿è¾¼ã¾ã‚Œã¦ã‚ã‚‹å&nbsp;´åˆã€ \UseVerb{fontcmd} ã«åˆæœŸåŒ–ã•ã‚Œã¦ã€æ—§å­—ä½“ã®ã‚°ãƒªãƒ•ã«å¤‰æ›´ã™ã‚‹ã€‚}

    \SaveVerb{rubyfontcmd}|\addjfontfeatures{RawFeature={+ruby}}|
    \optitem[]{rubyfontcmd}{\prm{\en{font command}\ja{æ›¸ä½“ã®ã‚³ãƒžãƒ³ãƒ‰}}}
    \en{Sets the font command to use for ruby texts. If \sty{luatexja-fontspec} is loaded, it is set default to \UseVerb{rubyfontcmd} to obtain ruby glyphs when applicable.}
    \ja{ãƒ«ãƒ“æ–‡å­—ã®æ›¸ä½“ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’è¨­å®šã™ã‚‹ã€‚\sty{luatexja-fontspec}ãƒ‘ãƒƒã‚±ãƒ¼ã‚¸ãŒèª­ã¿è¾¼ã¾ã‚Œã¦ã‚ã‚‹å&nbsp;´åˆã€ \UseVerb{rubyfontcmd} ã«åˆæœŸåŒ–ã•ã‚Œã¦ã€ãƒ«ãƒ“ã‚°ãƒªãƒ•ã«å¤‰æ›´ã™ã‚‹ã€‚}

    \SaveVerb{unit}|\kanbun_init_zw|
    \optitem[]{unit}{\prm{\en{length}\ja{é•·ã•}}}
    \en{Sets the dimensions of \emph{kanji} (assuming it is a square). Default: \UseVerb{unit}, which is a length equal to \verb|1em|.}
    \ja{ï¼ˆæ­£æ–¹å½¢ã&nbsp;ã¨ä»®å®šã—ã¦ï¼‰æ¼¢å­—ã®å¯¸æ³•ã‚’è¨­å®šã™ã‚‹ã€‚åˆæœŸå€¤ï¼š \UseVerb{unit} ï¼ˆ\verb|1em| ã«ç­‰ã—ã„é•·ã•ï¼‰ã€‚}

    \optitem[]{yokoaki}{\prm{\en{ratio}\ja{æ¯”}}}
    \en{Sets the horizontal space between \emph{kanji} with respect to the size of ruby texts. Default: \verb|2|.}
    \ja{ãƒ«ãƒ“æ–‡å­—ã®ã‚µã‚¤ã‚ºã«å¯¾ã™ã‚‹ã‚¤ãƒ³ãƒ†ãƒ«ã®å¹…ã®å‰²åˆã‚’è¨­å®šã™ã‚‹ã€‚åˆæœŸå€¤ï¼š \verb|2|ã€‚}

    \optitem[]{tateaki}{\prm{\en{ratio}\ja{æ¯”}}}
    \en{Sets the vertical space between \emph{kanji} with respect to the size of ruby texts. Default: \verb|2|.}
    \ja{ãƒ«ãƒ“æ–‡å­—ã®ã‚µã‚¤ã‚ºã«å¯¾ã™ã‚‹æ¼¢å­—é–“ã®ã‚¢ã‚­é‡ã®å‰²åˆã‚’è¨­å®šã™ã‚‹ã€‚åˆæœŸå€¤ï¼š \verb|2|ã€‚}

    \optitem[]{okuriintrusion}{\prm{\en{ratio}\ja{æ¯”}}}
    \en{Sets the intrusion of \emph{okurigana} (how much \emph{okurigana} should be vertically tucked into the space of \emph{kanji}) with respect to the size of ruby texts, if that does not cause an overlap with \emph{furigana}. Default: \verb|1|.}
    \ja{ãƒ«ãƒ“æ–‡å­—ã®ã‚µã‚¤ã‚ºã«å¯¾ã™ã‚‹é€ä»®å\ruby[pre=0.5,post=1]{é€²å…¥é‡}{ã‚¤ãƒ³ãƒˆãƒ«ãƒ¼ã‚¸ãƒ§ãƒ³}ï¼ˆé€ä»®åã‚’ä¸Šã«çªã‹ã›ã¦æ¼¢å­—ã«æŽ›ã‘ã‚‹é•·ã•ï¼‰ã®å‰²åˆã‚’è¨­å®šã™ã‚‹ã€‚åˆæœŸå€¤ï¼š \verb|1|ã€‚}

    \optitem[]{kumi}{\opt{aki}, \opt{beta}}
    \en{Sets whether to use \emph{aki-gumi} (typeset with uniform inter-character spacing) or \emph{beta-gumi} (typeset with no inter-character space between adjacent character frames). Or simply call \opt{aki} or \opt{beta} without \opt{kumi=}. Default: \opt{aki}. }
    \ja{ã‚¢ã‚­çµ„ã‚’ä½¿ã†ã‹ãƒ™ã‚¿çµ„ã‚’ä½¿ã†ã‹ã‚’è¨­å®šã™ã‚‹ã€‚\opt{kumi=} ã‚’æ›¸ã‹ãšã€å˜ã« \opt{aki} ã‹ \opt{beta} ã‹ã¨æ›¸ã„ã¦ã‚‚ã‚ˆã„ã€‚}
\end{optionlist}

\SaveVerb{kanbunprefix}|\kanbun_|
\en{After initialising the options, you can still change the option values through the command \cmd{setkanbun}. For example, to switch to \emph{beta-gumi}, you could use}
\ja{ã‚ªãƒ—ã‚·ãƒ§ãƒ³ã‚’åˆæœŸåŒ–ã™ã‚‹å¾Œã§ã‚‚ã€ \cmd{setkanbun} ã‚’ä½¿ã£ã¦ã‚ªãƒ—ã‚·ãƒ§ãƒ³ã‚’å¤‰æ›´ã§ãã‚‹ã€‚ä¾‹ãˆã°ã€ãƒ™ã‚¿çµ„ã«å†è¨­å®šã™ã‚‹ã«ã¯ä¸‹è¨˜ã®ã‚³ãƒ¼ãƒ‰ã‚’ä½¿ã†ã€‚}
\begin{example}
\setkanbun{beta}
\end{example}

\subsection[\en{Basic usage without \LuaLaTeX}\ja{\LuaLaTeX{}ã‚’ä½¿ã‚ãªã„å&nbsp;´åˆã®åŸºæœ¬ä½¿ç”¨}]{\en{Basic usage without \LuaLaTeX{} (not recommended)}\ja{\LuaLaTeX{}ã‚’ä½¿ã‚ãªã„å&nbsp;´åˆã®åŸºæœ¬ä½¿ç”¨ï¼ˆãŠè–¦ã‚ã§ã¯ãªã„ï¼‰}}
\en{When not using the advanced \emph{kanbun}-annotation functionality, it is possible to typeset \emph{kanbun} with any engine with \textsc{cjk} support, such as using \XeLaTeX{} with the \sty{xeCJK} package, or using \upLaTeX{} with \sty{utarticle} or other appropriate class. }
\ja{æ¼¢æ–‡ã‚¢ãƒŽãƒ†ãƒ¼ã‚·ãƒ§ãƒ³ã®æ©Ÿèƒ½ã‚’ä½¿ã‚ãªã„å&nbsp;´åˆã€ä»»æ„ã® CJK æ”¯æ´ã®ã‚ã‚‹ã‚¨ãƒ³ã‚¸ãƒ³ã§æ¼¢æ–‡ã‚’çµ„ç‰ˆã§ãã‚‹ã€‚ä¾‹ãˆã°\XeLaTeX{} ã‚’ \sty{xeCJK} ãƒ‘ãƒƒã‚±ãƒ¼ã‚¸ã¨ä¸€ç·’ã«ä½¿ã†ã‹ã€ \upLaTeX{} ã‚’ \sty{utarticle} ã‚¯ãƒ©ã‚¹æˆ–ã„ã¯ä»–ã®é©å®œãªã‚¯ãƒ©ã‚¹ã¨ä¸€ç·’ã«ä½¿ã†ã‹ã€ã©ã¡ã‚‰ã‚‚ã‚ˆã„ã€‚}

\begin{ltxsyntax}
    \cmditem{kanjiunit}\verb|{ |\cmd{furiokuri}\mprm{\en{right furigana}\ja{å³ã®æŒ¯ä»®å}}\mprm{\en{right okurigana}\ja{å³ã®é€ä»®å}}\verb| }|\vspace{-5pt}\\
    \mprm{\en{left (top) punctuation (e.g.~`ã€Œ')}\ja{å·¦ï¼ˆä¸Šï¼‰ã®å¥èª­ç‚¹ï¼ˆâ€œã€Œâ€ãªã©ï¼‰}}\\
    \mprm{\en{kanji}\ja{æ¼¢å­—}}\\
    \mprm{\en{other punctuation}\ja{ä»–ã®å¥èª­ç‚¹}}\\
    \mprm{\en{kaeriten}\ja{è¿”ç‚¹}}\\
    \verb|{ |\cmd{furiokuri}\mprm{\en{left furigana}\ja{å·¦ã®æŒ¯ä»®å}}\mprm{\en{left okurigana}\ja{å·¦ã®é€ä»®å}}\verb| }|

    \cmditem{kanbunfont}

    \en{Sets the font size of \emph{kanji}. Use when the \opt{unit} option is set different to the document's default font size.}
    \ja{æ¼¢å­—ã®ã‚µã‚¤ã‚ºã‚’è¨­å®šã™ã‚‹ã€‚\opt{unit} ã‚ªãƒ—ã‚·ãƒ§ãƒ³ã¨æ–‡æ›¸ã®ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆæ–‡å­—ã‚µã‚¤ã‚ºãŒé•ã†æ™‚ã«ä½¿ã†ã€‚}

    \en{Use \cmd{multifuriokuri} instead of \cmd{furiokuri} if you are putting \emph{furigana} to multiple kanji.}
    \ja{è¤‡æ•°å€‹ã®æ¼¢å­—ã«ä»®åã‚’æŒ¯ã‚Œã°ã€ \cmd{furiokuri} ã®ä»£ã‚ã‚Šã« \cmd{multifuriokuri} ã‚’ä½¿ã†ã€‚}

    \cmditem{multifuriokuri}\oprm{\en{length by which ruby is raised}\ja{ãƒ«ãƒ“æ–‡å­—ã‚’ä¸Šã’ã‚‹é•·ã•}}\mprm{\en{furigana}\ja{æŒ¯ä»®å}}\mprm{\en{okurigana}\ja{é€ä»®å}}
\end{ltxsyntax}

\en{For example, the code}
\ja{ä¾‹ãˆã°ã€ \opt{tateaki} ãŒ \verb|1| ã«è¨­å®šã•ã‚Œã¦ã„ã‚‹å&nbsp;´åˆã€ä¸‹è¨˜ã®ã‚³ãƒ¼ãƒ‰ã‚’ä½¿ãˆã°}
\begin{example}
% example text from https://phesoca.com/kanbun-html/
\kanbunfont
\kanjiunit{}{}{å­}{}{}{}
\kanjiunit{\furiokuri{}{ã‚¯}}{}{æ›°}{ï¼Œ}{}{}
\kanjiunit{\furiokuri{}{ã‚¾}}{}{ç›}{}{ä¸‰}{\furiokuri{}{ãƒ«}}
\kanjiunit{}{}{å„}{ã€»}{}{}
\kanjiunit{\furiokuri{}{ãƒ}}{}{è¨€}{}{äºŒ}{}
\kanjiunit{\furiokuri{}{ãƒŽ}}{}{çˆ¾}{}{}{}
\kanjiunit{\furiokuri{}{ãƒ²}}{}{å¿—}{ã€‚}{ä¸€}{}
\par
\end{example}
\en{outputs}
\ja{ã“ã†å‡ºåŠ›ã™ã‚‹ï¼š}

\printkanbunblock{6}{
\kanbunfont
\kanjiunit{}{}{å­}{}{}{}
\kanjiunit{\furiokuri{}{ã‚¯}}{}{æ›°}{ï¼Œ}{}{}
\kanjiunit{\furiokuri{}{ã‚¾}}{}{ç›}{}{ä¸‰}{\furiokuri{}{ãƒ«}}
\kanjiunit{}{}{å„}{ã€»}{}{}
\kanjiunit{\furiokuri{}{ãƒ}}{}{è¨€}{}{äºŒ}{}
\kanjiunit{\furiokuri{}{ãƒŽ}}{}{çˆ¾}{}{}{}
\kanjiunit{\furiokuri{}{ãƒ²}}{}{å¿—}{ã€‚}{ä¸€}{}
\par
}

\noindent
\en{with \opt{tateaki} set to \verb|1|.}

\subsection{\en{Usage with \LuaLaTeX}\ja{\LuaLaTeX{}ã§ã®ä½¿ç”¨}}
\en{\emph{Kanbun} annotation uses the following brackets to mark different elements in \emph{kanbun-kundoku} (as described in \href{https://phesoca.com/kanbun-html/}{æ¼¢æ–‡\textsc{html}} by UntPhesoca). }
\ja{æ¼¢æ–‡ã‚¢ãƒŽãƒ†ãƒ¼ã‚·ãƒ§ãƒ³ã§ã¯ä¸‹è¨˜ã®æ‹¬å¼§ã‚’ä»¥ã£ã¦æ¼¢æ–‡è¨“èª­ã«ãŠã„ã¦ã®å„è¦ç´&nbsp;ã‚’ç¤ºã™ï¼ˆUntPhesocaã® \href{https://phesoca.com/kanbun-html/}{æ¼¢æ–‡HTML} ã‚’å‚ç…§ã•ã‚ŒãŸã„ï¼‰ã€‚}
\begin{itemize}
    \item \verb|( )|: \en{\emph{furigana} (}æŒ¯ä»®å\en{)}
    \item \verb|{ }|: \en{\emph{okurigana} (}é€ä»®å\en{) (these brackets can be omitted)}\ja{ï¼ˆã“ã®æ‹¬å¼§ã‚’çœç•¥ã—ã¦ã‚‚ã‚ˆã„ï¼‰}
    \item \verb|â€¹ â€º|: \en{\emph{furigana} (æŒ¯ä»®å) of \emph{saidoku-moji} (å†èª­æ–‡å­—)}\ja{å†èª­æ–‡å­—ã®æŒ¯ä»®å}
    \item \verb|Â« Â»|: \en{\emph{okurigana} (é€ä»®å) of \emph{saidoku-moji} (å†èª­æ–‡å­—)}\ja{å†èª­æ–‡å­—ã®é€ä»®å}
    \item \verb|[ ]|: \en{\emph{kaeriten} (}è¿”ç‚¹\en{)}
    \item \verb|â€˜ â€™|: \en{multiple \emph{kanji}, potentially with \emph{tateten} inserted, as a ruby base; group ruby (ã‚°ãƒ«ãƒ¼ãƒ—ãƒ«ãƒ“)}\ja{ã‚°ãƒ«ãƒ¼ãƒ—ãƒ«ãƒ“ã®ãƒ™ãƒ¼ã‚¹ã€‚ä¸­ã«\ruby{ç«ª|ç‚¹}{ãŸã¦|ã¦ã‚“}ã‚’å…¥ã‚Œã¦ã‚‚ã‚ˆã„}
    \item \en{no annotation: \emph{kanji} (æ¼¢å­—) and punctuation}\ja{ã‚¢ãƒŽãƒ†ãƒ¼ã‚·ãƒ§ãƒ³ç„¡ã—ï¼šæ¼¢å­—ã¨å¥èª­ç‚¹}
\end{itemize}
\en{\emph{Tateten} (ç«ªç‚¹) can be input with either \verb|â€•| (\verb|U+2015|), \verb|â€”| (\verb|U+2014|) or \verb|ã†| (\verb|U+3190|).}
\ja{\verb|â€•| (\verb|U+2015|) ã‹ \verb|â€”| (\verb|U+2014|) ã‹ \verb|ã†| (\verb|U+3190|) ã‹ã§ç«ªç‚¹ã‚’å…¥åŠ›ã§ãã‚‹ã€‚}

\begin{ltxsyntax}
    \cmditem{Kanbun}\cmditem{EndKanbun}

    \en{Write the annotated \emph{kanbun} between the commands \cmd{Kanbun} and \cmd{EndKanbun}, and it will be processed and saved, ready to be used later.}
    \ja{ã‚¢ãƒŽãƒ†ãƒ¼ã‚·ãƒ§ãƒ³ã®ã‚ã‚‹æ¼¢æ–‡ã‚’ \cmd{Kanbun} ã¨ \cmd{EndKanbun} ã®é–“ã«æ›¸ãè¾¼ã‚€ã€‚å‡¦ç†ã•ã‚Œã¦ã€ä¿å­˜ã•ã‚Œã¦ãŠã„ã¦ã€å¾Œã§ä½¿ç”¨å¯èƒ½ã¨ãªã‚‹ã€‚}

    \cmditem{printkanbun}

    \en{Where you would like to use the most recently saved \emph{kanbun-kundoku} paragraph, use \cmd{printkanbun}. It automatically calls \cmd{kanbunfont} and \cmd{par} to set the font size and line spacing and make paragraphs.}
    \ja{æœ€è¿‘ä¿å­˜ã•ã‚ŒãŸæ¼¢æ–‡è¨“èª­ã‚’ä½¿ç”¨ã™ã‚‹ã«ã¯ã€ \cmd{printkanbun} ã‚’ä½¿ã†ã€‚è‡ªå‹•çš„ã« \cmd{kanbunfont} ã¨ \cmd{par} ã‚’æŒ¿å…¥ã—ã¦å¯¸æ³•ã‚„ã‚¤ãƒ³ãƒ†ãƒ«ã‚’è¨­å®šã—ã€æ®µè½ã‚’ä½œæˆã™ã‚‹ã€‚}

    \cmditem{printkanbuncode}

    \en{If you wish to make modifications on the result or to use the result with a non-\LuaTeX{} engine, it is possible to obtain the macros using \cmd{printkanbuncode} (prints in the terminal), and continue to work from there.}
    \ja{å‡¦ç†ã®çµæžœã‚’ä¸€éƒ¨å¤‰æ›´ã™ã‚‹ã€ã‚‚ã—ãã¯çµæžœã‚’\LuaTeX{}ã§ãªã„ã‚¨ãƒ³ã‚¸ãƒ³ã§ä½¿ç”¨ã™ã‚‹ã«ã¯ã€çµæžœã®ãƒžã‚¯ãƒ­ã‚’ \cmd{printkanbuncode} ã§å…¥æ‰‹ã—ã¦ï¼ˆç«¯æœ«ã«å‡ºåŠ›ï¼‰ã€ãã“ã‹ã‚‰ä½œæ¥­ã‚’ç¶šã‘ã‚‹ã“ã¨ãŒå¯èƒ½ã€‚}

    \cmditem{printkanbunnopar}

    \en{The no-paragraph counterpart of \cmd{printkanbun}, which does not invoke \cmd{kanbunfont}, and uses \verb|\\| instead of \cmd{par}.}
    \ja{\cmd{printkanbun} ã«å¯¾å¿œã™ã‚‹æ®µè½ç„¡ã—ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã€‚\cmd{kanbunfont}ã‚’ä½¿ç”¨ã›ãšã€ \cmd{par} ã®ä»£ã‚ã‚Šã« \verb|\\| ã‚’ä½¿ç”¨ã™ã‚‹ã€‚}

    \cmditem{printkanbunnoparcode}

    \en{The no-paragraph counterpart of \cmd{printkanbuncode}.}
    \ja{\cmd{printkanbuncode} ã«å¯¾å¿œã™ã‚‹æ®µè½ç„¡ã—ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã€‚}
\end{ltxsyntax}

\en{You can always save \cmd{printkanbun} to a macro for use later and start a new annotated \emph{kanbun} block, as in the following example.}
\ja{æ¬¡ã®å®Ÿä¾‹ã®ã¨ãŠã‚Šã€å¾Œã§ä½¿ãˆã‚‹ã‚ˆã†ã« \cmd{printkanbun} ã‚’ã‚ã‚‹ãƒžã‚¯ãƒ­ã«ä¿å­˜ã—ã€æ–°ã—ã„æ¼¢æ–‡æ®µè½ã‚’æ›¸ãè¾¼ã¿å§‹ã‚ã‚‰ã‚Œã‚‹ã€‚}
\begin{example}
% example text from https://phesoca.com/kanbun-html/
\documentclass{ltjtarticle}
\usepackage[kumi=beta]{kanbun}

\Kanbun
æ­¤ãƒ¬ä¹ƒãƒä¿¡(ã—ã‚“)ä¹‹â€˜æ‰€â€•[ä¸‰]ä»¥â€™(ã‚†ã‚‘ã‚“)ç‚ºãƒ«[äºŒ]é™›ä¸‹ãƒŽç¦½(ã¨ã‚Šã“)ãƒˆ[ä¸€]ä¹Ÿã€‚
\EndKanbun
\let\ä¿¡\printkanbun

\Kanbun
å­¤ä¹‹æœ‰ãƒ«ãƒ[äºŒ]å­”æ˜Ž[ä¸€]ï¼ŒçŒ¶ãƒ›â€¹ã”ã¨â€ºÂ«ã‚­Â»[äºŒ]é­šä¹‹æœ‰ãƒ«ã‚¬[ä¸€ãƒ¬]æ°´ä¹Ÿã€‚
\EndKanbun
\let\å­”æ˜Ž\printkanbun

\begin{document}
\å­”æ˜Ž\par\bfseries\ä¿¡
\end{document}
\end{example}

\Kanbun
æ­¤ãƒ¬ä¹ƒãƒä¿¡(ã—ã‚“)ä¹‹â€˜æ‰€â€•[ä¸‰]ä»¥â€™(ã‚†ã‚‘ã‚“)ç‚ºãƒ«[äºŒ]é™›ä¸‹ãƒŽç¦½(ã¨ã‚Šã“)ãƒˆ[ä¸€]ä¹Ÿã€‚
\EndKanbun
\let\ä¿¡\printkanbun

\Kanbun
å­¤ä¹‹æœ‰ãƒ«ãƒ[äºŒ]å­”æ˜Ž[ä¸€]ï¼ŒçŒ¶ãƒ›â€¹ã”ã¨â€ºÂ«ã‚­Â»[äºŒ]é­šä¹‹æœ‰ãƒ«ã‚¬[ä¸€ãƒ¬]æ°´ä¹Ÿã€‚
\EndKanbun
\let\å­”æ˜Ž\printkanbun

\ExplSyntaxOn
\tl_set:Nn \kanbun_kumi { beta }
\ExplSyntaxOff
\printkanbunblock{16}{\å­”æ˜Ž\par\bfseries\ä¿¡}


\end{document}
</pre></body></html>