\documentclass[luatex,fontsize=10pt,paper=b5,twoside]{jlreq}% \usepackage{KKsymbols} \usepackage[dvipsnames, svgnames, x11names]{xcolor} \usepackage{hyperref} \usepackage{fp} \usepackage{listings} \usepackage{caption} \lstset{ basicstyle=\ttfamily\small, keywordstyle=\color{blue}, commentstyle=\color{gray}, stringstyle=\color{red}, breaklines=true, breakatwhitespace=false, columns=flexible } \usepackage{hyperref} \hypersetup{ luatex, pdfencoding=auto, colorlinks=true, linkcolor=black, citecolor=black, urlcolor=DeepSkyBlue3, pdfborder={0 0 0}, } \title{\texttt{KKsymbols} Package Documentation} \author{Kosei Kawaguchi a.k.a. KKTeX} \date{Version 1.1.0 (2025/10/28)} \begin{document} \begin{titlepage} \maketitle \end{titlepage} \newpage \tableofcontents \newpage \section{Acknowledgements / Credit} In developing this package, I made extensive use of the advice I received from Yusuke Terada. \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. Dependencies: \begin{itemize} \item \texttt{LuaLaTeX-ja} \item \texttt{tikz} \item \texttt{clac} \end{itemize} Load the package: \begin{verbatim} \usepackage{KKsymbols} \end{verbatim} \section{Caution} Since this package internally calls \verb|\ltjghostbeforejachar| and \verb|\ltjghostafterjachar|, it can be used 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. \textbf{However, using lowercase letters as arguments is not recommended.} They are used as follows. \begin{table}[h] \centering \caption{maru series} \begin{tabular}{|c|c|c|c|} \hline argument & \texttt{\textbackslash maru} & \texttt{\textbackslash kuromaru} & \texttt{\textbackslash nmaru} \\ \hline 1 & \maru{1} & \kuromaru{1} & \nmaru{1} \\ 97 & \maru{97} & \kuromaru{97} & \nmaru{97} \\ だ & \maru{だ} & \kuromaru{だ} & \nmaru{だ} \\ ばばば & \maru{ばばば} & \kuromaru{ばばば} & \nmaru{ばばば} \\ \hline \end{tabular} \end{table} They behave as if they were single kanji or hiragana characters: \fboxsep=0pt\fboxrule=0.2pt \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. \textbf{Naturally, these commands also work correctly in vertical writing environments.} 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} \subsubsection{Lowercase letters and "Q"} As mentioned earlier, using lowercase letters as arguments for this macro is not recommended. However, \textbf{it is not entirely impossible if you really want to do so}. \noindent\triangleright \ \underline{\bfseries Multiple strings which include characters with descenders}\\ This package provides two commands, \verb|\dccare| and \verb|\ndccare|. Characters with descenders, such as \verb|g| or \verb|Q|, can be handled using \verb|\dccare{g}|, while characters without descenders can be handled using \verb|\ndccare{a}|. When \verb|\maru| (or the like) accepts \textbf{multiple strings as an argument}, and there are characters with descenders among them, treat them as shown below: \begin{lstlisting} \maru{\dccare{g}}\maru{\dccare{ggg}}\maru{\dccare{j}}\maru{\dccare{jjj}}\maru{\ndccare{a}} \maru{\dccare{j}\ndccare{b}\dccare{j}}\maru{あ\dccare{g}}\maru{A\dccare{j}}\maru{田\ndccare{a}} \end{lstlisting} \begin{quotation} \maru{\dccare{g}}\maru{\dccare{ggg}}\maru{\dccare{j}}\maru{\dccare{jjj}}\maru{\ndccare{a}} \maru{\dccare{j}\ndccare{b}\dccare{j}}\maru{あ\dccare{g}}\maru{A\dccare{j}}\maru{田\ndccare{a}} \end{quotation} \noindent\triangleright \ \underline{\bfseries Single string which includes a descender}\\ In this case, use the special command \verb|\slowcare| and handle it as follows. \begin{lstlisting} \maru{\slowcare{a}}...\maru{\slowcare{g}}... \end{lstlisting} \begin{quotation} \maru{\slowcare{a}} \maru{\slowcare{b}} \maru{\slowcare{c}} \maru{\slowcare{d}} \maru{\slowcare{e}} \maru{\slowcare{f}} \maru{\slowcare{g}} \maru{\slowcare{h}} \maru{\slowcare{i}} \maru{\slowcare{j}} \maru{\slowcare{k}} \maru{\slowcare{l}} \maru{\slowcare{m}} \maru{\slowcare{n}} \maru{\slowcare{o}} \maru{\slowcare{p}} \maru{\slowcare{q}} \maru{\slowcare{r}} \maru{\slowcare{s}} \maru{\slowcare{t}} \maru{\slowcare{u}} \maru{\slowcare{v}} \maru{\slowcare{w}} \maru{\slowcare{z}} \end{quotation} \noindent\triangleright \ \underline{\bfseries "Q"}\\ Among uppercase alphabetic characters, \textbf{Q} is the only one that has a descender. In this case, you should use \verb|\dccare| in \textbf{ANY} case. \begin{lstlisting} \maru{\dccare{Q}}\maru{\dccare{QQQ}}\maru{\dccare{Q}.12} \end{lstlisting} \begin{quotation} \maru{\dccare{Q}}\maru{\dccare{QQQ}}\maru{\dccare{Q}.12} \end{quotation} \subsection{Others} For certain fonts, the characters may still extend beyond the frame even with these adjustments. In such cases, use commands like \verb|\scalebox| or \verb|\raisebox| to adjust them as needed. \section{The seihou series} The commands introduced below are used in exactly the same way as the maru series. \bigskip{% \centering \captionof{table}{seihou series} \begin{tabular}{|c|c|c|} \hline argument & \texttt{\textbackslash seihou} & \texttt{\textbackslash kuroseihou} \\ \hline 1 & \seihou{1} & \kuroseihou{1} \\ 97 & \seihou{97} & \kuroseihou{97} \\ だ & \seihou{だ} & \kuroseihou{だ} \\ ばばば & \seihou{ばばば} & \kuroseihou{ばばば} \\ \hline \end{tabular} }\bigskip {% \centering \captionof{table}{seimaru series} \begin{tabular}{|c|c|c|} \hline argument & \texttt{\textbackslash seimaru} & \texttt{\textbackslash kuroseimaru} \\ \hline 1 & \seimaru{1} & \kuroseimaru{1} \\ 97 & \seimaru{97} & \kuroseimaru{97} \\ だ & \seimaru{だ} & \kuroseimaru{だ} \\ ばばば & \seimaru{ばばば} & \kuroseimaru{ばばば} \\ \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{ばばば} \\ \hline \end{tabular} }\bigskip Examples with lowercase alphabet characters are additionally provided. \begin{lstlisting} \seihou{\dccare{g}}\seihou{\dccare{ggg}}\seihou{\dccare{j}}\seihou{\dccare{jjj}}\seihou{\ndccare{a}} \seihou{\dccare{j}\ndccare{b}\dccare{j}}\seihou{あ\dccare{g}}\seihou{A\dccare{j}}\seihou{田\ndccare{a}} \hishi{\dccare{g}}\hishi{\dccare{ggg}}\hishi{\dccare{j}}\hishi{\dccare{jjj}}\hishi{\ndccare{a}} \hishi{\dccare{j}\ndccare{b}\dccare{j}}\hishi{あ\dccare{g}}\hishi{A\dccare{j}}\hishi{田\ndccare{a}} \end{lstlisting} \begin{quotation} \seihou{\dccare{g}}\seihou{\dccare{ggg}}\seihou{\dccare{j}}\seihou{\dccare{jjj}}\seihou{\ndccare{a}} \seihou{\dccare{j}\ndccare{b}\dccare{j}}\seihou{あ\dccare{g}}\seihou{A\dccare{j}}\seihou{田\ndccare{a}} \hishi{\dccare{g}}\hishi{\dccare{ggg}}\hishi{\dccare{j}}\hishi{\dccare{jjj}}\hishi{\ndccare{a}} \hishi{\dccare{j}\ndccare{b}\dccare{j}}\hishi{あ\dccare{g}}\hishi{A\dccare{j}}\hishi{田\ndccare{a}} \end{quotation} \section{The kakko series} The commands introduced below are used in exactly the same way as the maru series. \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{ばばば} \\ \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 period} & \texttt{\textbackslash ichimoji} \\ \hline 1 & \nykakko{1} & \namikakko{1} & \kagikakko{1} & \nkagikakko{1} & \period{1} & \ichimoji{1} \\ 97 & \nykakko{97} & \namikakko{97} & \kagikakko{97} & \nkagikakko{97} & \period{97} & \ichimoji{97} \\ だ & \nykakko{だ} & \namikakko{だ} & \kagikakko{だ} & \nkagikakko{だ} & \period{だ} & \ichimoji{だ} \\ ばばば & \nykakko{ばばば} & \namikakko{ばばば} & \kagikakko{ばばば} & \nkagikakko{ばばば} & \period{ばばば} & \ichimoji{ばばば} \\ \hline \end{tabular} }\bigskip Examples with lowercase alphabet characters are additionally provided. \begin{lstlisting} \kakko{\dccare{g}}\kakko{\dccare{ggg}}\kakko{\dccare{j}}\kakko{\dccare{jjj}}\kakko{\ndccare{a}} \kakko{\dccare{j}\ndccare{b}\dccare{j}}\kakko{あ\dccare{g}}\kakko{A\dccare{j}}\kakko{田\ndccare{a}} \end{lstlisting} \begin{quotation} \kakko{\dccare{g}}\kakko{\dccare{ggg}}\kakko{\dccare{j}}\kakko{\dccare{jjj}}\kakko{\ndccare{a}} \kakko{\dccare{j}\ndccare{b}\dccare{j}}\kakko{あ\dccare{g}}\kakko{A\dccare{j}}\kakko{田\ndccare{a}} \end{quotation} \noindent\triangleright \ \underline{\bfseries \textbackslash ichimoji}\\ On 2025/10/18, I added \verb|\ichimoji| command which forces ANY arguments to fit in zenkaku width (=1em). \begin{quotation} \fbox{123}\fbox{あいう}\ichimoji{123}\ichimoji{あいう} \end{quotation} \section{License} Released under the \href{https://www.latex-project.org/lppl/}{LaTeX Project Public License (LPPL) 1.3c}. \clearpage\section{Example outputs} \begin{lstlisting} \maru{\slowcare{a}} \maru{\slowcare{b}} \maru{\slowcare{c}} \maru{\slowcare{d}} \maru{\slowcare{e}} \maru{\slowcare{f}} \maru{\slowcare{g}} \maru{\slowcare{h}} \maru{\slowcare{i}} \maru{\slowcare{j}} \maru{\slowcare{k}} \maru{\slowcare{l}} \maru{\slowcare{m}} \maru{\slowcare{n}} \maru{\slowcare{o}} \maru{\slowcare{p}} \maru{\slowcare{q}} \maru{\slowcare{r}} \maru{\slowcare{s}} \maru{\slowcare{t}} \maru{\slowcare{u}} \maru{\slowcare{v}} \maru{\slowcare{w}} \maru{\slowcare{x}} \maru{\slowcare{y}} \maru{\slowcare{z}} \maru{A} \maru{B} \maru{C} \maru{D} \maru{E} \maru{F} \maru{G} \maru{H} \maru{I} \maru{J} \maru{K} \maru{L} \maru{M} \maru{N} \maru{O} \maru{P} \maru{\dccare{Q}} \maru{R} \maru{S} \maru{T} \maru{U} \maru{V} \maru{W} \maru{X} \maru{Y} \maru{Z} \seihou{\slowcare{a}} \seihou{\slowcare{b}} \seihou{\slowcare{c}} \seihou{\slowcare{d}} \seihou{\slowcare{e}} \seihou{\slowcare{f}} \seihou{\slowcare{g}} \seihou{\slowcare{h}} \seihou{\slowcare{i}} \seihou{\slowcare{j}} \seihou{\slowcare{k}} \seihou{\slowcare{l}} \seihou{\slowcare{m}} \seihou{\slowcare{n}} \seihou{\slowcare{o}} \seihou{\slowcare{p}} \seihou{\slowcare{q}} \seihou{\slowcare{r}} \seihou{\slowcare{s}} \seihou{\slowcare{t}} \seihou{\slowcare{u}} \seihou{\slowcare{v}} \seihou{\slowcare{w}} \seihou{\slowcare{x}} \seihou{\slowcare{y}} \seihou{\slowcare{z}} \seihou{A} \seihou{B} \seihou{C} \seihou{D} \seihou{E} \seihou{F} \seihou{G} \seihou{H} \seihou{I} \seihou{J} \seihou{K} \seihou{L} \seihou{M} \seihou{N} \seihou{O} \seihou{P} \seihou{\dccare{Q}} \seihou{R} \seihou{S} \seihou{T} \seihou{U} \seihou{V} \seihou{W} \seihou{X} \seihou{Y} \seihou{Z} \hishi{\slowcare{a}} \hishi{\slowcare{b}} \hishi{\slowcare{c}} \hishi{\slowcare{d}} \hishi{\slowcare{e}} \hishi{\slowcare{f}} \hishi{\slowcare{g}} \hishi{\slowcare{h}} \hishi{\slowcare{i}} \hishi{\slowcare{j}} \hishi{\slowcare{k}} \hishi{\slowcare{l}} \hishi{\slowcare{m}} \hishi{\slowcare{n}} \hishi{\slowcare{o}} \hishi{\slowcare{p}} \hishi{\slowcare{q}} \hishi{\slowcare{r}} \hishi{\slowcare{s}} \hishi{\slowcare{t}} \hishi{\slowcare{u}} \hishi{\slowcare{v}} \hishi{\slowcare{w}} \hishi{\slowcare{x}} \hishi{\slowcare{y}} \hishi{\slowcare{z}} \hishi{A} \hishi{B} \hishi{C} \hishi{D} \hishi{E} \hishi{F} \hishi{G} \hishi{H} \hishi{I} \hishi{J} \hishi{K} \hishi{L} \hishi{M} \hishi{N} \hishi{O} \hishi{P} \hishi{\dccare{Q}} \hishi{R} \hishi{S} \hishi{T} \hishi{U} \hishi{V} \hishi{W} \hishi{X} \hishi{Y} \hishi{Z} \kakko{\slowcare{a}} \kakko{\slowcare{b}} \kakko{\slowcare{c}} \kakko{\slowcare{d}} \kakko{\slowcare{e}} \kakko{\slowcare{f}} \kakko{\slowcare{g}} \kakko{\slowcare{h}} \kakko{\slowcare{i}} \kakko{\slowcare{j}} \kakko{\slowcare{k}} \kakko{\slowcare{l}} \kakko{\slowcare{m}} \kakko{\slowcare{n}} \kakko{\slowcare{o}} \kakko{\slowcare{p}} \kakko{\slowcare{q}} \kakko{\slowcare{r}} \kakko{\slowcare{s}} \kakko{\slowcare{t}} \kakko{\slowcare{u}} \kakko{\slowcare{v}} \kakko{\slowcare{w}} \kakko{\slowcare{x}} \kakko{\slowcare{y}} \kakko{\slowcare{z}} \kakko{A} \kakko{B} \kakko{C} \kakko{D} \kakko{E} \kakko{F} \kakko{G} \kakko{H} \kakko{I} \kakko{J} \kakko{K} \kakko{L} \kakko{M} \kakko{N} \kakko{O} \kakko{P} \kakko{\dccare{Q}} \kakko{R} \kakko{S} \kakko{T} \kakko{U} \kakko{V} \kakko{W} \kakko{X} \kakko{Y} \kakko{Z} \end{lstlisting} \maru{\slowcare{a}} \maru{\slowcare{b}} \maru{\slowcare{c}} \maru{\slowcare{d}} \maru{\slowcare{e}} \maru{\slowcare{f}} \maru{\slowcare{g}} \maru{\slowcare{h}} \maru{\slowcare{i}} \maru{\slowcare{j}} \maru{\slowcare{k}} \maru{\slowcare{l}} \maru{\slowcare{m}} \maru{\slowcare{n}} \maru{\slowcare{o}} \maru{\slowcare{p}} \maru{\slowcare{q}} \maru{\slowcare{r}} \maru{\slowcare{s}} \maru{\slowcare{t}} \maru{\slowcare{u}} \maru{\slowcare{v}} \maru{\slowcare{w}} \maru{\slowcare{x}} \maru{\slowcare{y}} \maru{\slowcare{z}} \maru{A} \maru{B} \maru{C} \maru{D} \maru{E} \maru{F} \maru{G} \maru{H} \maru{I} \maru{J} \maru{K} \maru{L} \maru{M} \maru{N} \maru{O} \maru{P} \maru{\dccare{Q}} \maru{R} \maru{S} \maru{T} \maru{U} \maru{V} \maru{W} \maru{X} \maru{Y} \maru{Z} \seihou{\slowcare{a}} \seihou{\slowcare{b}} \seihou{\slowcare{c}} \seihou{\slowcare{d}} \seihou{\slowcare{e}} \seihou{\slowcare{f}} \seihou{\slowcare{g}} \seihou{\slowcare{h}} \seihou{\slowcare{i}} \seihou{\slowcare{j}} \seihou{\slowcare{k}} \seihou{\slowcare{l}} \seihou{\slowcare{m}} \seihou{\slowcare{n}} \seihou{\slowcare{o}} \seihou{\slowcare{p}} \seihou{\slowcare{q}} \seihou{\slowcare{r}} \seihou{\slowcare{s}} \seihou{\slowcare{t}} \seihou{\slowcare{u}} \seihou{\slowcare{v}} \seihou{\slowcare{w}} \seihou{\slowcare{x}} \seihou{\slowcare{y}} \seihou{\slowcare{z}} \seihou{A} \seihou{B} \seihou{C} \seihou{D} \seihou{E} \seihou{F} \seihou{G} \seihou{H} \seihou{I} \seihou{J} \seihou{K} \seihou{L} \seihou{M} \seihou{N} \seihou{O} \seihou{P} \seihou{\dccare{Q}} \seihou{R} \seihou{S} \seihou{T} \seihou{U} \seihou{V} \seihou{W} \seihou{X} \seihou{Y} \seihou{Z} \hishi{\slowcare{a}} \hishi{\slowcare{b}} \hishi{\slowcare{c}} \hishi{\slowcare{d}} \hishi{\slowcare{e}} \hishi{\slowcare{f}} \hishi{\slowcare{g}} \hishi{\slowcare{h}} \hishi{\slowcare{i}} \hishi{\slowcare{j}} \hishi{\slowcare{k}} \hishi{\slowcare{l}} \hishi{\slowcare{m}} \hishi{\slowcare{n}} \hishi{\slowcare{o}} \hishi{\slowcare{p}} \hishi{\slowcare{q}} \hishi{\slowcare{r}} \hishi{\slowcare{s}} \hishi{\slowcare{t}} \hishi{\slowcare{u}} \hishi{\slowcare{v}} \hishi{\slowcare{w}} \hishi{\slowcare{x}} \hishi{\slowcare{y}} \hishi{\slowcare{z}} \hishi{A} \hishi{B} \hishi{C} \hishi{D} \hishi{E} \hishi{F} \hishi{G} \hishi{H} \hishi{I} \hishi{J} \hishi{K} \hishi{L} \hishi{M} \hishi{N} \hishi{O} \hishi{P} \hishi{\dccare{Q}} \hishi{R} \hishi{S} \hishi{T} \hishi{U} \hishi{V} \hishi{W} \hishi{X} \hishi{Y} \hishi{Z} \kakko{\slowcare{a}} \kakko{\slowcare{b}} \kakko{\slowcare{c}} \kakko{\slowcare{d}} \kakko{\slowcare{e}} \kakko{\slowcare{f}} \kakko{\slowcare{g}} \kakko{\slowcare{h}} \kakko{\slowcare{i}} \kakko{\slowcare{j}} \kakko{\slowcare{k}} \kakko{\slowcare{l}} \kakko{\slowcare{m}} \kakko{\slowcare{n}} \kakko{\slowcare{o}} \kakko{\slowcare{p}} \kakko{\slowcare{q}} \kakko{\slowcare{r}} \kakko{\slowcare{s}} \kakko{\slowcare{t}} \kakko{\slowcare{u}} \kakko{\slowcare{v}} \kakko{\slowcare{w}} \kakko{\slowcare{x}} \kakko{\slowcare{y}} \kakko{\slowcare{z}} \kakko{A} \kakko{B} \kakko{C} \kakko{D} \kakko{E} \kakko{F} \kakko{G} \kakko{H} \kakko{I} \kakko{J} \kakko{K} \kakko{L} \kakko{M} \kakko{N} \kakko{O} \kakko{P} \kakko{\dccare{Q}} \kakko{R} \kakko{S} \kakko{T} \kakko{U} \kakko{V} \kakko{W} \kakko{X} \kakko{Y} \kakko{Z} \section{Version History} \begin{itemize} \item \textbf{v1.0.0 (2025/10/03)} --- Initial public release. \item \textbf{v1.0.1 (2025/10/04)} --- Added \verb|\slowcare|, and adjusted \verb|\dccare|. \item \textbf{v1.0.2 (2025/10/05)} --- Fixed a problem related to dependency environments. \item \textbf{v1.0.3 (2025/10/12)} --- Fixed a problem related to maru series. \item \textbf{v1.0.4 (2025/10/18)} --- Added \verb|\ichimoji| command. \item \textbf{v1.1.0 (2025/10/28)} --- Unify all commands to zenkaku width. \end{itemize} \section{Source Code} \begin{lstlisting} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{KKsymbols}[2025/10/28, Version 1.1.0] \RequirePackage{luatexja-adjust} \RequirePackage{expl3} \RequirePackage{calc} \RequirePackage{tikz} \usetikzlibrary{shapes} \newcommand{\dccare}[1]{% \ifnum\ltjgetparameter{direction}=3 % 縦書き \vphantom{田}\raisebox{\dimexpr.09\dimexpr\f@size pt\relax}{\scalebox{1}[.9]{#1}}% \else % 横書き \vphantom{田}\raisebox{\dimexpr.155\dimexpr\f@size pt\relax}{\scalebox{1}[.9]{#1}}% \fi } \newcommand{\ndccare}[1]{\vphantom{田}#1} \newcommand{\VerticalAdjustSlowcare}{% \ifnum\ltjgetparameter{direction}=3 0em % 縦組 \else -.04em % 横組 \fi } \newcommand{\VerticalAdjustSlowcareX}{% \ifnum\ltjgetparameter{direction}=3 0em % 縦組 \else .35em % 横組 \fi } \ExplSyntaxOn \newsavebox\jpmid_box \NewDocumentCommand{\slowcare}{m} { \jpmid_iterate:n { \ndccare{\raisebox{\VerticalAdjustSlowcare}{#1}} } } \cs_new_protected:Nn \jpmid_iterate:n { \tl_map_inline:nn { #1 } { \sbox\jpmid_box{##1}% \raisebox{-\dimexpr(\ht\jpmid_box-\dp\jpmid_box)/2\relax + \dimexpr\VerticalAdjustSlowcareX}{\usebox\jpmid_box}% } } \ExplSyntaxOff \newcommand{\VerticalAdjustMaru}{% \ifnum\ltjgetparameter{direction}=3 -0.035ex % 縦組 \else 0.19ex % 横組 \fi } \newcommand{\VerticalAdjustNMaru}{% \ifnum\ltjgetparameter{direction}=3 -0.035ex % 縦組 \else 0.23ex % 横組 \fi } \newcommand{\maybescale}[3]{% \ifdim #1 > #2% \ifdim #1 > 0pt% \edef\scalefactor{% \fpeval{ \strip@pt\dimexpr #2\relax / \strip@pt\dimexpr #1\relax }% }% \else% \def\scalefactor{1}% \fi% \scalebox{\scalefactor}[1]{#3}% \else% #3% \fi% } %maru系縦方向 \newcommand{\maybescaleV}[3]{% \ifnum\ltjgetparameter{direction}=3 #3% \else \ifdim \dimexpr 1.5\dimexpr #1\relax < #2% \edef\verticalscale{% \fpeval{0.72 * (\strip@pt\dimexpr #2\relax / \strip@pt\dimexpr #1\relax)}% }% \scalebox{1}[\verticalscale]{#3}% \else% #3% \fi% \fi } %seihou系縦方向 \newcommand{\maybescaleVV}[3]{% \ifnum\ltjgetparameter{direction}=3 #3% \else \ifdim \dimexpr 1.5\dimexpr #1\relax < #2% \edef\verticalscale{% \fpeval{0.64 * (\strip@pt\dimexpr #2\relax / \strip@pt\dimexpr #1\relax)}% }% \scalebox{1}[\verticalscale]{#3}% \else% #3% \fi% \fi } %hishi系縦方向 \newcommand{\maybescaleVVV}[3]{% \ifnum\ltjgetparameter{direction}=3 #3% \else \ifdim \dimexpr 1.5\dimexpr #1\relax < #2% \edef\verticalscale{% \fpeval{0.58 * (\strip@pt\dimexpr #2\relax / \strip@pt\dimexpr #1\relax)}% }% \scalebox{1}[\verticalscale]{#3}% \else% #3% \fi% \fi } %kakko系 \newcommand{\maybescaleVVVV}[3]{% \ifnum\ltjgetparameter{direction}=3 #3% \else \ifdim \dimexpr 1.5\dimexpr #1\relax < #2% \edef\verticalscale{% \fpeval{0.58 * (\strip@pt\dimexpr #2\relax / \strip@pt\dimexpr #1\relax)}% }% \scalebox{1}[\verticalscale]{#3}% \else% #3% \fi% \fi } \newlength{\maru@boxwidth} \newlength{\maru@textwidth} \newlength{\maru@textheight} \DeclareRobustCommand{\maru}[1]{% \settowidth{\maru@textwidth}{#1}% \settoheight{\maru@textheight}{#1}% \setlength{\maru@boxwidth}{\f@size pt}% \ltjghostbeforejachar% \vphantom{羅}\raisebox{\VerticalAdjustMaru}{% \hbox to \maru@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[ shape=circle, line width=0.08ex, minimum size=.9\maru@boxwidth, draw, inner sep=\dimexpr -0.22\dimexpr\f@size pt ] (char){% \raisebox{0.033ex}{\scalebox{0.75}{\vphantom{羅}\makebox[.83\maru@boxwidth][c]{\maybescale{\maru@textwidth}{.8\maru@boxwidth}{\maybescaleV{\maru@textheight}{1.03\maru@boxwidth}{#1}}}}}% }; }% \hss }% }% \ltjghostafterjachar } \newlength{\kuromaru@boxwidth} \newlength{\kuromaru@textwidth} \newlength{\kuromaru@textheight} \DeclareRobustCommand{\kuromaru}[1]{% \settowidth{\kuromaru@textwidth}{#1}% \settoheight{\kuromaru@textheight}{#1}% \setlength{\kuromaru@boxwidth}{\f@size pt}% \ltjghostbeforejachar% \vphantom{羅}\raisebox{\VerticalAdjustMaru}{% \hbox to \kuromaru@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[ shape=circle, line width=0.08ex, minimum size=.9\kuromaru@boxwidth, draw, fill=black, inner sep=\dimexpr -0.22\dimexpr\f@size pt ] (char){% \raisebox{0.033ex}{\textcolor{white}{\scalebox{0.75}{\vphantom{羅}\makebox[.85\kuromaru@boxwidth][c]{\maybescale{\kuromaru@textwidth}{.82\kuromaru@boxwidth}{\maybescaleV{\kuromaru@textheight}{1.03\kuromaru@boxwidth}{#1}}}}}}% }; }% \hss }% }% \ltjghostafterjachar } \newlength{\nmaru@boxwidth} \newlength{\nmaru@textwidth} \newlength{\nmaru@textheight} \DeclareRobustCommand{\nmaru}[1]{% \settowidth{\nmaru@textwidth}{#1}% \settoheight{\nmaru@textheight}{#1}% \setlength{\nmaru@boxwidth}{\f@size pt}% \ltjghostbeforejachar% \vphantom{羅}\raisebox{\VerticalAdjustNMaru}{% \hbox to 1.02\nmaru@boxwidth{% \hss \tikz[baseline=(char.base),scale=.93]{% \node[ shape=circle, line width=0.06ex, minimum size=.9\nmaru@boxwidth, draw, double, double distance=0.08ex, inner sep=\dimexpr -0.22\dimexpr\f@size pt ] (char){% \raisebox{0.033ex}{\scalebox{0.7}{\vphantom{羅}\makebox[.85\nmaru@boxwidth][c]{\maybescale{\nmaru@textwidth}{.81\nmaru@boxwidth}{\maybescaleV{\nmaru@textheight}{1.03\nmaru@boxwidth}{#1}}}}}% }; }% \hss }% }% \ltjghostafterjachar } \newcommand{\VerticalAdjustMaruX}{% \ifnum\ltjgetparameter{direction}=3 -.13ex % 縦組 \else -.11ex % 横組 \fi } \newcommand{\VerticalAdjustMaruY}{% \ifnum\ltjgetparameter{direction}=3 .124ex % 縦組 \else .25ex % 横組 \fi } \newlength{\seihou@boxwidth} \newlength{\seihou@textwidth} \newlength{\seihou@textheight} \DeclareRobustCommand{\seihou}[1]{% \settowidth{\seihou@textwidth}{#1}% \settoheight{\seihou@textheight}{#1}% \setlength{\seihou@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustMaruX}{% \mbox{% \hbox to \seihou@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[draw, line width=0.08ex, minimum size=\dimexpr 0.88\dimexpr\f@size pt, inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center] (char) {\vphantom{\raisebox{0.124ex}{羅}}{\raisebox{\VerticalAdjustMaruY}{\scalebox{.8}{\hspace*{\dimexpr 0.1\seihou@boxwidth}\makebox[.82\seihou@boxwidth][c]{\maybescale{\seihou@textwidth}{.82\seihou@boxwidth}{\maybescaleVV{\seihou@textheight}{1.23\seihou@boxwidth}{#1}}}\hspace*{\dimexpr 0.1\seihou@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\kuroseihou@boxwidth} \newlength{\kuroseihou@textwidth} \newlength{\kuroseihou@textheight} \DeclareRobustCommand{\kuroseihou}[1]{% \settowidth{\kuroseihou@textwidth}{#1}% \settoheight{\kuroseihou@textheight}{#1}% \setlength{\kuroseihou@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustMaruX}{% \mbox{% \hbox to \kuroseihou@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[draw, fill=black, line width=0.08ex, minimum size=\dimexpr 0.88\dimexpr\f@size pt, inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center] (char) {\vphantom{\raisebox{0.124ex}{羅}}{\raisebox{\VerticalAdjustMaruY}{\scalebox{.8}{\hspace*{\dimexpr 0.1\kuroseihou@boxwidth}\textcolor{white}{\makebox[.82\kuroseihou@boxwidth][c]{\maybescale{\kuroseihou@textwidth}{.82\kuroseihou@boxwidth}{\maybescaleVV{\kuroseihou@textheight}{1.23\kuroseihou@boxwidth}{#1}}}}\hspace*{\dimexpr 0.1\kuroseihou@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\seimaru@boxwidth} \newlength{\seimaru@textwidth} \newlength{\seimaru@textheight} \DeclareRobustCommand{\seimaru}[1]{% \settowidth{\seimaru@textwidth}{#1}% \settoheight{\seimaru@textheight}{#1}% \setlength{\seimaru@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustMaruX}{% \mbox{% \hbox to \seimaru@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[draw, rounded corners=0.435ex, line width=0.08ex, minimum size=.88\seimaru@boxwidth, inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center] (char) {\vphantom{\raisebox{0.124ex}{羅}}{\raisebox{\VerticalAdjustMaruY}{\scalebox{.8}{\hspace*{\dimexpr 0.1\seimaru@boxwidth}\makebox[.8\seimaru@boxwidth][c]{\maybescale{\seimaru@textwidth}{.82\seimaru@boxwidth}{\maybescaleVV{\seimaru@textheight}{1.23\seimaru@boxwidth}{#1}}}\hspace*{\dimexpr 0.1\seimaru@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\kuroseimaru@boxwidth} \newlength{\kuroseimaru@textwidth} \newlength{\kuroseimaru@textheight} \DeclareRobustCommand{\kuroseimaru}[1]{% \settowidth{\kuroseimaru@textwidth}{#1}% \settoheight{\kuroseimaru@textheight}{#1}% \setlength{\kuroseimaru@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustMaruX}{% \mbox{% \hbox to \kuroseimaru@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[draw, fill=black, rounded corners=0.435ex, line width=0.08ex, minimum size=.88\kuroseimaru@boxwidth, inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center] (char) {\vphantom{\raisebox{0.124ex}{羅}}{\raisebox{\VerticalAdjustMaruY}{\scalebox{.8}{\hspace*{\dimexpr 0.1\kuroseimaru@boxwidth}\textcolor{white}{\makebox[.8\kuroseimaru@boxwidth][c]{\maybescale{\kuroseimaru@textwidth}{.82\kuroseimaru@boxwidth}{\maybescaleVV{\kuroseimaru@textheight}{1.23\kuroseimaru@boxwidth}{#1}}}}\hspace*{\dimexpr 0.1\kuroseimaru@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newcommand{\VerticalAdjustMaruZ}{% \ifnum\ltjgetparameter{direction}=3 .1ex % 縦組 \else .42ex % 横組 \fi } \newlength{\hishi@boxwidth} \newlength{\hishi@textwidth} \newlength{\hishi@textheight} \DeclareRobustCommand{\hishi}[1]{% \settowidth{\hishi@textwidth}{#1}% \settoheight{\hishi@textheight}{#1}% \setlength{\hishi@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustMaruX}{% \mbox{% \hbox to \hishi@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[draw, shape=diamond, line width=0.08ex, minimum size=\dimexpr 0.95\dimexpr\f@size pt, inner sep=-\dimexpr .13\hishi@boxwidth, align=center] (char) {\vphantom{\raisebox{0.124ex}{羅}}{\raisebox{\VerticalAdjustMaruZ}{\scalebox{.53}{\hspace*{\dimexpr 0.1\hishi@boxwidth}\makebox[.67\hishi@boxwidth][c]{\maybescale{\hishi@textwidth}{.67\hishi@boxwidth}{\maybescaleVVV{\hishi@textheight}{1.7\hishi@boxwidth}{#1}}}\hspace*{\dimexpr 0.1\hishi@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\kurohishi@boxwidth} \newlength{\kurohishi@textwidth} \newlength{\kurohishi@textheight} \DeclareRobustCommand{\kurohishi}[1]{% \settowidth{\kurohishi@textwidth}{#1}% \settoheight{\kurohishi@textheight}{#1}% \setlength{\kurohishi@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustMaruX}{% \mbox{% \hbox to \kurohishi@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[draw, shape=diamond, fill=black, line width=0.08ex, minimum size=\dimexpr 0.95\dimexpr\f@size pt, inner sep=-\dimexpr .13\kurohishi@boxwidth, align=center] (char) {\vphantom{\raisebox{0.124ex}{羅}}{\raisebox{\VerticalAdjustMaruZ}{\scalebox{.53}{\hspace*{\dimexpr 0.1\kurohishi@boxwidth}\textcolor{white}{\makebox[.67\kurohishi@boxwidth][c]{\maybescale{\kurohishi@textwidth}{.67\kurohishi@boxwidth}{\maybescaleVVV{\kurohishi@textheight}{1.7\kurohishi@boxwidth}{#1}}}\hspace*{\dimexpr 0.1\kurohishi@boxwidth}}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\maruhishi@boxwidth} \newlength{\maruhishi@textwidth} \newlength{\maruhishi@textheight} \DeclareRobustCommand{\maruhishi}[1]{% \settowidth{\maruhishi@textwidth}{#1}% \settoheight{\maruhishi@textheight}{#1}% \setlength{\maruhishi@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustMaruX}{% \mbox{% \hbox to \maruhishi@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[draw, rounded corners=0.3ex, shape=diamond, line width=0.08ex, minimum size=\dimexpr 0.95\dimexpr\f@size pt, inner sep=-\dimexpr .13\maruhishi@boxwidth, align=center] (char) {\vphantom{\raisebox{0.124ex}{羅}}{\raisebox{\VerticalAdjustMaruZ}{\scalebox{.53}{\hspace*{\dimexpr 0.1\maruhishi@boxwidth}\makebox[.67\maruhishi@boxwidth][c]{\maybescale{\maruhishi@textwidth}{.67\maruhishi@boxwidth}{\maybescaleVVV{\maruhishi@textheight}{1.7\maruhishi@boxwidth}{#1}}}\hspace*{\dimexpr 0.1\maruhishi@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\kuromaruhishi@boxwidth} \newlength{\kuromaruhishi@textwidth} \newlength{\kuromaruhishi@textheight} \DeclareRobustCommand{\kuromaruhishi}[1]{% \settowidth{\kuromaruhishi@textwidth}{#1}% \settoheight{\kuromaruhishi@textheight}{#1}% \setlength{\kuromaruhishi@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustMaruX}{% \mbox{% \hbox to \kuromaruhishi@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[draw, fill=black, rounded corners=0.3ex, shape=diamond, line width=0.08ex, minimum size=\dimexpr 0.95\dimexpr\f@size pt, inner sep=-\dimexpr .13\kuromaruhishi@boxwidth, align=center] (char) {\vphantom{\raisebox{0.124ex}{羅}}{\raisebox{\VerticalAdjustMaruZ}{\scalebox{.57}{\hspace*{\dimexpr 0.1\kuromaruhishi@boxwidth}\textcolor{white}{\makebox[.67\kuromaruhishi@boxwidth][c]{\maybescale{\kuromaruhishi@textwidth}{.67\kuromaruhishi@boxwidth}{\maybescaleVVV{\kuromaruhishi@textheight}{1.7\kuromaruhishi@boxwidth}{#1}}}\hspace*{\dimexpr 0.1\kuromaruhishi@boxwidth}}}}}}; }\hss}}}\ltjghostafterjachar } \newcommand{\VerticalAdjustKakkoX}{% \ifnum\ltjgetparameter{direction}=3 -0ex % 縦組 \else -0ex % 横組 \fi } \newlength{\kakko@boxwidth} \newlength{\kakko@textwidth} \newlength{\kakko@textheight} \DeclareRobustCommand{\kakko}[1]{% \settowidth{\kakko@textwidth}{#1}% \settoheight{\kakko@textheight}{#1}% \setlength{\kakko@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustKakkoX}{% \mbox{% \hbox to \kakko@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center, minimum size=.8\kakko@boxwidth] (char) {{\raisebox{\VerticalAdjustKakkoX}{\scalebox{1}{\hspace*{\dimexpr 0.02\kakko@boxwidth}\makebox[.5\kakko@boxwidth][c]{\scalebox{.65}[1]{(}\maybescale{\kakko@textwidth}{.5\kakko@boxwidth}{\maybescaleVVVV{\kakko@textheight}{1.23\kakko@boxwidth}{#1}}\scalebox{.65}[1]{)}}\hspace*{\dimexpr 0.02\kakko@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\sumikakko@boxwidth} \newlength{\sumikakko@textwidth} \newlength{\sumikakko@textheight} \DeclareRobustCommand{\sumikakko}[1]{% \settowidth{\sumikakko@textwidth}{#1}% \settoheight{\sumikakko@textheight}{#1}% \setlength{\sumikakko@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustKakkoX}{% \mbox{% \hbox to \sumikakko@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center, minimum size=.8\sumikakko@boxwidth] (char) {{\raisebox{\VerticalAdjustKakkoX}{\scalebox{1}{\hspace*{\dimexpr 0.02\sumikakko@boxwidth}\makebox[.5\sumikakko@boxwidth][c]{\scalebox{.6}[1]{【}\maybescale{\sumikakko@textwidth}{.5\sumikakko@boxwidth}{\maybescaleVVVV{\sumikakko@textheight}{1.23\sumikakko@boxwidth}{#1}}\scalebox{.6}[1]{】}}\hspace*{\dimexpr 0.02\sumikakko@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\kakukakko@boxwidth} \newlength{\kakukakko@textwidth} \newlength{\kakukakko@textheight} \DeclareRobustCommand{\kakukakko}[1]{% \settowidth{\kakukakko@textwidth}{#1}% \settoheight{\kakukakko@textheight}{#1}% \setlength{\kakukakko@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustKakkoX}{% \mbox{% \hbox to \kakukakko@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center, minimum size=.8\kakukakko@boxwidth] (char) {{\raisebox{\VerticalAdjustKakkoX}{\scalebox{1}{\hspace*{\dimexpr 0.02\kakukakko@boxwidth}\makebox[.5\kakukakko@boxwidth][c]{\scalebox{.6}[1]{[}\maybescale{\kakukakko@textwidth}{.5\kakukakko@boxwidth}{\maybescaleVVVV{1.23\kakukakko@textheight}{\kakukakko@boxwidth}{#1}}\scalebox{.6}[1]{]}}\hspace*{\dimexpr 0.02\kakukakko@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\kikakko@boxwidth} \newlength{\kikakko@textwidth} \newlength{\kikakko@textheight} \DeclareRobustCommand{\kikakko}[1]{% \settowidth{\kikakko@textwidth}{#1}% \settoheight{\kikakko@textheight}{#1}% \setlength{\kikakko@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustKakkoX}{% \mbox{% \hbox to \kikakko@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center, minimum size=.8\kikakko@boxwidth] (char) {{\raisebox{\VerticalAdjustKakkoX}{\scalebox{1}{\hspace*{\dimexpr 0.02\kikakko@boxwidth}\makebox[.5\kikakko@boxwidth][c]{\scalebox{.6}[1]{〔}\maybescale{\kikakko@textwidth}{.5\kikakko@boxwidth}{\maybescaleVVVV{1.23\kikakko@textheight}{\kikakko@boxwidth}{#1}}\scalebox{.6}[1]{〕}}\hspace*{\dimexpr 0.02\kikakko@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\ykakko@boxwidth} \newlength{\ykakko@textwidth} \newlength{\ykakko@textheight} \DeclareRobustCommand{\ykakko}[1]{% \settowidth{\ykakko@textwidth}{#1}% \settoheight{\ykakko@textheight}{#1}% \setlength{\ykakko@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustKakkoX}{% \mbox{% \hbox to \ykakko@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center, minimum size=.8\ykakko@boxwidth] (char) {{\raisebox{\VerticalAdjustKakkoX}{\scalebox{1}{\hspace*{\dimexpr 0.02\ykakko@boxwidth}\makebox[.5\ykakko@boxwidth][c]{\scalebox{.6}[1]{〈}\maybescale{\ykakko@textwidth}{.5\ykakko@boxwidth}{\maybescaleVVVV{1.23\ykakko@textheight}{\ykakko@boxwidth}{#1}}\scalebox{.6}[1]{〉}}\hspace*{\dimexpr 0.02\ykakko@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\nykakko@boxwidth} \newlength{\nykakko@textwidth} \newlength{\nykakko@textheight} \DeclareRobustCommand{\nykakko}[1]{% \settowidth{\nykakko@textwidth}{#1}% \settoheight{\nykakko@textheight}{#1}% \setlength{\nykakko@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustKakkoX}{% \mbox{% \hbox to \nykakko@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center, minimum size=.8\nykakko@boxwidth] (char) {{\raisebox{\VerticalAdjustKakkoX}{\scalebox{1}{\hspace*{\dimexpr 0.02\nykakko@boxwidth}\makebox[.5\nykakko@boxwidth][c]{\scalebox{.6}[1]{《}\maybescale{\nykakko@textwidth}{.5\nykakko@boxwidth}{\maybescaleVVVV{1.23\nykakko@textheight}{\nykakko@boxwidth}{#1}}\scalebox{.6}[1]{》}}\hspace*{\dimexpr 0.02\nykakko@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\namikakko@boxwidth} \newlength{\namikakko@textwidth} \newlength{\namikakko@textheight} \DeclareRobustCommand{\namikakko}[1]{% \settowidth{\namikakko@textwidth}{#1}% \settoheight{\namikakko@textheight}{#1}% \setlength{\namikakko@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustKakkoX}{% \mbox{% \hbox to \namikakko@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center, minimum size=.8\namikakko@boxwidth] (char) {{\raisebox{\VerticalAdjustKakkoX}{\scalebox{1}{\hspace*{\dimexpr 0.02\namikakko@boxwidth}\makebox[.5\namikakko@boxwidth][c]{\scalebox{.6}[1]{{}\maybescale{\namikakko@textwidth}{.5\namikakko@boxwidth}{\maybescaleVVVV{1.23\namikakko@textheight}{\namikakko@boxwidth}{#1}}\scalebox{.6}[1]{}}}\hspace*{\dimexpr 0.02\namikakko@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\kagikakko@boxwidth} \newlength{\kagikakko@textwidth} \newlength{\kagikakko@textheight} \DeclareRobustCommand{\kagikakko}[1]{% \settowidth{\kagikakko@textwidth}{#1}% \settoheight{\kagikakko@textheight}{#1}% \setlength{\kagikakko@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustKakkoX}{% \mbox{% \hbox to \kagikakko@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center, minimum size=.8\kagikakko@boxwidth] (char) {{\raisebox{\VerticalAdjustKakkoX}{\scalebox{1}{\hspace*{\dimexpr 0.02\kagikakko@boxwidth}\makebox[.5\kagikakko@boxwidth][c]{\scalebox{.6}[1]{「}\maybescale{\kagikakko@textwidth}{.5\kagikakko@boxwidth}{\maybescaleVVVV{1.23\kagikakko@textheight}{\kagikakko@boxwidth}{#1}}\scalebox{.6}[1]{」}}\hspace*{\dimexpr 0.02\kagikakko@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\nkagikakko@boxwidth} \newlength{\nkagikakko@textwidth} \newlength{\nkagikakko@textheight} \DeclareRobustCommand{\nkagikakko}[1]{% \settowidth{\nkagikakko@textwidth}{#1}% \settoheight{\nkagikakko@textheight}{#1}% \setlength{\nkagikakko@boxwidth}{\f@size pt}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustKakkoX}{% \mbox{% \hbox to \nkagikakko@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center, minimum size=.8\nkagikakko@boxwidth] (char) {{\raisebox{\VerticalAdjustKakkoX}{\scalebox{1}{\hspace*{\dimexpr 0.02\nkagikakko@boxwidth}\makebox[.5\nkagikakko@boxwidth][c]{\scalebox{.6}[1]{『}\maybescale{\nkagikakko@textwidth}{.5\nkagikakko@boxwidth}{\maybescaleVVVV{1.23\nkagikakko@textheight}{\nkagikakko@boxwidth}{#1}}\scalebox{.6}[1]{』}}\hspace*{\dimexpr 0.02\nkagikakko@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\period@boxwidth} \newlength{\period@textwidth} \newlength{\period@textheight} \DeclareRobustCommand{\period}[1]{% \settowidth{\period@textwidth}{#1}% \setlength{\period@boxwidth}{\f@size pt}% \settoheight{\period@textheight}{#1}% \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustKakkoX}{% \mbox{% \hbox to \period@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center, minimum size=.8\period@boxwidth] (char) {{\raisebox{\VerticalAdjustKakkoX}{\scalebox{1}{\hspace*{\dimexpr 0.02\period@boxwidth}\makebox[.5\period@boxwidth][c]{\maybescale{\period@textwidth}{.5\period@boxwidth}{\maybescaleVVVV{1.23\period@textheight}{\period@boxwidth}{#1}}\scalebox{1}[1]{.}}\hspace*{\dimexpr 0.02\period@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \newlength{\ichimoji@boxwidth} \newlength{\ichimoji@textwidth} \newlength{\ichimoji@textheight} \DeclareRobustCommand{\ichimoji}[1]{% \settowidth{\ichimoji@textwidth}{#1}% \setlength{\ichimoji@boxwidth}{\f@size pt}% \settoheight{\ichimoji@textheight}{#1}% \multiply\ichimoji@boxwidth by 100 % \divide\ichimoji@boxwidth by 100 % \ltjghostbeforejachar\vphantom{羅}\raisebox{\VerticalAdjustKakkoX}{% \mbox{% \hbox to \ichimoji@boxwidth{% \hss \tikz[baseline=(char.base)]{% \node[inner sep=-\dimexpr 0.125\dimexpr\f@size pt, align=center, minimum size=.8\ichimoji@boxwidth] (char) {{\raisebox{\VerticalAdjustKakkoX}{\scalebox{1}{\hspace*{\dimexpr 0.02\ichimoji@boxwidth}\makebox[\ichimoji@boxwidth][c]{\maybescale{\ichimoji@textwidth}{\ichimoji@boxwidth}{\maybescaleVVVV{\ichimoji@textheight}{\ichimoji@boxwidth}{#1}}}\hspace*{\dimexpr 0.02\ichimoji@boxwidth}}}}}; }\hss}}}\ltjghostafterjachar } \endinput \end{lstlisting} \end{document}