| 1 |
%%% License %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 |
% This package is licensed under the terms of the MIT License. |
| 3 |
|
| 4 |
% Copyright (c) 2025 Kosei Kawaguchi |
| 5 |
|
| 6 |
% Permission is hereby granted, free of charge, |
| 7 |
% to any person obtaining a copy of this software and associated documentation files |
| 8 |
% (the "Software"), to deal in the Software without restriction, |
| 9 |
% including without limitation the rights to use, copy, modify, merge, publish, |
| 10 |
% distribute, sublicense, and/or sell copies of the Software, |
| 11 |
% and to permit persons to whom the Software is furnished to do so, |
| 12 |
% subject to the following conditions: |
| 13 |
|
| 14 |
% The above copyright notice and this permission notice |
| 15 |
% shall be included in all copies or substantial portions of the Software. |
| 16 |
|
| 17 |
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 18 |
% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 |
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 20 |
% IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 21 |
% DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 22 |
% ARISING FROM, |
| 23 |
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 24 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 25 |
|
| 26 |
|
| 27 |
\ProvidesPackage{keisennote}[2025/12/30, v1.2.0] |
| 28 |
|
| 29 |
\RequirePackage[dvipsnames, svgnames, x11names]{xcolor} |
| 30 |
\RequirePackage{zref, zref-savepos, fp} |
| 31 |
\RequirePackage{tikz} |
| 32 |
|
| 33 |
\RequirePackage{kvoptions} |
| 34 |
|
| 35 |
\SetupKeyvalOptions{ |
| 36 |
family=kn, |
| 37 |
prefix=kn@ |
| 38 |
} |
| 39 |
|
| 40 |
\newdimen\noteLineWidth@kn |
| 41 |
\newdimen\noteDotsRadius@kn |
| 42 |
\newdimen\noteLineDistance@kn |
| 43 |
\newdimen\noteTriangle@mag@kn |
| 44 |
|
| 45 |
% パッケージオプションの宣言 |
| 46 |
\DeclareStringOption[.5truept]{linewidth}% 線の太さ |
| 47 |
\DeclareStringOption[.7truept]{radius}% ドットの大きさ |
| 48 |
\DeclareStringOption[6truemm]{distance}% ドットの間隔 |
| 49 |
\DeclareStringOption[.7truept]{triangle}% 三角形の大きさ |
| 50 |
\ProcessKeyvalOptions* |
| 51 |
|
| 52 |
|
| 53 |
% オプションの反映 |
| 54 |
\setlength{\noteLineWidth@kn}{\kn@linewidth} |
| 55 |
\setlength{\noteDotsRadius@kn}{\kn@radius} |
| 56 |
\setlength{\noteLineDistance@kn}{\kn@distance} |
| 57 |
\setlength{\noteTriangle@mag@kn}{\kn@triangle} |
| 58 |
|
| 59 |
|
| 60 |
% 途中でパラメータ変更ができるように |
| 61 |
\NewDocumentCommand{\SetNoteLineWidth}{O{.5truept}}{% |
| 62 |
\setlength{\noteLineWidth@kn}{#1} |
| 63 |
} |
| 64 |
\NewDocumentCommand{\SetNoteDotRadius}{O{.7truept}}{% |
| 65 |
\setlength{\noteDotsRadius@kn}{#1} |
| 66 |
} |
| 67 |
\NewDocumentCommand{\SetNoteLineDistance}{O{6truemm}}{% |
| 68 |
\setlength{\noteLineDistance@kn}{#1} |
| 69 |
} |
| 70 |
\NewDocumentCommand{\SetNoteTriangleSize}{O{.7truept}}{% |
| 71 |
\setlength{\noteTriangle@mag@kn}{#1} |
| 72 |
} |
| 73 |
|
| 74 |
% 内部レジスタ |
| 75 |
\newdimen\VDNT@currentXPos |
| 76 |
\newdimen\VDNT@currentYPos |
| 77 |
\newdimen\VDNT@Xinterval |
| 78 |
\newdimen\VDNT@Yinterval |
| 79 |
\newdimen\VDNT@notegoal |
| 80 |
\def\VDNT@xscaler{.996} |
| 81 |
|
| 82 |
% \notefillで用いる座標管理用カウンタの準備 |
| 83 |
\def\VDNT@pkgname{vodnote} |
| 84 |
\global\newcount\VDNT@uniqe |
| 85 |
|
| 86 |
|
| 87 |
% 行間算出 |
| 88 |
\newcount\kn@linecount@internal |
| 89 |
\newcommand{\cal@kn@internal}{% |
| 90 |
\FPeval\VDNT@dotsNum{round(round(((\the)\@tempcnta/(\the)\@tempcntb)/2:0)*2:0)}% |
| 91 |
\VDNT@Xinterval\dimexpr(\linewidth)/\VDNT@dotsNum\relax% |
| 92 |
\VDNT@Yinterval\VDNT@Xinterval% |
| 93 |
} |
| 94 |
|
| 95 |
|
| 96 |
% \notefill の定義 |
| 97 |
% \notefill用内部マクロ |
| 98 |
\newcommand{\savepos@kn@internal@notefill}{% |
| 99 |
\zsaveposy{\VDNT@pkgname.\the\[email protected]}% 上端の座標取得 |
| 100 |
\leavevmode\vfill\leavevmode% 下まで移動→座標記憶 |
| 101 |
\zsaveposy{\VDNT@pkgname.\the\[email protected]}% 下端の座標取得 |
| 102 |
} |
| 103 |
\newcommand{\cal@kn@internal@notefill}{% |
| 104 |
\VDNT@notegoal=\dimexpr |
| 105 |
\zposy{\VDNT@pkgname.\the\[email protected]}sp |
| 106 |
-\zposy{\VDNT@pkgname.\the\[email protected]}sp |
| 107 |
\relax% |
| 108 |
} |
| 109 |
\newif\ifVDNT@shownumber |
| 110 |
\pgfkeys{ |
| 111 |
/VDNT/.is family, /VDNT, |
| 112 |
color/.estore in = \VDNT@color, |
| 113 |
step/.estore in = \VDNT@step, |
| 114 |
show number/.is if = VDNT@shownumber, |
| 115 |
default/.style = {color=white!70!black, step=5} |
| 116 |
} |
| 117 |
|
| 118 |
\NewDocumentCommand{\notefill}{ O{} }{% |
| 119 |
\par\bgroup% |
| 120 |
\pgfkeys{/VDNT, default, #1}% |
| 121 |
\parindent\z@% |
| 122 |
\@tempcnta\linewidth% 総横幅 |
| 123 |
\@tempcntb\noteLineDistance@kn% 単位横幅 |
| 124 |
\cal@kn@internal% |
| 125 |
\savepos@kn@internal@notefill% |
| 126 |
\cal@kn@internal@notefill% |
| 127 |
%%%行数算出 |
| 128 |
\pgfmathtruncatemacro{\VDNT@totalLines}{floor(\VDNT@notegoal / \VDNT@Yinterval)}% |
| 129 |
%%% |
| 130 |
% ノート罫線描画本体 |
| 131 |
\noindent\smash{% |
| 132 |
\begin{tikzpicture}[xscale=\VDNT@xscaler] |
| 133 |
\VDNT@currentYPos\z@ |
| 134 |
%%% |
| 135 |
\kn@linecount@internal=\VDNT@totalLines\relax % 初期値を総行数に設定 |
| 136 |
\advance\kn@linecount@internal by \@ne\relax % |
| 137 |
%%% |
| 138 |
% 上端の三角 |
| 139 |
\coordinate (TopMarkerTip) at (\VDNT@Xinterval*\VDNT@dotsNum/2, \VDNT@currentYPos+\noteTriangle@mag@kn*4pt); |
| 140 |
\fill[\VDNT@color] (TopMarkerTip) -- ++(\noteTriangle@mag@kn*3pt,-\noteTriangle@mag@kn*4pt) -- ++(-\noteTriangle@mag@kn*6pt,0) -- cycle; |
| 141 |
% 罫線とドットのループ描画 |
| 142 |
\@whiledim\VDNT@currentYPos<\VDNT@notegoal\do{% |
| 143 |
% 横線の左端(L)と右端(R) |
| 144 |
\coordinate (L) at (0, \VDNT@currentYPos); |
| 145 |
\coordinate (R) at (\linewidth, \VDNT@currentYPos); |
| 146 |
% --- 行番号の描画 --- |
| 147 |
\ifVDNT@shownumber |
| 148 |
\pgfmathtruncatemacro{\rem@notefill}{mod(\kn@linecount@internal,\VDNT@step)} |
| 149 |
\ifnum\rem@notefill=0 |
| 150 |
\node[anchor=east, font=\scriptsize, text=\VDNT@color, overlay] at ([xshift=-\f@size/2pt]L) {\the\kn@linecount@internal}; |
| 151 |
\fi |
| 152 |
\fi |
| 153 |
% -------------------- |
| 154 |
% 罫線を引く |
| 155 |
\draw[\VDNT@color, line width=\noteLineWidth@kn] (L) -- (R); |
| 156 |
% ループ内のドット描画部分 |
| 157 |
\foreach \k in{0,1,...,\VDNT@dotsNum}{% |
| 158 |
\pgfmathtruncatemacro{\VDNT@halfNum}{\VDNT@dotsNum/2}% |
| 159 |
\def\do@draw@dot{1}% 描画フラグを立てる |
| 160 |
% 「現在の行が最初」かつ「kが真ん中」ならフラグを折る |
| 161 |
\ifdim\VDNT@currentYPos=0pt\relax |
| 162 |
\ifnum\k=\VDNT@halfNum \def\do@draw@dot{0}\fi |
| 163 |
\fi |
| 164 |
% 「現在の行が最後(次がない)」かつ「kが真ん中」ならフラグを折る |
| 165 |
% \VDNT@notegoal との比較で行う |
| 166 |
\VDNT@currentXPos=\dimexpr\VDNT@currentYPos+\VDNT@Yinterval\relax |
| 167 |
\ifdim\VDNT@currentXPos<\VDNT@notegoal\else |
| 168 |
\ifnum\k=\VDNT@halfNum \def\do@draw@dot{0}\fi |
| 169 |
\fi |
| 170 |
\ifnum\do@draw@dot=1\relax |
| 171 |
\coordinate (Dot) at (\the\dimexpr\VDNT@Xinterval*\k\relax, \VDNT@currentYPos); |
| 172 |
\fill[\VDNT@color] (Dot) circle [radius=\noteDotsRadius@kn]; |
| 173 |
\fi |
| 174 |
} |
| 175 |
% 次の行へ移動 |
| 176 |
\advance\VDNT@currentYPos\VDNT@Yinterval\relax |
| 177 |
%%%カウントダウン |
| 178 |
\advance\kn@linecount@internal by -\@ne\relax |
| 179 |
%%% |
| 180 |
} |
| 181 |
% 下端の三角 |
| 182 |
% 座標を定義:(中心X, 最後の行Y - 4pt) |
| 183 |
\coordinate (BottomMarkerTip) at (\VDNT@Xinterval*\VDNT@dotsNum/2, \VDNT@currentYPos-\VDNT@Yinterval-\noteTriangle@mag@kn*4pt); |
| 184 |
\fill[\VDNT@color] (BottomMarkerTip) -- ++(\noteTriangle@mag@kn*3pt,\noteTriangle@mag@kn*4pt) -- ++(-\noteTriangle@mag@kn*6pt,0) -- cycle; |
| 185 |
\end{tikzpicture}% |
| 186 |
}% |
| 187 |
\egroup% |
| 188 |
\global\advance\VDNT@uniqe\@ne% 描画番号を進める |
| 189 |
\par% |
| 190 |
} |
| 191 |
|
| 192 |
\NewDocumentCommand{\masumefill}{ s O{} }{% |
| 193 |
\par\bgroup% |
| 194 |
\pgfkeys{/VDNT, default, #2}% |
| 195 |
\parindent\z@% |
| 196 |
\@tempcnta\linewidth% 総横幅 |
| 197 |
\@tempcntb\noteLineDistance@kn% 単位横幅 |
| 198 |
\cal@kn@internal% |
| 199 |
\savepos@kn@internal@notefill% |
| 200 |
\cal@kn@internal@notefill% |
| 201 |
%%%行数算出 |
| 202 |
\pgfmathtruncatemacro{\VDNT@totalLines}{floor(\VDNT@notegoal / \VDNT@Yinterval)}% |
| 203 |
%%% |
| 204 |
% ノート罫線描画本体 |
| 205 |
\noindent\smash{% |
| 206 |
\begin{tikzpicture}[xscale=\VDNT@xscaler] |
| 207 |
\VDNT@currentYPos\z@ |
| 208 |
%%% |
| 209 |
\kn@linecount@internal=\VDNT@totalLines\relax % 初期値を総行数に設定 |
| 210 |
\advance\kn@linecount@internal by \@ne\relax % |
| 211 |
%%% |
| 212 |
% 上端の三角 |
| 213 |
\coordinate (TopMarkerTip) at (\VDNT@Xinterval*\VDNT@dotsNum/2, \VDNT@currentYPos+\noteTriangle@mag@kn*4pt); |
| 214 |
\fill[\VDNT@color] (TopMarkerTip) -- ++(\noteTriangle@mag@kn*3pt,-\noteTriangle@mag@kn*4pt) -- ++(-\noteTriangle@mag@kn*6pt,0) -- cycle; |
| 215 |
% 罫線とドットのループ描画 |
| 216 |
\@whiledim\VDNT@currentYPos<\VDNT@notegoal\do{% |
| 217 |
% 横線の左端(L)と右端(R) |
| 218 |
\coordinate (L) at (0, \VDNT@currentYPos); |
| 219 |
\coordinate (R) at (\linewidth, \VDNT@currentYPos); |
| 220 |
% --- 行番号の描画 --- |
| 221 |
\ifVDNT@shownumber |
| 222 |
\pgfmathtruncatemacro{\rem@notefill}{mod(\kn@linecount@internal,\VDNT@step)} |
| 223 |
\ifnum\rem@notefill=0 |
| 224 |
\node[anchor=east, font=\scriptsize, text=\VDNT@color, overlay] at ([xshift=-\f@size/2pt]L) {\the\kn@linecount@internal}; |
| 225 |
\fi |
| 226 |
\fi |
| 227 |
% -------------------- |
| 228 |
% 罫線を引く |
| 229 |
\draw[\VDNT@color, line width=\noteLineWidth@kn] (L) -- (R); |
| 230 |
% ループ内のドット描画部分 |
| 231 |
\foreach \k in{0,1,...,\VDNT@dotsNum}{% |
| 232 |
\pgfmathtruncatemacro{\VDNT@halfNum}{\VDNT@dotsNum/2}% |
| 233 |
\def\do@draw@dot{1}% 描画フラグを立てる |
| 234 |
% 「現在の行が最初」かつ「kが真ん中」ならフラグを折る |
| 235 |
\ifdim\VDNT@currentYPos=0pt\relax |
| 236 |
\ifnum\k=\VDNT@halfNum \def\do@draw@dot{0}\fi |
| 237 |
\fi |
| 238 |
% 「現在の行が最後(次がない)」かつ「kが真ん中」ならフラグを折る |
| 239 |
% \VDNT@notegoal との比較で行う |
| 240 |
\VDNT@currentXPos=\dimexpr\VDNT@currentYPos+\VDNT@Yinterval\relax |
| 241 |
\ifdim\VDNT@currentXPos<\VDNT@notegoal\else |
| 242 |
\ifnum\k=\VDNT@halfNum \def\do@draw@dot{0}\fi |
| 243 |
\fi |
| 244 |
% ------------------ |
| 245 |
\coordinate (VBottom) at (\the\dimexpr\VDNT@Xinterval*\k\relax, \VDNT@currentYPos); |
| 246 |
\VDNT@currentXPos=\dimexpr\VDNT@currentYPos+\VDNT@Yinterval\relax |
| 247 |
\ifdim\VDNT@currentXPos<\VDNT@notegoal\relax |
| 248 |
\draw[\VDNT@color, line width=\noteLineWidth@kn] (VBottom) -- ++(0, \VDNT@Yinterval); |
| 249 |
\fi |
| 250 |
% ------------------ |
| 251 |
\ifnum\do@draw@dot=1\relax |
| 252 |
\coordinate (Dot) at (\the\dimexpr\VDNT@Xinterval*\k\relax, \VDNT@currentYPos); |
| 253 |
\fill[\VDNT@color] (Dot) circle [radius=\noteDotsRadius@kn]; |
| 254 |
\fi |
| 255 |
} |
| 256 |
% 次の行へ移動 |
| 257 |
\advance\VDNT@currentYPos\VDNT@Yinterval\relax |
| 258 |
%%%カウントダウン |
| 259 |
\advance\kn@linecount@internal by -\@ne\relax |
| 260 |
%%% |
| 261 |
} |
| 262 |
% 外枠描画 |
| 263 |
\IfBooleanT{#1}{% |
| 264 |
\draw[\VDNT@color, line width=\noteLineWidth@kn*2.5] (0,0) rectangle (\linewidth, \the\dimexpr\VDNT@currentYPos-\VDNT@Yinterval\relax); |
| 265 |
}% |
| 266 |
% 下端の三角 |
| 267 |
% 座標を定義:(中心X, 最後の行Y - 4pt) |
| 268 |
\coordinate (BottomMarkerTip) at (\VDNT@Xinterval*\VDNT@dotsNum/2, \VDNT@currentYPos-\VDNT@Yinterval-\noteTriangle@mag@kn*4pt); |
| 269 |
\fill[\VDNT@color] (BottomMarkerTip) -- ++(\noteTriangle@mag@kn*3pt,\noteTriangle@mag@kn*4pt) -- ++(-\noteTriangle@mag@kn*6pt,0) -- cycle; |
| 270 |
\end{tikzpicture}% |
| 271 |
}% |
| 272 |
\egroup% |
| 273 |
\global\advance\VDNT@uniqe\@ne% 描画番号を進める |
| 274 |
\par% |
| 275 |
} |
| 276 |
|
| 277 |
|
| 278 |
% \note の定義(2以上の整数を引数に) |
| 279 |
\NewDocumentCommand{\note}{ m O{} }{% |
| 280 |
\par\bgroup% |
| 281 |
\pgfkeys{/VDNT, default, #2}% |
| 282 |
\@tempcnta\linewidth% |
| 283 |
\@tempcntb\noteLineDistance@kn% |
| 284 |
\cal@kn@internal% |
| 285 |
\noindent% |
| 286 |
\begin{tikzpicture}[xscale=\VDNT@xscaler] |
| 287 |
\VDNT@currentYPos\z@ |
| 288 |
%%% |
| 289 |
\kn@linecount@internal=#1\relax |
| 290 |
%%% |
| 291 |
\coordinate (TopMarker) at (\VDNT@Xinterval*\VDNT@dotsNum/2, \VDNT@Yinterval+\noteTriangle@mag@kn*4pt); |
| 292 |
\fill[\VDNT@color] (TopMarker) -- ++(\noteTriangle@mag@kn*3pt, -\noteTriangle@mag@kn*4pt) -- ++(-\noteTriangle@mag@kn*6pt, 0) -- cycle; |
| 293 |
\foreach \i in {1, 2, ..., #1} {% |
| 294 |
\xdef\tempY{\the\dimexpr\VDNT@Yinterval*\i\relax} |
| 295 |
\coordinate (LineL) at (0, \tempY); |
| 296 |
\coordinate (LineR) at (\linewidth, \tempY); |
| 297 |
% --- 行番号の描画 --- |
| 298 |
\ifVDNT@shownumber |
| 299 |
\pgfmathtruncatemacro{\VDNT@currentnum}{#1 - \i + 1 } |
| 300 |
\pgfmathtruncatemacro{\rem@notefill}{mod(\VDNT@currentnum,\VDNT@step)} |
| 301 |
\ifnum\rem@notefill=0 |
| 302 |
\node[anchor=east, font=\scriptsize, text=\VDNT@color, overlay] at ([xshift=-\f@size/2pt]LineL) {\VDNT@currentnum}; |
| 303 |
\fi |
| 304 |
\fi |
| 305 |
% -------------------- |
| 306 |
\draw[\VDNT@color, line width=\noteLineWidth@kn] (LineL) -- (LineR); |
| 307 |
\foreach \k in {0, 1, ..., \VDNT@dotsNum} {% |
| 308 |
\pgfmathtruncatemacro{\VDNT@halfNum}{\VDNT@dotsNum/2}% |
| 309 |
\def\skipdot{0}% |
| 310 |
\ifnum\i=1 \ifnum\k=\VDNT@halfNum \def\skipdot{1}\fi\fi |
| 311 |
\ifnum\i=#1 \ifnum\k=\VDNT@halfNum \def\skipdot{1}\fi\fi |
| 312 |
\ifnum\skipdot=0 |
| 313 |
\coordinate (DotPos) at (\the\dimexpr\VDNT@Xinterval*\k\relax, \tempY); |
| 314 |
\fill[\VDNT@color] (DotPos) circle [radius=\noteDotsRadius@kn]; |
| 315 |
\fi |
| 316 |
}% |
| 317 |
% 最後に使ったY座標を記録 |
| 318 |
\ifnum\i=#1 \global\VDNT@currentYPos=\tempY\relax \fi |
| 319 |
}% |
| 320 |
\coordinate (BottomMarker) at (\VDNT@Xinterval*\VDNT@dotsNum/2, \VDNT@currentYPos-\noteTriangle@mag@kn*4pt); |
| 321 |
\fill[\VDNT@color] (BottomMarker) -- ++(\noteTriangle@mag@kn*3pt, \noteTriangle@mag@kn*4pt) -- ++(-\noteTriangle@mag@kn*6pt, 0) -- cycle; |
| 322 |
\end{tikzpicture}% |
| 323 |
\egroup% |
| 324 |
\par% |
| 325 |
} |
| 326 |
|
| 327 |
\NewDocumentCommand{\masume}{ s m O{} }{% |
| 328 |
\par\bgroup% |
| 329 |
\pgfkeys{/VDNT, default, #3}% |
| 330 |
\@tempcnta\linewidth% |
| 331 |
\@tempcntb\noteLineDistance@kn% |
| 332 |
\cal@kn@internal% |
| 333 |
\noindent% |
| 334 |
\begin{tikzpicture}[xscale=\VDNT@xscaler] |
| 335 |
\VDNT@currentYPos\z@ |
| 336 |
%%% |
| 337 |
\kn@linecount@internal=#1\relax |
| 338 |
%%% |
| 339 |
\coordinate (TopMarker) at (\VDNT@Xinterval*\VDNT@dotsNum/2, \VDNT@Yinterval+\noteTriangle@mag@kn*4pt); |
| 340 |
\fill[\VDNT@color] (TopMarker) -- ++(\noteTriangle@mag@kn*3pt, -\noteTriangle@mag@kn*4pt) -- ++(-\noteTriangle@mag@kn*6pt, 0) -- cycle; |
| 341 |
\foreach \i in {1, 2, ..., #2} {% |
| 342 |
\xdef\tempY{\the\dimexpr\VDNT@Yinterval*\i\relax} |
| 343 |
\coordinate (LineL) at (0, \tempY); |
| 344 |
\coordinate (LineR) at (\linewidth, \tempY); |
| 345 |
% --- 行番号の描画 --- |
| 346 |
\ifVDNT@shownumber |
| 347 |
\pgfmathtruncatemacro{\VDNT@currentnum}{#2 - \i + 1 } |
| 348 |
\pgfmathtruncatemacro{\rem@notefill}{mod(\VDNT@currentnum,\VDNT@step)} |
| 349 |
\ifnum\rem@notefill=0 |
| 350 |
\node[anchor=east, font=\scriptsize, text=\VDNT@color, overlay] at ([xshift=-\f@size/2pt]LineL) {\VDNT@currentnum}; |
| 351 |
\fi |
| 352 |
\fi |
| 353 |
% -------------------- |
| 354 |
\draw[\VDNT@color, line width=\noteLineWidth@kn] (LineL) -- (LineR); |
| 355 |
\foreach \k in {0, 1, ..., \VDNT@dotsNum} {% |
| 356 |
\pgfmathtruncatemacro{\VDNT@halfNum}{\VDNT@dotsNum/2}% |
| 357 |
\def\skipdot{0}% |
| 358 |
\ifnum\i=1 \ifnum\k=\VDNT@halfNum \def\skipdot{1}\fi\fi |
| 359 |
\ifnum\i=#2 \ifnum\k=\VDNT@halfNum \def\skipdot{1}\fi\fi |
| 360 |
% ------------------ |
| 361 |
\ifnum\i<#2\relax |
| 362 |
\draw[\VDNT@color, line width=\noteLineWidth@kn] (\the\dimexpr\VDNT@Xinterval*\k\relax, \tempY) -- ++(0, \VDNT@Yinterval); |
| 363 |
\fi |
| 364 |
% ------------------ |
| 365 |
\ifnum\skipdot=0 |
| 366 |
\coordinate (DotPos) at (\the\dimexpr\VDNT@Xinterval*\k\relax, \tempY); |
| 367 |
\fill[\VDNT@color] (DotPos) circle [radius=\noteDotsRadius@kn]; |
| 368 |
\fi |
| 369 |
}% |
| 370 |
% 最後に使ったY座標を記録しておく(下の三角用) |
| 371 |
\ifnum\i=#2 \global\VDNT@currentYPos=\tempY\relax \fi |
| 372 |
}% |
| 373 |
\IfBooleanT{#1}{% |
| 374 |
\draw[\VDNT@color, line width=\noteLineWidth@kn*2.5] (0, \the\VDNT@Yinterval) rectangle (\linewidth, \VDNT@currentYPos); |
| 375 |
}% |
| 376 |
\coordinate (BottomMarker) at (\VDNT@Xinterval*\VDNT@dotsNum/2, \VDNT@currentYPos-\noteTriangle@mag@kn*4pt); |
| 377 |
\fill[\VDNT@color] (BottomMarker) -- ++(\noteTriangle@mag@kn*3pt, \noteTriangle@mag@kn*4pt) -- ++(-\noteTriangle@mag@kn*6pt, 0) -- cycle; |
| 378 |
\end{tikzpicture}% |
| 379 |
\egroup% |
| 380 |
\par% |
| 381 |
} |
| 382 |
|
| 383 |
\endinput |