<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>