\documentclass[luatex,fontsize=8pt,paper=b5,twoside]{jlreq}%
\usepackage{amsmath,amssymb}
\usepackage{booktabs,caption}
\usepackage{luwa-ul,KKluaverb}
\usepackage[most]{tcolorbox}
\usepackage{luatexja-ruby,lltjext,luatexja-otf}
\usepackage{KKsymbols}
% Lowercase roman numerals for the examples (real KKran if available, otherwise a fallback).
\IfFileExists{KKran.sty}{\usepackage{KKran}}{\NewDocumentCommand{\Rrnum}{s m}{\IfBooleanTF{#1}{\uppercase\expandafter{\romannumeral #2}}{\textit{\romannumeral #2}}}}

% You can omit these font settings.
\makeatletter
\RequirePackage[no-math]{fontspec}
\RequirePackage[no-math,match,scale=1]{luatexja-fontspec}
\RequirePackage[hiragino-pro,deluxe,expert]{luatexja-preset}
\setmainfont{HiraMinPro-W3}[BoldFont=HiraMinPro-W6]
\setmainjfont{HiraMinPro-W3}[BoldFont=HiraMinPro-W6]
\newfontfamily{\sfhira@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6]
\newjfontfamily{\sfhiraj@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6]
\newfontfamily{\mchira@pre}{HiraMinPro-W3}[BoldFont=HiraMinPro-W6]
\newjfontfamily{\mchiraj@pre}{HiraMinPro-W3}[BoldFont=HiraMinPro-W6]
\newfontfamily{\gthira@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6,FontFace={eb}{\shapedefault}{HiraKakuStd-W8}]
\newjfontfamily{\gthiraj@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6,FontFace={eb}{\shapedefault}{HiraKakuStd-W8}]
\newfontfamily{\mghira@pre}{HiraMaruPro-W4}
\newjfontfamily{\mghiraj@pre}{HiraMaruPro-W4}
\renewcommand{\sffamily}{\sfhira@pre\sfhiraj@pre}
\renewcommand{\mcfamily}{\mchira@pre\mchiraj@pre}
\renewcommand{\gtfamily}{\gthira@pre\gthiraj@pre}
\renewcommand{\mgfamily}{\mghira@pre\mghiraj@pre}
\makeatother
%%%


\usepackage{hyperref} 
\hypersetup{
  luatex, pdfencoding=auto, 
  colorlinks=true,
  linkcolor=black,     
  citecolor=black,     
  urlcolor=DeepSkyBlue3,      
  pdfborder={0 0 0}, 
}

\colorlet{grayLight}{white!80!black} 

\NewTCBListing{SourceCode}{ m m !o !O{DeepSkyBlue3} }{%
  enhanced, colback=black!70, colframe=Snow4,
  toptitle=-1mm, bottomtitle=-1mm,
  righttitle=-1mm, lefttitle=-1mm,
  arc=.5mm, 
  title={\tcbox[on line, arc=.5mm, boxsep=0pt, boxrule=0pt, top=1mm, bottom=0.8mm, left=2mm, right=2.2mm, colback=gray!80, coltext=white]{\raisebox{-0.1ex}{\vphantom{羅}\vphantom{j}#1}}},fonttitle=\gtfamily\footnotesize,boxrule=0.8pt,
  breakable,before upper={\color{white}},top=-0.5mm,bottom=-0.5mm,
  after title=\IfNoValueTF{#3}{}{{\hfill\tcbox[on line, arc=.5mm, boxsep=0pt, boxrule=0pt, top=1mm, bottom=0.8mm, left=2mm, right=2.2mm, colback=white!80!black, coltext=#4]{\raisebox{-0.1ex}{\vphantom{羅}\vphantom{j}#3}}}},
  listing only,
  listing options={
    language={#2},
    basicstyle=\ttfamily,
    keywordstyle=\ttfamily\color{white},
    stringstyle=\itshape\color{white},
    commentstyle=\small\gtfamily\color{DeepSkyBlue2},
    showspaces=false,showtabs=false,
    breaklines=true,breakindent=0pt,
    showstringspaces=false,
    columns=fullflexible,
    tabsize=2,
    numbers=left,numbersep=1.5pt,
    numberstyle=\scriptsize\gtfamily\color{gray},
  }
}

\NewTColorBox{OutPut}{ m !o !O{DeepSkyBlue3} }{%
  enhanced, colframe=Snow4,
  toptitle=-1mm, bottomtitle=-1mm,
  righttitle=-1mm, lefttitle=-1mm,
  arc=.5mm, colback=white, 
  title={\tcbox[on line, arc=.5mm, boxsep=0pt, boxrule=0pt, top=1mm, bottom=0.8mm, left=2mm, right=2.2mm, colback=gray!40, coltext=DeepSkyBlue3]{\raisebox{-0.1ex}{\vphantom{羅}\vphantom{j}#1}}},fonttitle=\gtfamily\footnotesize,boxrule=0.8pt,
  breakable,top=-0.5mm,bottom=-0.5mm,
  after title=\IfNoValueTF{#2}{}{{\hfill\tcbox[on line, arc=.5mm, boxsep=0pt, boxrule=0pt, top=1mm, bottom=0.8mm, left=2mm, right=2.2mm, colback=white!80!black, coltext=#3]{\raisebox{-0.1ex}{\vphantom{羅}\vphantom{j}#2}}}}, bottom=2mm, top=2mm, 
}

\title{\texttt{KKsymbols} Package Documentation}
\author{Kosei Kawaguchi a.k.a. KKTeX}
\date{Version 2.2.2 (2026/06/26)}
\begin{document}

\begin{titlepage}
  \maketitle
\end{titlepage}
\newpage
\tableofcontents
\newpage

\section{Outline}
\paragraph{Japanese}
このドキュメントでは、主要な仕様説明を日本語と英語の両方で記述します。日本語の説明で実用上の注意点を先に述べ、その直後に対応する英語説明を置きます。

このパッケージは、既存のOTFグリフだけに頼るのではなく、「現在のフォント」「任意の引数」「横書き・縦書き」に合わせて、丸数字や括弧付き文字などの囲み記号を構成するために作られています。

\texttt{luatexja-otf} の \verb|\ajMaru| などは、Adobe-Japan1 の既存グリフを呼び出すため、品質が高く高速である一方、どの番号がどのグリフになるかを知るための早見表やCID知識が必要になりがちです。本パッケージは図形と中身を組み合わせて再構成する設計なので、任意の文字列を同じインターフェースで囲めます。

\paragraph{English}
This documentation now gives the important usage notes in both Japanese and English. The Japanese explanation states practical details first, followed by the corresponding English explanation.

This package is designed to build enclosed symbols such as circled numbers and parenthesized characters from the current font and arbitrary arguments, in both horizontal and vertical writing modes, rather than relying only on pre-existing OTF glyphs.

Commands such as \verb|\ajMaru| in \texttt{luatexja-otf} call Adobe-Japan1 glyphs directly. This gives high-quality and fast output, but it often requires a reference chart or CID knowledge to know which number maps to which glyph. KKsymbols instead composes the enclosure and the content, so arbitrary strings can be enclosed through the same interface.

{%
\fboxsep=0pt\fboxrule=.1pt
\makebox[10\zw][s]{ああ\kakko{あ}ああ}


\directlua{
  for i = 1, 26 do
    local char = i
    tex.print("\\fbox{\\maru{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\maru*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("A"), string.byte("Z") do
    local char = string.char(i)
    tex.print("\\fbox{\\maru{" .. char .. "}}")
  end
}

\directlua{
  for i = 1, 26 do
    local char = i
    tex.print("\\fbox{\\jegg{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\jegg{" .. char .. "}}")
  end
}

\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\jegg*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\kuromaru*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("A"), string.byte("Z") do
    local char = string.char(i)
    tex.print("\\fbox{\\kuromaru{" .. char .. "}}")
  end
}

\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\nmaru*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("A"), string.byte("Z") do
    local char = string.char(i)
    tex.print("\\fbox{\\nmaru{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\hishi*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("A"), string.byte("Z") do
    local char = string.char(i)
    tex.print("\\fbox{\\hishi{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\kurohishi*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("A"), string.byte("Z") do
    local char = string.char(i)
    tex.print("\\fbox{\\kurohishi{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\maruhishi*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("A"), string.byte("Z") do
    local char = string.char(i)
    tex.print("\\fbox{\\maruhishi{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\kuromaruhishi*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("A"), string.byte("Z") do
    local char = string.char(i)
    tex.print("\\fbox{\\kuromaruhishi{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\seihou*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("A"), string.byte("Z") do
    local char = string.char(i)
    tex.print("\\fbox{\\seihou{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\kuroseihou*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("A"), string.byte("Z") do
    local char = string.char(i)
    tex.print("\\fbox{\\kuroseihou{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\seimaru*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("A"), string.byte("Z") do
    local char = string.char(i)
    tex.print("\\fbox{\\seimaru{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\kuroseimaru*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("A"), string.byte("Z") do
    local char = string.char(i)
    tex.print("\\fbox{\\kuroseimaru{" .. char .. "}}")
  end
}


\directlua{
  for i = 1,26 do
    local char = i
    tex.print("\\fbox{\\kakko{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("a"), string.byte("z") do
    local char = string.char(i)
    tex.print("\\fbox{\\kakko*{" .. char .. "}}")
  end
}


\directlua{
  for i = string.byte("A"), string.byte("Z") do
    local char = string.char(i)
    tex.print("\\fbox{\\kakko{" .. char .. "}}")
  end
}%
}

\section{Comparison with \texttt{luatexja-otf}}
\paragraph{Japanese}
\texttt{luatexja-otf} は Adobe-Japan1 のグリフを直接呼び出すための強力なパッケージです。代表的なコマンドには、\verb|\ajMaru|、\verb|\ajKuroMaru|、\verb|\ajKaku|、\verb|\ajKakko|、\verb|\ajRoman|、\verb|\ajroman|、\verb|\ajKakkoroman|、\verb|\ajKakkoRoman| などがあります。これらは既存グリフをそのまま使うため、印刷品質は非常に高く、処理も軽量です。

一方で、\texttt{luatexja-otf} の囲み文字は「存在するグリフを選ぶ」方式です。たとえば \verb|\ajMaru{1}| は丸数字のグリフを出しますが、\verb|\ajMaru{ABC}| のような任意文字列を丸で囲む用途ではありません。対応範囲は Adobe-Japan1 側に存在するグリフと、\texttt{luatexja-ajmacros} が定義している番号範囲・合字名に依存します。

KKsymbols は反対に、「囲みの形」と「中身」をその場で組み合わせる方式です。そのため \verb|\maru{ABC}|、\verb|\kakko{QED.}|、\verb|\seihou{長い文字列}| のように、数字以外の文字列や現在フォントの文字も同じ命令で処理できます。代償として、既存の完成グリフを呼び出す \texttt{luatexja-otf} よりも内部処理は重く、極端な引数では縮小や中央寄せの調整が見た目に出ることがあります。

\paragraph{English}
\texttt{luatexja-otf} is a powerful package for accessing Adobe-Japan1 glyphs directly. Typical commands include \verb|\ajMaru|, \verb|\ajKuroMaru|, \verb|\ajKaku|, \verb|\ajKakko|, \verb|\ajRoman|, \verb|\ajroman|, \verb|\ajKakkoroman|, and \verb|\ajKakkoRoman|. Since these commands use pre-designed glyphs, the output quality is excellent and the processing cost is low.

The important limitation is that \texttt{luatexja-otf} selects existing glyphs. For example, \verb|\ajMaru{1}| outputs a circled-number glyph, but \verb|\ajMaru{ABC}| is not a general command for enclosing an arbitrary string. Its coverage depends on the glyphs available in Adobe-Japan1 and on the numeric ranges and ligature names defined by \texttt{luatexja-ajmacros}.

KKsymbols takes the opposite approach: it composes the enclosure and the content at typesetting time. Therefore commands such as \verb|\maru{ABC}|, \verb|\kakko{QED.}|, and \verb|\seihou{long text}| work with non-numeric strings and with the current font. The tradeoff is that KKsymbols does more internal work than \texttt{luatexja-otf}, and very long or unusual arguments may visibly depend on the package's scaling and centering rules.

\subsection{Command-by-command examples}
\paragraph{Japanese}
次の表は、同じような用途に見えるコマンドの比較です。左側の \texttt{luatexja-otf} は既存グリフ、右側の KKsymbols は現在フォントから組み立てた結果です。

\paragraph{English}
The following table compares commands that look similar in ordinary use. The \texttt{luatexja-otf} examples on the left are existing glyphs, while the KKsymbols examples on the right are composed from the current font.

\begin{table}[h]
\centering
\caption{Comparison with \texttt{luatexja-otf}}
\small
\begin{tabular}{lll}
\toprule
Purpose & \texttt{luatexja-otf} & KKsymbols \\
\midrule
circled number & \verb|\ajMaru{8}| \quad \ajMaru{8} & \verb|\maru{8}| \quad \maru{8} \\
black circled number & \verb|\ajKuroMaru{8}| \quad \ajKuroMaru{8} & \verb|\kuromaru{8}| \quad \kuromaru{8} \\
square number & \verb|\ajKaku{8}| \quad \ajKaku{8} & \verb|\seihou{8}| \quad \seihou{8} \\
parenthesized number & \verb|\ajKakko{8}| \quad \ajKakko{8} & \verb|\kakko{8}| \quad \kakko{8} \\
uppercase roman & \verb|\ajRoman{8}| \quad \ajRoman{8} & \verb|\kakko{\Rrnum*{8}}| \quad \kakko{\Rrnum*{8}} \\
lowercase roman & \verb|\ajroman{8}| \quad \ajroman{8} & \verb|\kakko{\Rrnum{8}}| \quad \kakko{\Rrnum{8}} \\
parenthesized roman & \verb|\ajKakkoroman{8}| \quad \ajKakkoroman{8} & \verb|\kakko{\Rrnum{8}}| \quad \kakko{\Rrnum{8}} \\
\bottomrule
\end{tabular}
\end{table}

\subsection{Practical selection guide}
\paragraph{Japanese}
完成済みの標準グリフが必要な場合、たとえば丸数字・括弧付き数字・ローマ数字が Adobe-Japan1 の範囲に収まる場合は、\texttt{luatexja-otf} が最も安定します。フォントベンダが設計した字形なので、紙面上の完成度も高くなります。

任意の文字列、現在の欧文・和文フォント、太字、色付き文字、長いラベル、独自の囲み形状が必要な場合は KKsymbols が向いています。KKsymbols は「グリフを探す」必要がなく、\verb|\maru{任意}| や \verb|\kakko{ABC}| のように直接書けます。

\paragraph{English}
Use \texttt{luatexja-otf} when you need standard pre-designed glyphs, such as circled numbers, parenthesized numbers, or roman numerals that are covered by Adobe-Japan1. Since these glyphs are designed by the font vendor, they usually give the most polished printed result.

Use KKsymbols when you need arbitrary strings, the current Latin or Japanese font, bold or colored content, long labels, or custom enclosure styles. KKsymbols does not require you to look up a glyph; you can write commands such as \verb|\maru{任意}| or \verb|\kakko{ABC}| directly.


\section{Acknowledgements / Credit}
In developing this package, I made extensive use of the advice I received from Mr.~Yusuke~Terada.

I recommend you to refer to his article when you develop new-type symbols on \LaTeX.

\begin{quotation}
  \url{https://doratex.hatenablog.jp/entry/20211205/1638697391}
\end{quotation}

\section{Installation}
Place \texttt{KKsymbols.sty} in a directory where LaTeX can find it, e.g., your local \texttt{texmf} tree or alongside your document.

\subsection{Dependencies}
This package depends on the following packages.

\begin{itemize}
    \item \texttt{LuaLaTeX-ja}
    \item \texttt{tikz}
    \item \texttt{clac}
    \item \texttt{luacode}
    \item \texttt{kvoptions}
\end{itemize}

\subsection{Loading and Options}
Load the package: \KKverb|\usepackage[<options>]{KKsymbols}|

Currently, the following package option is provided.

\begin{description}
  \item[tsumesuji] To specify whether or not to ``shrink'' the box width occupied by ``1''. By default, \KKverb|tsumesuji=1| is specified, and the effect is activated. If you deactivate it, \KKverb|tsumesuji=0| will do.

  To clarify, this option is applied when the argument of a command subject to the \KKverb|tsumesuji| option—after expansion—is a numeric string of two or more digits and contains the digit ``1''. The differnce is present in the following example:
  \begin{SourceCode}{Input}{TeX}
    % NOT APPLIED
    \kakko{\vphantom{X}12}

    % APLIED
    \kakko{12}
  \end{SourceCode}
  \begin{OutPut}{Output}
    % NOT APPLIED
    \kakko{\vphantom{X}12}

    % APLIED
    \kakko{12}
  \end{OutPut}
\end{description}

\section{Caution}
\namiKK{Since this package internally calls \KKverb|\ltjghostbeforejachar| and \KKverb|\ltjghostafterjachar|, it can be used \textbf{only in a LuaLaTeX environment.}}

\section{Commands}
\subsection{The maru series}
This package provides \verb|\maru|, \verb|\kuromaru|, and \verb|\nmaru|. Each of them takes one mandatory argument and no optional arguments. You can pass strings of any length and in any font as arguments.

In most cases, \verb|\maru{argument}| will meet your demands. However, only when you take lowercase alphabet in these commands, you must use star-command just like \verb|\maru*{m}|\footnote{\KKverb|\jegg| is an exception of this rule. When you use \KKverb|\jegg|, you don't have to put the star option no matter the argument is lowercase or not. If you do it, the background color of the \KKverb|\jegg| changes into gray. Only in this case, the effect of the option is different.}.

\begin{SourceCode}{Input}{TeX}[Mind the star option!]
  % Normal Characters
  \maru{A}\maru{あ}\maru{QED.}

  % Lowercase Alphabetic Characters
  \maru*{a}\maru*{j}\maru*{z}
\end{SourceCode}

\begin{OutPut}{Output}
  % Normal Characters
  \maru{A}\maru{あ}\maru{QED.}

  % Lowercase Alphabetic Characters
  \maru*{a}\maru*{j}\maru*{z}
\end{OutPut}

They are used as follows.

\begin{table}[h]
\centering
\caption{maru series}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
argument & \texttt{\textbackslash maru} & \texttt{\textbackslash kuromaru} & \texttt{\textbackslash nmaru} & \texttt{\textbackslash jegg} & \texttt{\textbackslash jegg*} \\
\hline
1     & \maru{1}     & \kuromaru{1}     & \nmaru{1} & \jegg{1} & \jegg*{1}  \\
97    & \maru{97}    & \kuromaru{97}    & \nmaru{97} & \jegg{97} & \jegg*{97} \\
だ    & \maru{だ}    & \kuromaru{だ}    & \nmaru{だ} & \jegg{だ} & \jegg*{だ} \\
ばばば & \maru{ばばば} & \kuromaru{ばばば} & \nmaru{ばばば} & \jegg{ばばば} & \jegg*{ばばば} \\
m & \maru*{m} & \kuromaru*{m} & \nmaru*{m} & \jegg{m} & \jegg*{m} \\
Qjg & \maru{Qjg} & \kuromaru{Qjg} & \nmaru{Qjg} & \jegg{Qjg} & \jegg*{Qjg} \\
\hline
\end{tabular}
\end{table}

They behave as if they were single kanji or hiragana characters:

\fboxsep=0pt\fboxrule=0.1pt
\begin{quotation}
  あいう\fbox{\maru{あ}}\fbox{あ}いう\maru{1}\maru{2}\maru{3}あいうえお
\end{quotation}

The spacing between \verb|\maru| and other characters is adjusted using \verb|\ltjghostbeforejachar| and \verb|\ltjghostafterjachar| so that it behaves like hiragana or kanji.

When changing the font size using commands such as \verb|\Large|, each command is scaled proportionally according to the font size change:

\begin{quotation}
  {\tiny \maru{あああ}\kuromaru{2222}\nmaru{亀}}

  {\normalsize \maru{あああ}\kuromaru{2222}\nmaru{亀}}

  {\Huge \maru{あああ}\kuromaru{2222}\nmaru{亀}}
\end{quotation}

You can also change the current font:
\begin{quotation}
  {\LARGE\maru{あいう}\kuromaru{午後}\nmaru{悟}}%

  {\gtfamily \maru{あいう}\kuromaru{午後}\nmaru{悟}}
\end{quotation}


\section{Roman numerals}
\paragraph{Japanese}
KKsymbols 自体はローマ数字を生成しません。ローマ数字の生成には、通常 \texttt{KKran} パッケージが提供する \KKverb|\Rrnum| を使います。\KKverb|\Rrnum{8}| は小文字ローマ数字、\KKverb|\Rrnum*{8}| は大文字ローマ数字を出します。

大文字ローマ数字は大文字アルファベットと同じ扱いで、通常は非スター版の囲みコマンドに入れます。たとえば \KKverb|\kakko{\Rrnum*{8}}| や \KKverb|\maru{\Rrnum*{8}}| のように書きます。

小文字ローマ数字は注意が必要です。小文字の \verb|i|、\verb|v|、\verb|x| は字ごとに高さが違うため、単に \KKverb|\kakko{\Rrnum{1}}| から \KKverb|\kakko{\Rrnum{10}}| までを並べると、囲み内部での縦方向の見え方が完全には揃わないことがあります。これはバグではなく、引数の実際の高さが異なるためです。

小文字ローマ数字をリストラベルなどで厳密に揃えたい場合は、\KKverb|\kksref{\Rrnum{6}}| をグループ内で指定してください。これは各囲みコマンドの内部に \KKverb|\vphantom{\Rrnum{6}}| 相当の基準を加えるためのフックです。

\paragraph{English}
KKsymbols itself does not generate roman numerals. In ordinary use, roman numerals are supplied by the \texttt{KKran} package through \KKverb|\Rrnum|. \KKverb|\Rrnum{8}| gives a lowercase roman numeral, while \KKverb|\Rrnum*{8}| gives an uppercase roman numeral.

Uppercase roman numerals behave like uppercase Latin letters. They should normally be used with the non-starred enclosure commands, for example \KKverb|\kakko{\Rrnum*{8}}| or \KKverb|\maru{\Rrnum*{8}}|.

Lowercase roman numerals require more care. The letters \verb|i|, \verb|v|, and \verb|x| have different heights, so a sequence from \KKverb|\kakko{\Rrnum{1}}| to \KKverb|\kakko{\Rrnum{10}}| may not look vertically identical inside the enclosures. This is not a bug; it follows from the actual glyph metrics of the arguments.

If lowercase roman numerals must be strictly aligned, for example in list labels, set \KKverb|\kksref{\Rrnum{6}}| inside a group. It works as a hook that adds a reference equivalent to \KKverb|\vphantom{\Rrnum{6}}| inside each enclosure command.

\begin{SourceCode}{Input}{TeX}[Roman numerals]
  % Uppercase roman numerals: use the non-starred enclosure command.
  \kakko{\Rrnum*{1}}\kakko{\Rrnum*{2}}\kakko{\Rrnum*{3}}

  % Lowercase roman numerals: automatic reference only.
  \kakko{\Rrnum{1}}\kakko{\Rrnum{2}}\kakko{\Rrnum{3}}\kakko{\Rrnum{6}}

  % Lowercase roman numerals: force a common reference.
  {\kksref{\Rrnum{6}}%
    \kakko{\Rrnum{1}}\kakko{\Rrnum{2}}\kakko{\Rrnum{3}}\kakko{\Rrnum{6}}}
\end{SourceCode}
\begin{OutPut}{Output}
  \kakko{\Rrnum*{1}}\kakko{\Rrnum*{2}}\kakko{\Rrnum*{3}}\quad
  \kakko{\Rrnum{1}}\kakko{\Rrnum{2}}\kakko{\Rrnum{3}}\kakko{\Rrnum{6}}\quad
  {\kksref{\Rrnum{6}}%
    \kakko{\Rrnum{1}}\kakko{\Rrnum{2}}\kakko{\Rrnum{3}}\kakko{\Rrnum{6}}}
\end{OutPut}

\section{Automatic alignment (reference box)}
\paragraph{Japanese}
v2.2.0 以降、各囲みコマンドは既定で「現在フォントの参照高さ」、具体的には x-height 相当を基準として中身のサイズと中央位置を決めます。これは短い文字や深さのない文字を、引数自身のバウンディングボックスだけで処理したときのばらつきを抑えるためです。

ただし、既定の自動基準は \KKverb|\vphantom{\Rrnum{6}}| と同一ではありません。したがって、小文字ローマ数字を \KKverb|\Rrnum{6}| の高さ・深さで揃えたい場合は、前節のように \KKverb|\kksref{\Rrnum{6}}| を明示してください。

漢字・かな・大文字・数字など、既定基準より背の高い内容は、引数自身の寸法が優先されます。このため、通常の文書では既存の出力が大きく変わらないようになっています。

\paragraph{English}
Since v2.2.0, each enclosure command uses the current font's reference height, roughly its x-height, as the default reference for sizing and vertical centering. This reduces variation when short glyphs or glyphs with no depth would otherwise be measured only by their own bounding boxes.

However, the automatic reference is not identical to \KKverb|\vphantom{\Rrnum{6}}|. If lowercase roman numerals should be aligned against the height and depth of \KKverb|\Rrnum{6}|, explicitly use \KKverb|\kksref{\Rrnum{6}}| as shown in the previous section.

For content taller than the default reference, such as kanji, kana, uppercase letters, or digits, the argument's own metrics still dominate. This keeps ordinary documents close to their existing appearance.

\subsection{Overriding the reference}
\begin{description}
  \item[\KKverb|\kksref{<material>}|]
  \textbf{Japanese:} \verb|<material>| の高さ・深さを、既定の自動基準の代わりに使います。効果は \KKverb|\RotYoko| と同じくスコープ依存なので、通常はグループで囲みます。

  \textbf{English:} Use the height and depth of \verb|<material>| as the reference instead of the automatic one. The effect is scoped like \KKverb|\RotYoko|, so enclose it in a group.
  \begin{SourceCode}{Input}{TeX}
    {\kksref{\Rrnum{6}}%
      \maru{\Rrnum{1}}\maru{\Rrnum{4}}\maru{\Rrnum{8}}}
  \end{SourceCode}
  \item[\KKverb|\kksrefoff|]
  \textbf{Japanese:} 参照ボックスを無効化し、v2.2.0 以前のように引数自身の寸法を使います。

  \textbf{English:} Disable the reference box and fall back to the argument's own metrics, which is the behavior before v2.2.0.
  \item[\KKverb|\kksrefauto|]
  \textbf{Japanese:} 既定の自動基準に戻します。\KKverb|\kksrefreset| は別名です。

  \textbf{English:} Restore the automatic reference. \KKverb|\kksrefreset| is an alias.
\end{description}


\section{Rotation}
\subsection{Commands}
This package provides \verb|\RotTate| and \verb|\RotYoko|. The differnces are as follows:

\begin{description}
  \item[In horizontal mode] You should use \verb|\RotYoko|. The default value is \verb|0|. Therefore, if you use \verb|\RotYoko| with no arguments, this is equal to \verb|\RotYoko[0]| 
  \item[In vertical mode] You should use \verb|\RotTate|. The default value is \verb|90|. Therefore, if you use \verb|\RotTate| with no arguments, this is equal to \verb|\RotTate[90]| 
\end{description}

From a technical perspective: Commands like \verb|\maru| provided by this package automatically rotate their arguments based on the ``current typesetting direction'' Specifically, the package applies a 0-degree rotation for horizontal writing (yoko-gaki) and a 90-degree rotation for vertical writing (tate-gaki).

The commands \verb|\RotYoko| and \verb|\RotTate| redefine this "automatic rotation angle" to the value specified in their arguments. Consequently, the effect is persistent unless localized (similar to how font-size commands like \verb|\small| behave). Therefore, please ensure you use appropriate scoping, such as enclosing the command within curly braces \verb|{...}|, when applying these settings.

\begin{SourceCode}{Input}{TeX}
  % In horizontal mode
  {\RotYoko[45]\kakko{あ}\kakko{い}\kakko{う}}\par
  {\RotYoko[60]\kakko{1}\kakko{2}\kakko{3}}

  % In vertical mode
  \parbox<t>{5\zw}{% <t> option requires lltjext package.
    {\RotTate[45]\kakko{あ}\kakko{い}\kakko{う}}\par
    {\RotTate[60]\kakko{1}\kakko{2}\kakko{3}}
  }
\end{SourceCode}

\begin{OutPut}{Output}
  {\RotYoko[45]\kakko{あ}\kakko{い}\kakko{う}}\par
  {\RotYoko[60]\kakko{1}\kakko{2}\kakko{3}}

  \bigskip

  \parbox<t>{5\zw}{% <t> option requires lltjext package.
    {\RotTate[45]\kakko{あ}\kakko{い}\kakko{う}}\par
    {\RotTate[60]\kakko{1}\kakko{2}\kakko{3}}
  }
\end{OutPut}

\subsection{Vertical mode}
When you want to typeset \maru{あ}, for instance, in vertical mode, you should use \verb|\RotTate| command. 

As described in the previous subsection, the effect of \verb|\RotTate| lasts, when localized, in a certain group. So when you typeset hiragana or kanji, use it like this:

\begin{SourceCode}{Input}{TeX}
  % In vertical mode
  \parbox<t>{5\zw}{%
    {\RotTate[0]\kakko{あ}\kakko{い}\kakko{う}}\par
    \kakko{1}\kakko{1}\kakko{3}
  }
\end{SourceCode}

\begin{OutPut}{Output}
  \parbox<t>{5\zw}{%
    {\RotTate[0]\kakko{あ}\kakko{い}\kakko{う}}\par
    \kakko{1}\kakko{1}\kakko{3}
  }
\end{OutPut}

\section{The seihou series}
The commands introduced below are used in exactly the same way as the maru series.
In most cases, \verb|\seihou{argument}| will meet your demands. However, only when you take lowercase alphabet in these commands, you must use star-command just like \verb|\seihou*{m}|.

\bigskip{%
\centering
\captionof{table}{seihou series}
\begin{tabular}{|c|c|c|c|c|}
\hline
argument & \texttt{\textbackslash seihou} & \texttt{\textbackslash kuroseihou} & \texttt{\textbackslash seimaru} & \texttt{\textbackslash kuroseimaru} \\
\hline
1       & \seihou{1}        & \kuroseihou{1}      & \seimaru{1}       & \kuroseimaru{1}  \\
97      & \seihou{97}       & \kuroseihou{97}     & \seimaru{97}      & \kuroseimaru{97} \\
だ      & \seihou{だ}       & \kuroseihou{だ}     & \seimaru{だ}      & \kuroseimaru{だ} \\
ばばば  & \seihou{ばばば}   & \kuroseihou{ばばば} & \seimaru{ばばば}  & \kuroseimaru{ばばば} \\
m       & \seihou*{m}       & \kuroseihou*{m}     & \seimaru*{m}      & \kuroseimaru*{m} \\
Qjg     & \seihou{Qjg}      & \kuroseihou{Qjg}    & \seimaru{Qjg}     & \kuroseimaru{Qjg} \\
\hline
\end{tabular}
}\bigskip

{%
\centering
\captionof{table}{hishi series}
\begin{tabular}{|c|c|c|c|c|}
\hline
argument & \texttt{\textbackslash hishi} & \texttt{\textbackslash kurohishi} & \texttt{\textbackslash maruhishi} & \texttt{\textbackslash kuromaruhishi} \\
\hline
1     & \hishi{1}     & \kurohishi{1}     & \maruhishi{1}     & \kuromaruhishi{1} \\
97    & \hishi{97}    & \kurohishi{97}    & \maruhishi{97}    & \kuromaruhishi{97} \\
だ    & \hishi{だ}    & \kurohishi{だ}    & \maruhishi{だ}    & \kuromaruhishi{だ} \\
ばばば & \hishi{ばばば} & \kurohishi{ばばば} & \maruhishi{ばばば} & \kuromaruhishi{ばばば} \\
m & \hishi*{m} & \kurohishi*{m} & \maruhishi*{m} & \kuromaruhishi*{m} \\
Qjg & \hishi{Qjg} & \kurohishi{Qjg} & \maruhishi{Qjg} & \kuromaruhishi{Qjg} \\
\hline
\end{tabular}
}\bigskip


\begin{SourceCode}{Input}{TeX}[Mind the star option!]
  % Normal Characters
  \seihou{A}\seihou{あ}\seihou{QED.}

  % Lowercase Alphabetic Characters
  \seihou*{a}\seihou*{j}\seihou*{z}
\end{SourceCode}

\begin{OutPut}{Output}
  % Normal Characters
  \seihou{A}\seihou{あ}\seihou{QED.}

  % Lowercase Alphabetic Characters
  \seihou*{a}\seihou*{j}\seihou*{z}
\end{OutPut}


\section{The kakko series}
The commands introduced below are used in exactly the same way as the maru series.

In most cases, \verb|\kakko{argument}| will meet your demands. However, only when you take lowercase alphabet in these commands, you must use star-command just like \verb|\kakko*{m}|\footnote{\KKverb|\zenkakuhabafixer| is an exception of this rule. It does not take a star option.}.

\bigskip{%
\centering
\captionof{table}{kakko series\maru{1}}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
argument & \texttt{\textbackslash kakko} & \texttt{\textbackslash sumikakko} & \texttt{\textbackslash kakukakko} & \texttt{\textbackslash kikakko} & \texttt{\textbackslash ykakko} \\
\hline
1     & \kakko{1}     & \sumikakko{1}     & \kakukakko{1}     & \kikakko{1}     & \ykakko{1} \\
97    & \kakko{97}    & \sumikakko{97}    & \kakukakko{97}    & \kikakko{97}    & \ykakko{97} \\
だ    & \kakko{だ}    & \sumikakko{だ}    & \kakukakko{だ}    & \kikakko{だ}    & \ykakko{だ} \\
ばばば & \kakko{ばばば} & \sumikakko{ばばば} & \kakukakko{ばばば} & \kikakko{ばばば} & \ykakko{ばばば} \\
m & \kakko*{m} & \sumikakko*{m} & \kakukakko*{m} & \kikakko*{m} & \ykakko*{m} \\
Qjg & \kakko{Qjg} & \sumikakko{Qjg} & \kakukakko{Qjg} & \kikakko{Qjg} & \ykakko{Qjg} \\
\hline
\end{tabular}
}

\bigskip{%
\centering
\captionof{table}{kakko series\maru{2}}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
argument & \texttt{\textbackslash nykakko} & \texttt{\textbackslash namikakko} & \texttt{\textbackslash kagikakko} & \texttt{\textbackslash nkagikakko} & \texttt{\textbackslash ichimoji} & \texttt{\textbackslash zenkakuhabafixer}\\
\hline
1     & \nykakko{1}     & \namikakko{1}     & \kagikakko{1}     & \nkagikakko{1}     & \ichimoji{1} & \zenkakuhabafixer{1} \\
97    & \nykakko{97}    & \namikakko{97}    & \kagikakko{97}    & \nkagikakko{97}    & \ichimoji{97} & \zenkakuhabafixer{97} \\
だ    & \nykakko{だ}    & \namikakko{だ}    & \kagikakko{だ}    & \nkagikakko{だ}    & \ichimoji{だ} & \zenkakuhabafixer{だ} \\
ばばば & \nykakko{ばばば} & \namikakko{ばばば} & \kagikakko{ばばば} & \nkagikakko{ばばば} & \ichimoji{ばばば} & \zenkakuhabafixer{ばばば} \\
m & \nykakko*{m} & \namikakko*{m} & \kagikakko*{m} & \nkagikakko*{m} & \ichimoji*{m} & \zenkakuhabafixer{m} \\
Qjg & \nykakko{Qjg} & \namikakko{Qjg} & \kagikakko{Qjg} & \nkagikakko{Qjg} & \ichimoji{Qjg} & \zenkakuhabafixer{Qjg} \\
\hline
\end{tabular}
}\bigskip

\begin{SourceCode}{Input}{TeX}[Mind the star option!]
  % Normal Characters
  \kakko{A}\kakko{あ}\kakko{QED.}

  % Lowercase Alphabetic Characters
  \kakko*{a}\kakko*{j}\kakko*{z}
\end{SourceCode}

\begin{OutPut}{Output}
  % Normal Characters
  \kakko{A}\kakko{あ}\kakko{QED.}

  % Lowercase Alphabetic Characters
  \kakko*{a}\kakko*{j}\kakko*{z}
\end{OutPut}

\subsection{Additional Description: \KKverb|\ichimoji| and \KKverb|\zenkakuhabafixer|}
The major differnce of \verb|\ichimoji| and \verb|\zenkakuhabafixer| is that the former changes the vertical scale to force its totalheight to \verb|\zw|, but the latter doesn't. You can see the differnce as follows: 

\begin{description}
  \item[\KKverb|\ichimoji|] \fbox{\ichimoji{123}}
  \item[\KKverb|\zenkakuhabafixer|] \fbox{\zenkakuhabafixer{123}}
\end{description}

\section{License}

Released under the MIT License.

\section{Version History}

\begin{itemize}
  \item \textbf{v1.0.0 (2025/10/03)} --- Initial public release.
  \item \textbf{v1.0.1--1.0.4} --- Added \verb|\ichimoji|; fixed various bugs.
  \item \textbf{v1.1.0 (2025/10/28)} --- Unified all commands to \textit{zenkaku} (full-width).
  \item \textbf{v1.1.1 (2025/11/10)} --- Refined \verb|\ichimoji| scaling logic.
  \item \textbf{v2.0.0 (2025/12/23)} --- Overhauled scaling to match OTF character quality.
  \item \textbf{v2.0.1 (2026/01/08)} --- With the update to luatexja version 20260107.0, the commands provided by the KKsymbols package now behave identically to native Japanese characters. This improvement is due to the bug fixes in \verb|\ltjghostbeforejachar| and \verb|\ltjghostafterjachar|. Previously, when multiple commands from this package were used consecutively, proper glue was not inserted between them; however, this issue has been resolved in this update.
  \item \textbf{v2.0.2 (2026/01/20)} --- This update fixes a critical bug where arguments of the \verb|\kakko| command could overflow when using specific fonts (for example, Hiragino fonts with weights W4 and above). 
  \item \textbf{v2.1.0 (2026/02/16)} --- In this update, the following points are changed.
  \begin{itemize}
    \item \verb|\period| command was deleted. It have never been used since the significance of existence had been absolutely questionable. I finally decided to delete it.
    \item New package option \verb|tsumesuji| was added. 
    \item New command \verb|\zenkakuhabafixer| was added.
  \end{itemize}
  \item \textbf{v2.1.1 (2026/02/17)} --- An emergency update to fix a bug where the arguments of \KKverb|\kakko|, \KKverb|\maru| etc. caused expansion errors.
  \item \textbf{v2.1.2 (2026/02/19)} --- The effects are applied when the argument of a command subject to the \KKverb|tsumesuji| option—after expansion—is a numeric string of two or more digits and contains the digit ``1''.
  \item \textbf{v2.1.4 (2026/04/17)} --- When the arguments provided by this package contain only one-digit-number, the internal resize algorithm is nullified.
  \item \textbf{v2.2.0 (2026/06/21)} --- Automatic vertical alignment was introduced. By default, the content of each enclosure is sized and centered against the current font's reference height (x-height) instead of relying only on the glyph's own metrics. The new commands \KKverb|\kksref|, \KKverb|\kksrefoff|, and \KKverb|\kksrefauto| (alias \KKverb|\kksrefreset|) control this behavior. For strict lowercase roman-numeral alignment, use \KKverb|\kksref{\Rrnum{6}}| explicitly.
  \item \textbf{v2.2.1 (2026/06/21)} --- Bug fix: font-size commands inside arguments no longer cause an infinite loop in the internal one-digit/\KKverb|tsumesuji| check. The visible output size is unaffected.
  \item \textbf{v2.2.2 (2026/06/26)} --- Documentation update. The documentation now describes uppercase \KKverb|\Rrnum*{n}| and lowercase \KKverb|\Rrnum{n}| usage, clarifies when \KKverb|\kksref{\Rrnum{6}}| is needed, and adds a Japanese/English comparison with \texttt{luatexja-otf}.
\end{itemize}

\end{document}
