\documentclass[luatex,fontsize=8pt,paper=b5,twoside]{jlreq}% \usepackage{luwa-ul} \usepackage{hyperref} \usepackage{caption} \usepackage[most]{tcolorbox} \usepackage{fp} \usepackage{lltjext} \usepackage{luatexja-ruby} \usepackage{KKsymbols} \usepackage{listings} \lstset{ basicstyle=\ttfamily\small, keywordstyle=\color{blue}, commentstyle=\color{gray}, stringstyle=\color{red}, breaklines=true, breakatwhitespace=false, columns=flexible } % You can omit these font settings. \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] \renewfontfamily{\sffamily}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6] \renewfontfamily{\mcfamily}{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] \renewfontfamily{\gtfamily}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6] \providefontfamily{\mgfamily}{HiraMaruPro-W4} \newfontfamily{\sfhira}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6]\newjfontfamily{\sfhiraj}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6] \newfontfamily{\mchira}{HiraMinPro-W3}[BoldFont=HiraMinPro-W6]\newjfontfamily{\mchiraj}{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] \newfontfamily{\gthira}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6,FontFace={eb}{\shapedefault}{HiraKakuStd-W8}]\newjfontfamily{\gthiraj}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6,FontFace={eb}{\shapedefault}{HiraKakuStd-W8}] \newfontfamily{\mghira}{HiraMaruPro-W4}\newjfontfamily{\mghiraj}{HiraMaruPro-W4} \renewcommand{\sffamily}{\sfhira\sfhiraj} \renewcommand{\mcfamily}{\mchira\mchiraj} \renewcommand{\gtfamily}{\gthira\gthiraj} \renewcommand{\mgfamily}{\mghira\mghiraj} %%% \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}{ O{Input} 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{luwa-ul} Package Documentation} \author{Kosei Kawaguchi a.k.a. KKTeX} \date{Version 1.1.0 (2025/10/29)} \begin{document} \begin{titlepage} \maketitle \end{titlepage} \newpage \tableofcontents \newpage \section{設置(Installation)} インストール方法は、適切な箇所に\texttt{luwa-ul.sty}を配置し、\verb|\usepackage{luwa-ul}|と書き込むだけで完了です。オプションはありません。 (Place \texttt{luwa-ul.sty} in a directory where LaTeX can find it.) 依存性についてです。(Dependencies: ) \begin{itemize} \item luacolor, xcolor \item lua-ul \item calc, tikz \end{itemize} \noindent を内部的に仕様しています。(This package uses them internally.) \section{注意(Caution)} このパッケージはその実装の上でLua言語を仕様しているので、LuaLaTeXの上でのみ仕様できるパッケージとなっています。(This package internally uses Lua, so it can be compiled only by LuaLaTeX.) \section{提供されるコマンド(Commands)} 提供されるコマンドは以下の通りです。要望に応じて追加されることもありえます。 (The provided commands are as follows. I would add some more commands upon requests.) \noindent 1.Manual \begin{itemize} \item \verb|\underLineKK|, \verb|\overLineKK| \item \verb|\nijyusen|, \verb|\keshinijyusen| \item \verb|\thinHighLight|, \verb|\thickHighLight| \item \verb|\tenKK|, \verb|\dashKK|, \verb|\namiKK| \item \verb|\LineNumbering| \end{itemize} \noindent 2.Auto \begin{itemize} \item \verb|\underLineKKAuto|, \verb|\overLineKKAuto| \item \verb|\nijyusenAuto| \item \verb|\tenKKAuto|, \verb|\dashKKAuto|, \verb|\namiKKAuto| \end{itemize} \subsection{\textbackslash underLineKK} このコマンドは、\texttt{lua-ul}パッケージによって提供される\verb|\underLine|コマンドに対し、 \begin{itemize} \item 縦書き時のずれの解消 \item ルビがあった際の挙動の変化 \end{itemize} \noindent の2点において調整を施したものとなっています。 (This command is basically made out of \verb|\underLine| command, which is provided by \texttt{lua-ul} package. I added some adjustments on it in order to \begin{itemize} \item eliminate the misalignment in vertical writing mode. \item change its behavior when the argument includes phonetic guides. \end{itemize} ) 使い方は以下のようになります。(You can use it as follows: ) \begin{SourceCode}{TeX} \underLineKK[color=色, bottom=下線最下部の位置のずれ, heigth=下線の太さ(bottomの位置からの距離で計算)]{引数} \underLineKK[color=red]{あああああああああ} \underLineKK[bottom=.1em]{あああああああああ} \parbox[c][6cm][c]{3cm}{% \underLineKK{ああ\ruby{あ}{あ}あああああ} } \end{SourceCode} \begin{OutPut}{Output} 横書き: \underLineKK[color=red]{ああああ\footnote{あ}{ああああ}あああああ} \underLineKK[bottom=-.5em]{あああああああああ} 縦書き: \parbox[c][6cm][c]{3cm}{% \underLineKK{ああ\ruby{あ}{あ}あああああ} \underLineKK{ああああああ} } \end{OutPut} \subsection{\textbackslash overLineKK} このコマンドは\verb|\underLineKK|を使用しても作成が可能ですが、ショートカットとして用意しておきました。このコマンドは縦書き環境においては通常の\verb|\underLineKK|につけてあったルビ補正を抜いてあります。(This command can also be created using \verb|\underLineKK|, but it has been provided as a shortcut. In a vertical writing environment, this command omits the ruby adjustment that was included in the standard \verb|\underLineKK|.) \begin{SourceCode}{TeX} \overLineKK[color=色]{引数} \overLineKK[color=red]{あああああああああ} \parbox[c][6cm][c]{3cm}{% \overLineKK{ああ\ruby{あ}{あ}あああああ} } \end{SourceCode} \begin{OutPut}{Output} 横書き: \overLineKK[color=red]{あああああああああ} 縦書き: \parbox[c][6cm][c]{3cm}{% \overLineKK{ああ\ruby{あ}{あ}あああああ} } \end{OutPut} \subsection{\textbackslash nijyusen, \textbackslash keshinijyusen} これらのコマンドは\verb|\underLineKK|を入れ子にすることでも作成が可能ですが、\verb|keshinijyusen|に関してはルビの有無による補正をなくしてあります。(These commands can also be created by nesting \verb|\underLineKK|, but for \verb|keshinijyusen|, the adjustment for the presence or absence of ruby has been removed.) \begin{SourceCode}{TeX} \nijyusen[color=色, bottom=下線最下部の位置のずれ]{引数} \keshinijyusen[color=色]{引数} \nijyusen[color=red]{あああああああああ} \keshinijyusen{ああああああああ} \parbox[c][6cm][c]{3cm}{% \nijyusen[color=red]{ああ\ruby{あ}{あ}あああああ} \keshinijyusen{ああ\ruby{あ}{あ}あああああ} \nijyusen[color=red]{あああああああ} \keshinijyusen{あああああああ} } \end{SourceCode} \begin{OutPut}{Output} 横書き: \nijyusen[color=red]{あああああああああ} \keshinijyusen{ああああああああ} 縦書き: \parbox[c][6cm][c]{3cm}{% \nijyusen[color=red]{ああ\ruby{あ}{あ}あああああ} \keshinijyusen{ああ\ruby{あ}{あ}あああああ} \nijyusen[color=red]{あああああああ} \keshinijyusen{あああああああ} } \end{OutPut} \subsection{\textbackslash thinHighLight, \textbackslash thickHighLight} これらは蛍光ペンを引いたような出力を提供するコマンドです。ルビの有無に対する挙動が\verb|\underLineKK|のそれとは少々異なり、単なる並行移動だけではなく線の太さ自体も追随して動くという仕様にしてあります。(These are commands that provide an output resembling a highlight made with a fluorescent marker. Their behavior regarding the presence or absence of ruby differs slightly from that of \verb|\underLineKK|, as they are designed not only to shift position but also to have the line thickness itself adjust accordingly.) \begin{SourceCode}{TeX} \thinHighLight[color=色]{引数} \thickHighLight[color=色]{引数} \thinHighLight{あああああああああ} \thickHighLight[color=green]{あああああああああ} \parbox[c][6cm][c]{3cm}{% \thinHighLight{あああ\ruby{あ}{あ}ああああ} \thickHighLight[color=green]{ああ\ruby{あ}{あ}あああああ} \thinHighLight{あああああああああ} \thickHighLight[color=green]{あああああああああ} } \end{SourceCode} \begin{OutPut}{Output} 横書き: \thinHighLight{あああああああああ} \thickHighLight[color=green]{あああああああああ} 縦書き: \parbox[c][6cm][c]{3cm}{% \thinHighLight{あああ\ruby{あ}{あ}ああああ} \thickHighLight[color=green]{ああ\ruby{あ}{あ}あああああ} \thinHighLight{あああああああああ} \thickHighLight[color=green]{あああああああああ} } \end{OutPut} \subsection{\textbackslash namiKK} このコマンドは波線を引くコマンドを提供します。ルビに対する挙動は\verb|\underLineKK|のそれに同じです。(This command provides a wavy underline. Its behavior with respect to ruby is the same as that of \verb|\underLineKK|. ) \begin{SourceCode}{TeX} \namiKK[bottom=下線最下部の位置のずれ]{引数} \namiKK[bottom=.3em]{あああああああああ} \parbox[c][6cm][c]{3cm}{% \namiKK{あああ\ruby{あ}{あ}ああああ} \namiKK[bottom=.3em]{あああああああああ} } \end{SourceCode} \begin{OutPut}{Output} 横書き: \namiKK{あああああああああ} \namiKK[bottom=.3em]{あああああああああ} 縦書き: \parbox[c][6cm][c]{3cm}{% \namiKK{あああ\ruby{あ}{あ}ああああ} \namiKK[bottom=.3em]{あああああああああ} } \end{OutPut} \subsection{\textbackslash tenKK, \textbackslash dashKK} これらはそれぞれ、点線、破線を提供します。ルビに対する挙動は\verb|\underLineKK|のそれに同じです。(These commands provide dotted and dashed underlines, respectively. Their behavior toward ruby text is the same as that of \verb|\underLineKK|.) \begin{SourceCode}{TeX} \tenKK[bottom=下線最下部の位置のずれ, radius=ドットの半径, distance=ドット間距離]{引数} % デフォルト:radius=.1ex, distance=.4ex \dashKK[bottom=下線最下部の位置のずれ, width=破線の太さ, distance=破線間距離, length=破線の長さ]{引数} % デフォルト:width=.2pt, distance=.3ex, length=.4ex \tenKK{あああああああああ} \tenKK[radius=.05ex, distance=.3ex]{あああああああああ} \dashKK{あああああああああ} \dashKK[length=.01ex, distance=.1ex]{あああああああああ} \parbox[c][6cm][c]{3cm}{% \tenKK{あああああ\ruby{あ}{あ}ああ} \tenKK[radius=.05ex, distance=.3ex]{あああああああああ} \dashKK{あああああ\ruby{あ}{あ}ああ} \dashKK[length=.01ex, distance=.1ex]{あああああああああ} } \end{SourceCode} \begin{OutPut}{Output} 横書き: \tenKK{あああああああああ} \tenKK[radius=.05ex, distance=.3ex]{あああああああああ} \dashKK{あああああああああ} \dashKK[length=.01ex, distance=.1ex]{あああああああああ} 縦書き: \parbox[c][6cm][c]{3cm}{% \tenKK{あああああ\ruby{あ}{あ}ああ} \tenKK[radius=.05ex, distance=.3ex]{あああああああああ} \dashKK{あああああ\ruby{あ}{あ}ああ} \dashKK[length=.01ex, distance=.1ex]{あああああああああ} } \end{OutPut} \subsection{\textbackslash LineNumbering} 下線に番号を振るためのコマンドです。これは私が作成した\texttt{KKsymbols}パッケージ(TeX Liveに収録済み)との併用をお勧めしています。スターオプションを付与すると、縦書きの時には引数の中身が回転します\footnote{横書きの時には出力に変化はありません。}。(This command assigns numbers to underlines. It is recommended to use it together with my \texttt{KKsymbols} package (already included in TeX Live). When the starred option is given, the contents of the argument are rotated in vertical writing\footnote{In horizontal writing, the output remains unchanged.}.) \begin{SourceCode}{TeX} \LineNumbering{\kakko{1}}\underLineKK{あああああああ} \parbox[c][6cm][c]{3cm}{% \LineNumbering{\kakko{1}}\underLineKK{あああああああ} \LineNumbering*{ア}\underLineKK{あああああああ} } \end{SourceCode} \begin{OutPut}{Output} 横書き: \LineNumbering{\kakko{1}}\underLineKK{あああああああ} 縦書き: \parbox[c][6cm][c]{3cm}{% \LineNumbering{\kakko{1}}\underLineKK{あああああああ} \LineNumbering*{ア}\underLineKK{あああああああ} } \end{OutPut} \subsection{自動調節シリーズ(Auto Series)} このシリーズは、v1.1.0にて追加された新たなモデルで、主に積分記号などの大きな記号が引数内部に含まれる場合に威力を発揮するコマンド群です。(These commands are added on v1.1.0 update. When you include \verb|\int| or so in the argument, the difference between Manual Series and Auto Series are critcal.)通常のManual Seriesとの違いは(You can see how defferent they are as follows: ) \begin{SourceCode}{TeX} \underLineKK{$\displaystyle \int_{a}^{b} f(x) \, dx$} \underLineKKAuto{$\displaystyle \int_{a}^{b} f(x) \, dx$} \namiKK{$\displaystyle \int_{a}^{b} f(x) \, dx$} \namiKKAuto{$\displaystyle \int_{a}^{b} f(x) \, dx$} \[\underLineKK{\int_{a}^{b} f(x) \, dx}\] \[\underLineKKAuto{\int_{a}^{b} f(x) \, dx}\] \[\namiKK{\int_{a}^{b} f(x) \, dx}\] \[\namiKKAuto{\int_{a}^{b} f(x) \, dx}\] \end{SourceCode} \begin{OutPut}{Output} 横書き: \underLineKK{$\displaystyle \int_{a}^{b} f(x) \, dx$} \underLineKKAuto{$\displaystyle \int_{a}^{b} f(x) \, dx$} \namiKK{$\displaystyle \int_{a}^{b} f(x) \, dx$} \namiKKAuto{$\displaystyle \int_{a}^{b} f(x) \, dx$} \[\underLineKK{\int_{a}^{b} f(x) \, dx}\] \[\underLineKKAuto{\int_{a}^{b} f(x) \, dx}\] \[\namiKK{\int_{a}^{b} f(x) \, dx}\] \[\namiKKAuto{\int_{a}^{b} f(x) \, dx}\] 縦書き: \parbox[c][9cm][c]{6cm}{% \underLineKK{$\displaystyle \int_{a}^{b} f(x) \, dx$} \underLineKKAuto{$\displaystyle \int_{a}^{b} f(x) \, dx$} \namiKK{$\displaystyle \int_{a}^{b} f(x) \, dx$} \namiKKAuto{$\displaystyle \int_{a}^{b} f(x) \, dx$} \[\underLineKK{\int_{a}^{b} f(x) \, dx}\] \[\underLineKKAuto{\int_{a}^{b} f(x) \, dx}\] \[\namiKK{\int_{a}^{b} f(x) \, dx}\] \[\namiKKAuto{\int_{a}^{b} f(x) \, dx}\] } \end{OutPut} \noindent 以上の比較を参照すると一目瞭然でしょう。 使い分けについてですが、基本的にはManual Seriesを使用してください。なぜならAuto Seriesは、引数の中に一箇所でも極端に深さをとるコマンドが存在した場合、改行後もずっとその調整のまま線を引き続けてしまいます。したがって、パラグラフの大部分にアンダーラインを入れたいというような場合には不向きです。(Regarding the choice of which series to use, please use the Manual Series by default. This is because the Auto Series continues to draw lines with the same vertical adjustment if there is even a single command within its argument that takes an unusually deep depth. Therefore, it is not suitable for cases where you want to underline a large portion of a paragraph.) 例えば、(For example, ) \begin{SourceCode}{TeX} 以上より、 \[f(x)=\namiKKAuto{\frac{x+\frac{a}{b}}{x^4+\frac{c}{d}}} \ \text{……\kakko{答}}\] \noindent となります。 \end{SourceCode} \begin{OutPut}{Output} 以上より、 \[f(x)=\namiKKAuto{\frac{x+\frac{a}{b}}{x^4+\frac{c}{d}}} \ \text{……\kakko{答}}\] \noindent となります。 \end{OutPut} \noindent 以上のような局面においては、数式に下線が被ると格好が悪いため、Auto Seriesの使い所であると言えます。(in such situations, it would look awkward if the underline overlapped with mathematical expressions, so this is where the Auto Series becomes useful.) \section{ライセンス(License)} Released under the LaTeX Project Public License (LPPL) 1.3c. \section{Version History} \begin{itemize} \item \textbf{v1.0.1 (2025/10/26)} --- Initial public release. \item \textbf{v1.1.0 (2025/10/29)} --- I added Auto Series, and changed some csname of commands. \end{itemize} \section{Source Code} \begin{lstlisting} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luwa-ul}[2025/10/29, Version 1.1.0] \RequirePackage{luacolor, lua-ul, calc, tikz} \RequirePackage[dvipsnames, svgnames, x11names]{xcolor} \definecolor{mygray@luwa-ul}{RGB}{60, 60, 60} \newlength{\underLine@KK@Adjust@tmp} \newlength{\KKUL@bottom} \newlength{\KKUL@height} \NewDocumentCommand{\underLine@KK@Adjust@bottom}{m}{% \setlength{\underLine@KK@Adjust@tmp}{\f@size pt}% \ifnum\ltjgetparameter{direction}=3% \def\underLine@KK@Adjust@use@bottom{\dimexpr -#1+\underLine@KK@Adjust@tmp/2\relax}% \else% \def\underLine@KK@Adjust@use@bottom{\dimexpr #1-\underLine@KK@Adjust@tmp/7\relax}% \fi% } \NewDocumentCommand{\underLine@KK@Adjust@height}{m}{% \ifnum\ltjgetparameter{direction}=3% \def\underLine@KK@Adjust@use@height{#1}% \else% \def\underLine@KK@Adjust@use@height{#1}% \fi% } \define@key{KKUL}{bottom}{% \underLine@KK@Adjust@bottom{#1}% \setlength{\KKUL@bottom}{\underLine@KK@Adjust@use@bottom}% } \define@key{KKUL}{height}{% \underLine@KK@Adjust@height{#1}% \setlength{\KKUL@height}{\underLine@KK@Adjust@use@height}% } \define@key{KKUL}{color}{% \def\KKUL@color{#1}% } % ルビが中に入っているときだけテキストを上昇させる \newlength{\KKUL@rubyraise} \directlua{ function RubyFlagKKUL(t) if string.find(t, "\\ruby") or string.find(t, "\\kenten") or string.find(t, "\\送り") or string.find(t, "\\振り") then tex.print("1") else tex.print("0") end end } % 追記(2025/10/29) % Auto Depth Adjust System \newlength{\temp@depth@kk} \NewDocumentCommand{\getdepth@kk}{m}{% \ifnum\ltjgetparameter{direction}=3% \settoheight{\temp@depth@kk}{#1}% \addtolength{\temp@depth@kk}{-.5em}% \setlength{\temp@depth@kk}{-\temp@depth@kk}% \else% \settodepth{\temp@depth@kk}{#1}% \fi% } \NewDocumentCommand{\underLineKK@plain}{ O{} +m }{% 内部調整用 \underLine@KK@Adjust@bottom{-.1em}% \underLine@KK@Adjust@height{0.3pt}% \setlength{\KKUL@bottom}{\underLine@KK@Adjust@use@bottom}% \setlength{\KKUL@height}{\underLine@KK@Adjust@use@height}% \def\KKUL@color{black}% \def\underLineKK@test@contents{#2}% \setkeys{KKUL}{#1}% \underLine[bottom=\KKUL@bottom, height=\KKUL@height, color=\KKUL@color]{#2}% } % ルビ以外のはみだしを許容する(見出しなどで見た目を損なわないためなど) \NewDocumentCommand{\underLineKK}{ O{} +m }{% \underLine@KK@Adjust@bottom{-.1em}% \underLine@KK@Adjust@height{0.3pt}% \setlength{\KKUL@bottom}{\underLine@KK@Adjust@use@bottom}% \setlength{\KKUL@height}{\underLine@KK@Adjust@use@height}% \def\KKUL@color{black}% \def\underLineKK@test@contents{#2}% \setkeys{KKUL}{#1}% \edef\UL@rubyflag{\numexpr\directlua{RubyFlagKKUL("\luaescapestring{\unexpanded\expandafter{\underLineKK@test@contents}}")}\relax}% \ifnum\ltjgetparameter{direction}=3% \ifnum\UL@rubyflag=1% \setlength{\KKUL@rubyraise}{.5em}% \else% \setlength{\KKUL@rubyraise}{0em}% \fi% \else% \setlength{\KKUL@rubyraise}{0em}% \fi% \underLine[bottom=\KKUL@bottom+\KKUL@rubyraise, height=\KKUL@height, color=\KKUL@color]{#2}% } % 深さに応じて変わるタイプ \NewDocumentCommand{\underLineKKAuto@make}{ O{} +m }{% \underLine@KK@Adjust@bottom{-.1em}% \underLine@KK@Adjust@height{0.3pt}% \setlength{\temp@depth@kk}{0pt}% \setlength{\KKUL@bottom}{\underLine@KK@Adjust@use@bottom}% \setlength{\KKUL@height}{\underLine@KK@Adjust@use@height}% \def\KKUL@color{black}% \def\underLineKK@test@contents{#2}% \setkeys{KKUL}{#1}% \getdepth@kk{\underLineKK@test@contents}% \underLine[bottom=\KKUL@bottom-\temp@depth@kk, height=\KKUL@height, color=\KKUL@color]{#2}% } \NewDocumentCommand{\underLineKKAuto}{ O{} +m }{% \ifmmode \mathchoice {\mbox{\underLineKKAuto@make[#1]{$\displaystyle #2$}}} % displaystyle {\mbox{\underLineKKAuto@make[#1]{$#2$}}} % textstyle (inline) {\mbox{\underLineKKAuto@make[#1]{$#2$}}} % scriptstyle {\mbox{\underLineKKAuto@make[#1]{$#2$}}} % scriptscriptstyle \else \underLineKKAuto@make[#1]{#2}% テキストモードではそのまま出力(mboxで包まない) \fi } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %lua-ulで作ったnamiKK(元の名称はsnamiftだが、変更)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newlength{\snamift@bottom}\setlength{\snamift@bottom}{0ex} \define@key{snamift}{bottom}{% \setlength{\snamift@bottom}{#1}% } % 名称変更用のカウンター(グローバル変数) \newcount\snamift@id \NewDocumentCommand{\namiKK}{ O{} +m }{% % 1:キーを先にセットして \snamift@bottom を更新 \setlength{\snamift@bottom}{0ex}% \def\snamift@test@contents{#2}% \setkeys{snamift}{#1}% \edef\UL@rubyflag{\numexpr\directlua{RubyFlagKKUL("\luaescapestring{\unexpanded\expandafter{\snamift@test@contents}}")}\relax}% \ifnum\ltjgetparameter{direction}=3% \ifnum\UL@rubyflag=1% \addtolength{\snamift@bottom}{.5em}% \fi% \fi% % 2:IDを進める \global\advance\snamift@id by 1\relax% % 3:ユニーク名で下線タイプを定義(正しく展開されるように \expandafter と \number を使用) \expandafter\newunderlinetype\csname beginUnderWavyS\number\snamift@id\endcsname{% \cleaders\hbox{% \begin{tikzpicture}[xscale=.8,baseline=\f@size/4 pt, x=\f@size/12 pt,y=\f@size/25 pt] \clip[yshift=\snamift@bottom] (1,\f@size/8 pt) rectangle (5,-\f@size/8 pt); \draw[line width=\f@size/24 pt,yshift=\snamift@bottom] (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0) sin (5,1) cos (6,0); \end{tikzpicture}% }% }% \expandafter\newunderlinetype\csname beginUnderWavyState\number\snamift@id\endcsname{% \cleaders\hbox{% \begin{tikzpicture}[xscale=.8,baseline=\f@size/4 pt, x=\f@size/12 pt,y=\f@size/25 pt] \begin{scope}[yshift=\f@size/1.2 pt] \clip[yshift=\snamift@bottom] (1,\f@size/8 pt) rectangle (5,-\f@size/8 pt); \draw[line width=\f@size/24 pt,yshift=\snamift@bottom] (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0) sin (5,1) cos (6,0); \end{scope} \end{tikzpicture}% }% }% % 4:使用(縦横の分岐;直接 csname を呼ぶ) {\ifnum\ltjgetparameter{direction}=3 % \csname beginUnderWavyState\number\snamift@id\endcsname{#2}% \else% \csname beginUnderWavyS\number\snamift@id\endcsname{#2}% \fi}% } \NewDocumentCommand{\namiKKAuto@make}{ O{} +m }{% \setlength{\snamift@bottom}{0ex}% \def\snamift@test@contents{#2}% \setkeys{snamift}{#1}% \setlength{\temp@depth@kk}{0pt}% \getdepth@kk{\snamift@test@contents}% \global\advance\snamift@id by 1\relax% \expandafter\newunderlinetype\csname beginUnderWavyS\number\snamift@id\endcsname{% \cleaders\hbox{% \begin{tikzpicture}[xscale=.8,baseline=\f@size/4 pt,x=\f@size/12 pt,y=\f@size/25 pt] \begin{scope}[yshift=-\temp@depth@kk] \clip[yshift=\snamift@bottom] (1,\f@size/8 pt) rectangle (5,-\f@size/8 pt); \draw[line width=\f@size/24 pt,yshift=\snamift@bottom] (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0) sin (5,1) cos (6,0); \end{scope} \end{tikzpicture}% }% }% \expandafter\newunderlinetype\csname beginUnderWavyState\number\snamift@id\endcsname{% \cleaders\hbox{% \begin{tikzpicture}[xscale=.8,baseline=\f@size/4 pt, x=\f@size/12 pt,y=\f@size/25 pt] \begin{scope}[yshift=\f@size/1.2 pt-\temp@depth@kk] \clip[yshift=\snamift@bottom] (1,\f@size/8 pt) rectangle (5,-\f@size/8 pt); \draw[line width=\f@size/24 pt,yshift=\snamift@bottom] (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0) sin (5,1) cos (6,0); \end{scope} \end{tikzpicture}% }% }% {\ifnum\ltjgetparameter{direction}=3 % \csname beginUnderWavyState\number\snamift@id\endcsname{#2}% \else% \csname beginUnderWavyS\number\snamift@id\endcsname{#2}% \fi}% } \NewDocumentCommand{\namiKKAuto}{ O{} +m }{% \ifmmode \mathchoice {\mbox{\namiKKAuto@make[#1]{$\displaystyle #2$}}} % displaystyle {\mbox{\namiKKAuto@make[#1]{$#2$}}} % textstyle (inline) {\mbox{\namiKKAuto@make[#1]{$#2$}}} % scriptstyle {\mbox{\namiKKAuto@make[#1]{$#2$}}} % scriptscriptstyle \else \namiKKAuto@make[#1]{#2}% テキストモードではそのまま出力(mboxで包まない) \fi } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %lua-ulで作ったtenKK,dashKK(元の名称はstengthとsdashgthだが、変更)%%%%%%%%%%%%%%%%%%%%% \newlength{\stength@radius} \newlength{\stength@distance} \newlength{\stength@bottom} \define@key{stength}{radius}{\setlength{\stength@radius}{#1}} \define@key{stength}{distance}{\setlength{\stength@distance}{#1}} \define@key{stength}{bottom}{\setlength{\stength@bottom}{#1}} \newcount\stength@id \NewDocumentCommand{\tenKK}{ O{} +m }{% \setlength{\stength@radius}{.1ex}% \setlength{\stength@distance}{.4ex}% \setlength{\stength@bottom}{0ex}% \def\stength@test@contents{#2}% \setkeys{stength}{#1}% \edef\UL@rubyflag{\numexpr\directlua{RubyFlagKKUL("\luaescapestring{\unexpanded\expandafter{\stength@test@contents}}")}\relax}% \ifnum\ltjgetparameter{direction}=3 \ifnum\UL@rubyflag=1 \addtolength{\stength@bottom}{.5em}% \fi \fi% \global\advance\stength@id by 1\relax% \expandafter\newunderlinetype\csname beginUnderDot\number\stength@id\endcsname{% \xleaders\hbox{% \begin{tikzpicture}[x=0.8ex,y=.2ex,baseline=.7ex]% \fill[mygray@luwa-ul,yshift=\stength@bottom] (0.3,0) circle (\stength@radius); \path[use as bounding box,yshift=\stength@bottom] (0,0) rectangle (\stength@distance,0);%.8 \end{tikzpicture}% }% }% \expandafter\newunderlinetype\csname beginUnderDottate\number\stength@id\endcsname{% \xleaders\hbox{% \begin{tikzpicture}[x=0.8ex,y=.2ex,baseline=.7ex]% \begin{scope}[yshift=\f@size/1.1 pt] \fill[mygray@luwa-ul,yshift=\stength@bottom] (0.3,0) circle (\stength@radius); \path[use as bounding box,yshift=\stength@bottom] (0,0) rectangle (\stength@distance,0); \end{scope} \end{tikzpicture}% }% }% {\ifnum\ltjgetparameter{direction}=3 % \csname beginUnderDottate\number\stength@id\endcsname{#2}% \else% \csname beginUnderDot\number\stength@id\endcsname{#2}% \fi}% } \NewDocumentCommand{\tenKKAuto}{ O{} +m }{% \ifmmode \mathchoice {\mbox{\tenKKAuto@make[#1]{$\displaystyle #2$}}} % displaystyle {\mbox{\tenKKAuto@make[#1]{$#2$}}} % textstyle (inline) {\mbox{\tenKKAuto@make[#1]{$#2$}}} % scriptstyle {\mbox{\tenKKAuto@make[#1]{$#2$}}} % scriptscriptstyle \else \tenKKAuto@make[#1]{#2}% テキストモードではそのまま出力(mboxで包まない) \fi } \NewDocumentCommand{\tenKKAuto@make}{ O{} +m }{% \setlength{\stength@radius}{.1ex}% \setlength{\stength@distance}{.4ex}% \setlength{\stength@bottom}{0ex}% \def\stength@test@contents{#2}% \setkeys{stength}{#1}% \setlength{\temp@depth@kk}{0pt}% \getdepth@kk{\stength@test@contents}% \global\advance\stength@id by 1\relax% \expandafter\newunderlinetype\csname beginUnderDot\number\stength@id\endcsname{% \xleaders\hbox{% \begin{tikzpicture}[x=0.8ex,y=.2ex,baseline=.7ex]% \begin{scope}[yshift=-\temp@depth@kk] \fill[mygray@luwa-ul,yshift=\stength@bottom] (0.3,0) circle (\stength@radius); \path[use as bounding box,yshift=\stength@bottom] (0,0) rectangle (\stength@distance,0);%.8 \end{scope} \end{tikzpicture}% }% }% \expandafter\newunderlinetype\csname beginUnderDottate\number\stength@id\endcsname{% \xleaders\hbox{% \begin{tikzpicture}[x=0.8ex,y=.2ex,baseline=.7ex]% \begin{scope}[yshift=\f@size/1.1 pt-\temp@depth@kk] \fill[mygray@luwa-ul,yshift=\stength@bottom] (0.3,0) circle (\stength@radius); \path[use as bounding box,yshift=\stength@bottom] (0,0) rectangle (\stength@distance,0); \end{scope} \end{tikzpicture}% }% }% {\ifnum\ltjgetparameter{direction}=3 % \csname beginUnderDottate\number\stength@id\endcsname{#2}% \else% \csname beginUnderDot\number\stength@id\endcsname{#2}% \fi}% } \newlength{\underdash@length} \newlength{\underdash@distance} \newlength{\underdash@width} \newlength{\underdash@bottom} \define@key{underdashgth}{length}{\setlength{\underdash@length}{#1}} \define@key{underdashgth}{distance}{\setlength{\underdash@distance}{#1}} \define@key{underdashgth}{width}{\setlength{\underdash@width}{#1}} \define@key{underdashgth}{bottom}{\setlength{\underdash@bottom}{#1}} \newcount\underdash@id \NewDocumentCommand{\dashKK}{ O{} +m }{% \setlength{\underdash@length}{.4ex}% \setlength{\underdash@distance}{.3ex}% \setlength{\underdash@width}{.2pt}% \setlength{\underdash@bottom}{0ex}% \def\sdashgth@test@contents{#2}% \setkeys{underdashgth}{#1}% \edef\UL@rubyflag{\numexpr\directlua{RubyFlagKKUL("\luaescapestring{\unexpanded\expandafter{\sdashgth@test@contents}}")}\relax}% \ifnum\ltjgetparameter{direction}=3 \ifnum\UL@rubyflag=1 \addtolength{\underdash@bottom}{.5em}% \fi \fi% \global\advance\underdash@id by 1\relax% \expandafter\newunderlinetype\csname beginUnderDash\number\underdash@id\endcsname{% \xleaders\hbox{% \begin{tikzpicture}[x=0.8ex,y=.2ex,baseline=.7ex]% \draw[black,line width=\underdash@width,xshift=.25ex,yshift=\underdash@bottom] (0,0) -- (\underdash@length,0);% \path[use as bounding box,yshift=\underdash@bottom] (0,0) rectangle (\underdash@length+\underdash@distance,0);% \end{tikzpicture}% }% }% \expandafter\newunderlinetype\csname beginUnderDashtate\number\underdash@id\endcsname{% \xleaders\hbox{% \begin{tikzpicture}[x=0.8ex,y=.2ex,baseline=.7ex]% \begin{scope}[yshift=\f@size/1.1 pt]% \draw[black,line width=\underdash@width,xshift=.1ex,yshift=\underdash@bottom] (0,0) -- (\underdash@length,0);% \path[use as bounding box,yshift=\underdash@bottom] (0,0) rectangle (\underdash@length+\underdash@distance,0);% \end{scope}% \end{tikzpicture}% }% }% {\ifnum\ltjgetparameter{direction}=3 % \csname beginUnderDashtate\number\underdash@id\endcsname{#2}% \else% \csname beginUnderDash\number\underdash@id\endcsname{#2}% \fi}% } \NewDocumentCommand{\dashKKAuto@make}{ O{} +m }{% \setlength{\underdash@length}{.4ex}% \setlength{\underdash@distance}{.3ex}% \setlength{\underdash@width}{.2pt}% \setlength{\underdash@bottom}{0ex}% \def\sdashgth@test@contents{#2}% \setkeys{underdashgth}{#1}% \setlength{\temp@depth@kk}{0pt}% \getdepth@kk{\sdashgth@test@contents}% \global\advance\underdash@id by 1\relax% \expandafter\newunderlinetype\csname beginUnderDash\number\underdash@id\endcsname{% \xleaders\hbox{% \begin{tikzpicture}[x=0.8ex,y=.2ex,baseline=.7ex]% \begin{scope}[yshift=-\temp@depth@kk] \draw[black,line width=\underdash@width,xshift=.25ex,yshift=\underdash@bottom] (0,0) -- (\underdash@length,0);% \path[use as bounding box,yshift=\underdash@bottom] (0,0) rectangle (\underdash@length+\underdash@distance,0);% \end{scope} \end{tikzpicture}% }% }% \expandafter\newunderlinetype\csname beginUnderDashtate\number\underdash@id\endcsname{% \xleaders\hbox{% \begin{tikzpicture}[x=0.8ex,y=.2ex,baseline=.7ex]% \begin{scope}[yshift=\f@size/1.1 pt-\temp@depth@kk]% \draw[black,line width=\underdash@width,xshift=.1ex,yshift=\underdash@bottom] (0,0) -- (\underdash@length,0);% \path[use as bounding box,yshift=\underdash@bottom] (0,0) rectangle (\underdash@length+\underdash@distance,0);% \end{scope}% \end{tikzpicture}% }% }% {\ifnum\ltjgetparameter{direction}=3 % \csname beginUnderDashtate\number\underdash@id\endcsname{#2}% \else% \csname beginUnderDash\number\underdash@id\endcsname{#2}% \fi}% } \NewDocumentCommand{\dashKKAuto}{ O{} +m }{% \ifmmode \mathchoice {\mbox{\dashKKAuto@make[#1]{$\displaystyle #2$}}} % displaystyle {\mbox{\dashKKAuto@make[#1]{$#2$}}} % textstyle (inline) {\mbox{\dashKKAuto@make[#1]{$#2$}}} % scriptstyle {\mbox{\dashKKAuto@make[#1]{$#2$}}} % scriptscriptstyle \else \dashKKAuto@make[#1]{#2}% テキストモードではそのまま出力(mboxで包まない) \fi } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %overLine%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \define@key{overLine}{color}{% \def\overLineKK@color{#1}% } \newlength{\overLineKK@KK@Adjust} \NewDocumentCommand{\overLineKK}{ O{} +m }{% \setlength{\overLineKK@KK@Adjust}{\f@size pt}% \def\overLineKK@color{black}% \def\overLineKK@test@contents{#2}% \setkeys{overLine}{#1}% \edef\UL@rubyflag{\numexpr\directlua{RubyFlagKKUL("\luaescapestring{\unexpanded\expandafter{\overLineKK@test@contents}}")}\relax}% \ifnum\ltjgetparameter{direction}=3% \ifnum\UL@rubyflag=1% \addtolength{\overLineKK@KK@Adjust}{.6em}% \else% \addtolength{\overLineKK@KK@Adjust}{.1em}% \fi% \else% \ifnum\UL@rubyflag=1% \addtolength{\overLineKK@KK@Adjust}{.6em}% \else% \addtolength{\overLineKK@KK@Adjust}{.1em}% \fi% \fi% \underLineKK[bottom=\overLineKK@KK@Adjust,color=\overLineKK@color]{#2}% } \newlength{\temp@depth@kk@over} \NewDocumentCommand{\getdepth@kk@over}{m}{% \ifnum\ltjgetparameter{direction}=3% \settodepth{\temp@depth@kk@over}{#1}% \addtolength{\temp@depth@kk@over}{-.45em}% \else% \settoheight{\temp@depth@kk@over}{#1}% \addtolength{\temp@depth@kk@over}{-.8em}% \setlength{\temp@depth@kk@over}{-\temp@depth@kk@over}% \fi% } \NewDocumentCommand{\overLineKKAuto}{ O{} +m }{% \setlength{\overLineKK@KK@Adjust}{\f@size pt}% \setlength{\temp@depth@kk@over}{0pt}% \def\overLineKK@color{black}% \def\overLineKK@test@contents{#2}% \getdepth@kk@over{\overLineKK@test@contents}% \setkeys{overLine}{#1}% \ifnum\ltjgetparameter{direction}=3% \addtolength{\overLineKK@KK@Adjust}{.1em}% \else% \addtolength{\overLineKK@KK@Adjust}{.1em}% \fi% \underLineKK@plain[bottom=\overLineKK@KK@Adjust-\temp@depth@kk@over,color=\overLineKK@color]{#2}% } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %グレーの蛍光ペン(細くて下の方だけ塗るやつ)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newlength{\thinHighLight@KK@Adjust} \newlength{\thinHighLight@KK@Adjust@ruby} \newlength{\thinHighLight@KK@Adjust@ruby@yoko} \newcommand{\thinHighLight@KK@Adjust@tmp}{% \ifnum\ltjgetparameter{direction}=3% \setlength{\thinHighLight@KK@Adjust}{-.3\zw}% \else% \setlength{\thinHighLight@KK@Adjust}{0ex}% \fi } \DeclareDocumentCommand{\thinHighLight}{ O{color=gray} +m }{% \thinHighLight@KK@Adjust@tmp% \def\thinHighLight@test@contents{#2}% \setlength{\thinHighLight@KK@Adjust@ruby}{0em}% \setlength{\thinHighLight@KK@Adjust@ruby@yoko}{0em}% \edef\UL@rubyflag{\numexpr\directlua{RubyFlagKKUL("\luaescapestring{\unexpanded\expandafter{\thinHighLight@test@contents}}")}\relax}% \ifnum\ltjgetparameter{direction}=3 \ifnum\UL@rubyflag=1 \setlength{\thinHighLight@KK@Adjust@ruby}{-.5em}% \fi \fi \underLineKK[#1,height=.25\underLine@KK@Adjust@tmp-\thinHighLight@KK@Adjust@ruby,bottom=-.04\underLine@KK@Adjust@tmp+\thinHighLight@KK@Adjust+\thinHighLight@KK@Adjust@ruby]{#2}% } \newlength{\thickHighLight@KK@Adjust} \newlength{\thickHighLight@KK@Adjust@ruby} \newlength{\thickHighLight@KK@Adjust@ruby@yoko} \newcommand{\thickHighLight@KK@Adjust@tmp}{% \ifnum\ltjgetparameter{direction}=3% \setlength{\thickHighLight@KK@Adjust}{-1.1\zw}% \else% \setlength{\thickHighLight@KK@Adjust}{0ex}% \fi } \DeclareDocumentCommand{\thickHighLight}{ O{color=gray} +m }{% \thickHighLight@KK@Adjust@tmp% \def\thickHighLight@test@contents{#2}% \setlength{\thickHighLight@KK@Adjust@ruby}{0em}% \setlength{\thickHighLight@KK@Adjust@ruby@yoko}{0em}% \edef\UL@rubyflag{\numexpr\directlua{RubyFlagKKUL("\luaescapestring{\unexpanded\expandafter{\thickHighLight@test@contents}}")}\relax}% \ifnum\ltjgetparameter{direction}=3 \ifnum\UL@rubyflag=1 \setlength{\thickHighLight@KK@Adjust@ruby}{-.5em}% \fi \else \ifnum\UL@rubyflag=1 \setlength{\thickHighLight@KK@Adjust@ruby}{-.5em}% \setlength{\thickHighLight@KK@Adjust@ruby@yoko}{.5em}% \fi \fi \underLineKK[#1,height=1.15\underLine@KK@Adjust@tmp-\thickHighLight@KK@Adjust@ruby,bottom=-.04\underLine@KK@Adjust@tmp+\thickHighLight@KK@Adjust+\thickHighLight@KK@Adjust@ruby+\thickHighLight@KK@Adjust@ruby@yoko]{#2}% } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %二重線%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newlength{\nijyusen@bottom} \newlength{\nijyusen@bottom@adjust} \define@key{nijyusen}{color}{\def\nijyusen@KK@color{#1}} \define@key{nijyusen}{bottom}{\setlength{\nijyusen@bottom}{#1}} \NewDocumentCommand\nijyusen{ O{} +m }{% \def\nijyusen@KK@color{black}% \setlength{\nijyusen@bottom}{0ex}% \setkeys{nijyusen}{#1}% \ifnum\ltjgetparameter{direction}=3% \setlength{\nijyusen@bottom@adjust}{-\nijyusen@bottom}% \else% \setlength{\nijyusen@bottom@adjust}{\nijyusen@bottom}% \fi% \underLineKK[bottom=-.1\underLine@KK@Adjust@tmp+\nijyusen@bottom,color=\nijyusen@KK@color]{\underLineKK[bottom=\nijyusen@bottom@adjust,color=\nijyusen@KK@color]{#2}}% } \NewDocumentCommand{\nijyusenAuto@make}{ O{} +m }{% \def\nijyusen@KK@color{black}% \def\nijyusen@test@contents{#2}% \setlength{\temp@depth@kk}{0pt}% \getdepth@kk{\nijyusen@test@contents}% \setlength{\nijyusen@bottom}{0ex}% \setkeys{nijyusen}{#1}% \ifnum\ltjgetparameter{direction}=3% \setlength{\nijyusen@bottom@adjust}{-\nijyusen@bottom}% \else% \setlength{\nijyusen@bottom@adjust}{\nijyusen@bottom}% \fi% \underLineKK@plain[bottom=-.1\underLine@KK@Adjust@tmp+\nijyusen@bottom-\temp@depth@kk,color=\nijyusen@KK@color]{\underLineKK@plain[bottom=\nijyusen@bottom@adjust-\temp@depth@kk,color=\nijyusen@KK@color]{#2}}% } \NewDocumentCommand{\nijyusenAuto}{ O{} +m }{% \ifmmode \mathchoice {\mbox{\nijyusenAuto@make[#1]{$\displaystyle #2$}}} % displaystyle {\mbox{\nijyusenAuto@make[#1]{$#2$}}} % textstyle (inline) {\mbox{\nijyusenAuto@make[#1]{$#2$}}} % scriptstyle {\mbox{\nijyusenAuto@make[#1]{$#2$}}} % scriptscriptstyle \else \nijyusenAuto@make[#1]{#2}% テキストモードではそのまま出力(mboxで包まない) \fi } \newlength{\keshinijyuusen@KK@Adjust} \newcommand{\keshinijyuusen@KK@Adjust@tmp}{% \ifnum\ltjgetparameter{direction}=3% \setlength{\keshinijyuusen@KK@Adjust}{0ex}% \else% \setlength{\keshinijyuusen@KK@Adjust}{.15ex}% \fi } \define@key{keshinijyusen}{color}{\def\keshinijyusen@KK@color{#1}} \NewDocumentCommand{\keshinijyusen}{ O{} +m }{% \def\keshinijyusen@KK@color{color=black}% \def\keshinijyusen@test@contents{#2}% \setkeys{keshinijyusen}{#1}% \keshinijyuusen@KK@Adjust@tmp% \underLineKK@plain[bottom=.57\underLine@KK@Adjust@tmp-\keshinijyuusen@KK@Adjust,#1]{\underLineKK@plain[bottom=.47\underLine@KK@Adjust@tmp-\keshinijyuusen@KK@Adjust,#1]{#2}} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %下線の前に番号を振る%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\linenumbering@luwa}[1]{\raisebox{-1ex}{\scalebox{.6}{#1}}} \newdimen\overtline@f@size \NewDocumentCommand{\tlinenumbering@luwa}{s m}{% \setlength{\overtline@f@size}{\f@size pt}% \raisebox{.6\overtline@f@size}{\IfBooleanTF{#1}{\tikz[baseline=(char.base)]{\node[inner sep=0pt, anchor=center, scale=.6] (char) {#2};}}{\tikz[baseline=(char.base)]{\node[inner sep=0pt, anchor=center, scale=.6, rotate=90] (char) {#2};}% }}\hskip.15ex} \NewDocumentCommand{\LineNumbering}{ s m O{0ex} }{% 縦横両対応 \ifnum\ltjgetparameter{direction}=3% \IfBooleanTF{#1}{\raisebox{#3}{\tlinenumbering@luwa*{#2}}}{\raisebox{#3}{\tlinenumbering@luwa{#2}}}% \else \raisebox{#3}{\linenumbering@luwa{#2}}% \fi } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \endinput \end{lstlisting} \end{document}