| 1 |
\documentclass[luatex,fontsize=8pt,paper=b5,twoside]{jlreq}% |
| 2 |
\usepackage{amsmath,amssymb} |
| 3 |
\usepackage{booktabs,caption} |
| 4 |
\usepackage{luwa-ul, KKluaverb} |
| 5 |
\usepackage[most]{tcolorbox} |
| 6 |
\usepackage{luatexja-ruby,lltjext} |
| 7 |
\usepackage{modernruler} |
| 8 |
|
| 9 |
% You can omit these font settings. |
| 10 |
\makeatletter |
| 11 |
\RequirePackage[no-math]{fontspec} |
| 12 |
\RequirePackage[no-math,match,scale=1]{luatexja-fontspec} |
| 13 |
\RequirePackage[hiragino-pro,deluxe,expert]{luatexja-preset} |
| 14 |
\setmainfont{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] |
| 15 |
\setmainjfont{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] |
| 16 |
\newfontfamily{\sfhira@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6] |
| 17 |
\newjfontfamily{\sfhiraj@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6] |
| 18 |
\newfontfamily{\mchira@pre}{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] |
| 19 |
\newjfontfamily{\mchiraj@pre}{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] |
| 20 |
\newfontfamily{\gthira@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6,FontFace={eb}{\shapedefault}{HiraKakuStd-W8}] |
| 21 |
\newjfontfamily{\gthiraj@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6,FontFace={eb}{\shapedefault}{HiraKakuStd-W8}] |
| 22 |
\newfontfamily{\mghira@pre}{HiraMaruPro-W4} |
| 23 |
\newjfontfamily{\mghiraj@pre}{HiraMaruPro-W4} |
| 24 |
\renewcommand{\sffamily}{\sfhira@pre\sfhiraj@pre} |
| 25 |
\renewcommand{\mcfamily}{\mchira@pre\mchiraj@pre} |
| 26 |
\renewcommand{\gtfamily}{\gthira@pre\gthiraj@pre} |
| 27 |
\renewcommand{\mgfamily}{\mghira@pre\mghiraj@pre} |
| 28 |
\makeatother |
| 29 |
%%% |
| 30 |
|
| 31 |
|
| 32 |
\usepackage{hyperref} |
| 33 |
\hypersetup{ |
| 34 |
luatex, pdfencoding=auto, |
| 35 |
colorlinks=true, |
| 36 |
linkcolor=black, |
| 37 |
citecolor=black, |
| 38 |
urlcolor=DeepSkyBlue3, |
| 39 |
pdfborder={0 0 0}, |
| 40 |
} |
| 41 |
|
| 42 |
\colorlet{grayLight}{white!80!black} |
| 43 |
|
| 44 |
\NewTCBListing{SourceCode}{ m m !o !O{DeepSkyBlue3} }{% |
| 45 |
enhanced, colback=black!70, colframe=Snow4, |
| 46 |
toptitle=-1mm, bottomtitle=-1mm, |
| 47 |
righttitle=-1mm, lefttitle=-1mm, |
| 48 |
arc=.5mm, |
| 49 |
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, |
| 50 |
breakable,before upper={\color{white}},top=-0.5mm,bottom=-0.5mm, |
| 51 |
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}}}}, |
| 52 |
listing only, |
| 53 |
listing options={ |
| 54 |
language={#2}, |
| 55 |
basicstyle=\ttfamily, |
| 56 |
keywordstyle=\ttfamily\color{white}, |
| 57 |
stringstyle=\itshape\color{white}, |
| 58 |
commentstyle=\small\gtfamily\color{DeepSkyBlue2}, |
| 59 |
showspaces=false,showtabs=false, |
| 60 |
breaklines=true,breakindent=0pt, |
| 61 |
showstringspaces=false, |
| 62 |
columns=fullflexible, |
| 63 |
tabsize=2, |
| 64 |
numbers=left,numbersep=1.5pt, |
| 65 |
numberstyle=\scriptsize\gtfamily\color{gray}, |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
\NewTColorBox{OutPut}{ m !o !O{DeepSkyBlue3} }{% |
| 70 |
enhanced, colframe=Snow4, |
| 71 |
toptitle=-1mm, bottomtitle=-1mm, |
| 72 |
righttitle=-1mm, lefttitle=-1mm, |
| 73 |
arc=.5mm, colback=white, |
| 74 |
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, |
| 75 |
breakable,top=-0.5mm,bottom=-0.5mm, |
| 76 |
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, |
| 77 |
} |
| 78 |
|
| 79 |
|
| 80 |
\title{\texttt{modernruler} Package Documentation} |
| 81 |
\author{Kosei Kawaguchi a.k.a. KKTeX} |
| 82 |
\date{Version 2.2.0 (2026/05/19)} |
| 83 |
|
| 84 |
\begin{document} |
| 85 |
\begin{titlepage} |
| 86 |
\maketitle |
| 87 |
\end{titlepage} |
| 88 |
\newpage |
| 89 |
\tableofcontents |
| 90 |
\newpage |
| 91 |
|
| 92 |
\section{Outline} |
| 93 |
This package provides modern hrule (\KKverb|\mruleth|), vrule (\KKverb|\mruletv|), and \undernote*{\KKverb|\undernote|}{Used like this!\\ It is the main function provided by this package.} internally uses the two commands. |
| 94 |
|
| 95 |
\begin{SourceCode}{Intput}{TeX} |
| 96 |
% normal rule |
| 97 |
\mruleth[height=1pt, width=5cm, color=blue] |
| 98 |
|
| 99 |
% dashed rule |
| 100 |
\mruleth[height=2pt, width=8cm, color=red, dash=true, dash-len=5pt, gap-len=3pt] |
| 101 |
|
| 102 |
% inline rule |
| 103 |
This is \mruletv[height=\zw, depth=1.5\zw, width=1pt, color=green] a modern vrule. |
| 104 |
|
| 105 |
% inline dashed rule |
| 106 |
This is \mruletv[height=2\zw, width=1.5pt, color=orange, dash=true, dash-len=2pt, gap-len=1pt] a dashed modern vrule. |
| 107 |
|
| 108 |
% undernote |
| 109 |
This is under note. This uses \undernote{these commands}{\texttt{\textbackslash mruleh} and \texttt{\textbackslash mrulev}} internally and enables make flexible outputs. |
| 110 |
\end{SourceCode} |
| 111 |
\begin{OutPut}{Output} |
| 112 |
% normal rule |
| 113 |
\mruleth[height=1pt, width=5cm, color=blue] |
| 114 |
|
| 115 |
% dashed rule |
| 116 |
\mruleth[height=2pt, width=8cm, color=red, dash=true, dash-len=5pt, gap-len=3pt] |
| 117 |
|
| 118 |
% inline rule |
| 119 |
This is \mruletv[height=\zw, depth=1.5\zw, width=1pt, color=green] a modern vrule. |
| 120 |
|
| 121 |
% inline dashed rule |
| 122 |
This is \mruletv[height=2\zw, width=1.5pt, color=orange, dash=true, dash-len=2pt, gap-len=1pt] a dashed modern vrule. |
| 123 |
|
| 124 |
% undernote |
| 125 |
This is under note. This uses \undernote{these commands}{\texttt{\textbackslash mruleh} and \texttt{\textbackslash mrulev}} internally and enables make flexible outputs. |
| 126 |
\end{OutPut} |
| 127 |
|
| 128 |
\section{Acknowledgements / Credits} |
| 129 |
This package was inspired by discussions on TeX Forum concerning |
| 130 |
undernote-like constructions using rules. |
| 131 |
|
| 132 |
An improved approach was later presented by Mr.~Yusuke~Terada, |
| 133 |
which clarified several implementation details. |
| 134 |
|
| 135 |
The present package is a complete reimplementation and extension, |
| 136 |
introducing a generalized rule-based engine, redesigned control flow, |
| 137 |
and additional features such as modern ruler integration and |
| 138 |
\texttt{tcolorbox}-based abstractions. |
| 139 |
|
| 140 |
Any remaining errors or design decisions are entirely the |
| 141 |
responsibility of the author. |
| 142 |
|
| 143 |
\section{Note} |
| 144 |
\textbf{This package only supports LuaLaTeX.} |
| 145 |
|
| 146 |
In this package, a unit \verb|\zw| is used in many parts. It is Japanese standard unit, but it's not normal outside of Japan. When you encounter \verb|\zw| in documemntations, please understand it as \verb|1em|. In detail, \verb|\zw| and \verb|1em| is differnt when you use Japanese characters. But only when you use alphabetic characters and numbers, the difference doesn't matter. |
| 147 |
|
| 148 |
\section{Installation} |
| 149 |
\begin{SourceCode}{Intput}{TeX} |
| 150 |
\usepackage[<options>]{modernruler} |
| 151 |
\end{SourceCode} |
| 152 |
|
| 153 |
Detailed information regarding the options will be provided in a later section, specifically during the explanation of the \verb|\undernote| command. |
| 154 |
|
| 155 |
\section{Commands} |
| 156 |
\subsection{\texttt{\textbackslash mruleth, \textbackslash mruletv}} |
| 157 |
\subsubsection{Basic Usage} |
| 158 |
In the first place, \verb|\mruleth| and \verb|mruletv| are extended \verb|\hrule| and \verb|\vrule|. You can use them like this: |
| 159 |
|
| 160 |
\begin{SourceCode}{Intput}{TeX} |
| 161 |
\mruleth[<keyvaloptions>] |
| 162 |
\mruletv[<keyvaloptions>] |
| 163 |
\end{SourceCode} |
| 164 |
|
| 165 |
These commands share the same keys.\bigskip |
| 166 |
|
| 167 |
\begin{center} |
| 168 |
\begin{tabular}{llll} |
| 169 |
\toprule |
| 170 |
\textbf{Key} & \textbf{Type} & \textbf{Default} & \textbf{Description} \\ \midrule |
| 171 |
width & dim & 0pt & Width of the rule \\ |
| 172 |
height & dim & 0pt & Height above the baseline \\ |
| 173 |
depth & dim & 0pt & Depth below the baseline \\ |
| 174 |
color & tl & black & Color of the rule \\ |
| 175 |
gap-color & tl & white & Color of the gap segments \\ |
| 176 |
dash & bool & false & Enables dashed line if true \\ |
| 177 |
dash-len & dim & 3pt & Length of the dash segment \\ |
| 178 |
gap-len & dim & 2.5pt & Length of the gap between dashes \\ |
| 179 |
\bottomrule |
| 180 |
\end{tabular} |
| 181 |
\end{center}\bigskip |
| 182 |
|
| 183 |
The outputs are as follows: |
| 184 |
|
| 185 |
\begin{SourceCode}{Intput}{TeX} |
| 186 |
\fboxsep=0pt\fboxrule=.1pt% |
| 187 |
|
| 188 |
% horizontal rule |
| 189 |
\fbox{\mruleth[height=1pt, width=55pt, color=blue]} |
| 190 |
\fbox{\mruleth[height=1pt, width=55pt, color=blue, dash=true]} |
| 191 |
\fbox{\mruleth[height=1pt, width=57pt, color=blue, dash=true]} |
| 192 |
\fbox{\mruleth[height=1pt, width=59pt, color=blue, dash=true]} |
| 193 |
|
| 194 |
% vertical rule |
| 195 |
\fbox{\mruletv[width=1pt, height=55pt, color=blue]} |
| 196 |
\fbox{\mruletv[width=1pt, height=55pt, color=blue, dash=true]} |
| 197 |
\fbox{\mruletv[width=1pt, height=57pt, color=blue, dash=true]} |
| 198 |
\fbox{\mruletv[width=1pt, height=59pt, color=blue, dash=true]}\bigskip |
| 199 |
|
| 200 |
% Horizontal: Alternating Black and Cyan segments |
| 201 |
\mruleth[width=120pt, height=2pt, dash=true, dash-len=6pt, gap-len=6pt, color=black, gap-color=cyan]\bigskip |
| 202 |
|
| 203 |
% Vertical: Warning Pattern (Yellow and Black) |
| 204 |
\mruletv[width=3pt, height=50pt, dash=true, dash-len=8pt, gap-len=4pt, color=yellow, gap-color=black] |
| 205 |
\end{SourceCode} |
| 206 |
|
| 207 |
\begin{OutPut}{Output} |
| 208 |
\fboxsep=0pt\fboxrule=.1pt% |
| 209 |
|
| 210 |
\fbox{\mruleth[height=1pt, width=55pt, color=blue]} |
| 211 |
\fbox{\mruleth[height=1pt, width=55pt, color=blue, dash=true]} |
| 212 |
\fbox{\mruleth[height=1pt, width=57pt, color=blue, dash=true]} |
| 213 |
\fbox{\mruleth[height=1pt, width=59pt, color=blue, dash=true]} |
| 214 |
|
| 215 |
\fbox{\mruletv[width=1pt, height=55pt, color=blue]} |
| 216 |
\fbox{\mruletv[width=1pt, height=55pt, color=blue, dash=true]} |
| 217 |
\fbox{\mruletv[width=1pt, height=57pt, color=blue, dash=true]} |
| 218 |
\fbox{\mruletv[width=1pt, height=59pt, color=blue, dash=true]} |
| 219 |
|
| 220 |
\bigskip |
| 221 |
|
| 222 |
% Horizontal: Alternating Black and Cyan segments |
| 223 |
\mruleth[width=120pt, height=2pt, dash=true, dash-len=6pt, gap-len=6pt, color=black, gap-color=cyan] |
| 224 |
|
| 225 |
\bigskip |
| 226 |
|
| 227 |
% Vertical: Warning Pattern (Yellow and Black) |
| 228 |
\mruletv[width=3pt, height=50pt, dash=true, dash-len=8pt, gap-len=4pt, color=yellow, gap-color=black] |
| 229 |
\end{OutPut} |
| 230 |
|
| 231 |
\subsubsection{Advanced usage: Use Like Phantom} |
| 232 |
By setting the width to zero, these commands can be used as "phantoms" that provide arbitrary height and depth. |
| 233 |
In a traditional way to set a phantom, you use \verb|\vphantom| or \verb|\hphantom|. How ever, the total-height or width depends on the argument. So, I recommend you to use the modern-rulers as a flexible phantom. |
| 234 |
|
| 235 |
\begin{SourceCode}{Intput}{TeX} |
| 236 |
% To visualize |
| 237 |
\fboxrule=.1pt\fboxsep=0pt |
| 238 |
|
| 239 |
% modern-vphantom |
| 240 |
abc\fbox{\mruleth[height=2em, depth=.5em, width=0pt]def}ghi |
| 241 |
|
| 242 |
% modern-hphantom |
| 243 |
jkl\fbox{\mruletv[height=0pt, width=2em]mno\mruletv[height=0pt, width=1em]}pqr |
| 244 |
\end{SourceCode} |
| 245 |
|
| 246 |
\begin{OutPut}{Output} |
| 247 |
% To visualize |
| 248 |
\fboxrule=.1pt\fboxsep=0pt |
| 249 |
|
| 250 |
% modern-vphantom |
| 251 |
abc\fbox{\mruleth[height=2em, depth=.5em, width=0pt]def}ghi |
| 252 |
|
| 253 |
% modern-hphantom |
| 254 |
jkl\fbox{\mruletv[height=0pt, width=2em]mno\mruletv[height=0pt, width=1em]}pqr |
| 255 |
\end{OutPut} |
| 256 |
|
| 257 |
\subsection{\texttt{\textbackslash undernote}} |
| 258 |
\subsubsection{Basic Usage} |
| 259 |
This commands provides underlined \undernote{annotation}{Like this.}. There is some optional parameters which adjust the position of the annotation text. |
| 260 |
|
| 261 |
\begin{SourceCode}{Intput}{TeX} |
| 262 |
% grammar |
| 263 |
\undernote<star option>[<number of lines to shift the note downward>]{<the target phrase>}{<annotation>} |
| 264 |
|
| 265 |
% example |
| 266 |
In this single paragraph, we deliberately place many annotated terms to |
| 267 |
stress-test the undernote mechanism, starting with a |
| 268 |
\undernote{concept}{A brief explanation of the main concept} |
| 269 |
that appears early in the line, followed closely by another\\ |
| 270 |
\undernote{idea}{A slightly longer explanatory note that is expected to |
| 271 |
interact with nearby notes} to encourage horizontal overlap detection. |
| 272 |
As the sentence continues, we insert a fixed-level annotation such as |
| 273 |
\undernote[2]{method}{This note is forced onto the second vertical level} |
| 274 |
to verify that manual level assignment overrides automatic stacking, |
| 275 |
and later a short |
| 276 |
\undernote{term}{Short note} |
| 277 |
next to a much longer |
| 278 |
\undernote*{expression}{This is a considerably longer explanatory note |
| 279 |
designed to increase the occupied width and push subsequent notes |
| 280 |
downward in the vertical stacking algorithm}. |
| 281 |
Near the end of the paragraph, we add one more fixed example, |
| 282 |
\undernote[3]{result}{A third-level note used to confirm deep stacking}, |
| 283 |
followed immediately by an automatic one, |
| 284 |
\undernote*{observation}{This final note should be placed at a safe |
| 285 |
vertical distance determined by the collision analysis performed |
| 286 |
during the previous compilation run}. |
| 287 |
\end{SourceCode} |
| 288 |
|
| 289 |
\begin{OutPut}{Output} |
| 290 |
In this single paragraph, we deliberately place many annotated terms to |
| 291 |
stress-test the undernote mechanism, starting with a |
| 292 |
\undernote{concept}{A brief explanation of the main concept} |
| 293 |
that appears early in the line, followed closely by another\\ |
| 294 |
\undernote{idea}{A slightly longer explanatory note that is expected to |
| 295 |
interact with nearby notes} to encourage horizontal overlap detection. |
| 296 |
As the sentence continues, we insert a fixed-level annotation such as |
| 297 |
\undernote{method}{This note is forced onto the second vertical level} |
| 298 |
to verify that manual level assignment overrides automatic stacking, |
| 299 |
and later a short |
| 300 |
\undernote[2]{term}{Short note} |
| 301 |
next to a much longer |
| 302 |
\undernote*{expression}{This is a considerably longer explanatory note |
| 303 |
designed to increase the occupied width and push subsequent notes |
| 304 |
downward in the vertical stacking algorithm}. |
| 305 |
Near the end of the paragraph, we add one more fixed example, |
| 306 |
\undernote*{result}{A third-level note used to confirm deep stacking}, |
| 307 |
followed immediately by an automatic one, |
| 308 |
\undernote*{observation}{This final note should be placed at a safe |
| 309 |
vertical distance determined by the collision analysis performed |
| 310 |
during the previous compilation run}. |
| 311 |
\end{OutPut} |
| 312 |
|
| 313 |
As the example above shows, the star option puts the annotation text in a parabox. So when you include a long description in the fourth argument of the \verb|\undernote|, the option is the best way to avoid overflow. |
| 314 |
|
| 315 |
Regarding the second argument, ``number of lines to shift the note downward'' is always determined automatically if you don't specify it. I recommend using this option only when annotations are too close to each other. |
| 316 |
|
| 317 |
Of course, this package provides some package options for adjustments.\bigskip |
| 318 |
|
| 319 |
\begin{center} |
| 320 |
\begin{tabular}{lllp{.4\linewidth}} |
| 321 |
\toprule |
| 322 |
\textbf{Key} & \textbf{Type} & \textbf{Default} & \textbf{Description} \\ \midrule |
| 323 |
notesize & tl & \KKverb|\footnotesize|& Font size of the note text \\ |
| 324 |
notepos & dim & 3mm & Minimum vertical length of the line to the note \\ |
| 325 |
noteshift & dim & 4mm & Vertical shift amount per level for overlapping notes \\ |
| 326 |
noterulethickness & dim & \KKverb|.07\zw| & Thickness of the rule used in the note \\ |
| 327 |
noterulehshift & dim & 1.5mm & Horizontal offset of the vertical line from the underline start \\ |
| 328 |
noterulehsize & dim & 1.5mm & Length of the horizontal line extending to the note \\ |
| 329 |
notesep & dim & 0em & Minimum horizontal distance to prevent note overlap \\ |
| 330 |
noteoverhang & dim & 5em & Extension length of the note parbox (starred version) \\ |
| 331 |
noteparstyle & int & 0 & Border style (0: none, 1: solid, 2: dashed) \\ |
| 332 |
notelinecolor & color & black & Color of the the underline and the vertical line \\ |
| 333 |
\bottomrule |
| 334 |
\end{tabular} |
| 335 |
\end{center}\bigskip |
| 336 |
|
| 337 |
When you want to change some settings in the middle of the document, you can use \verb|\SetUNote|. |
| 338 |
It takes a keyvalue-style options like this: |
| 339 |
|
| 340 |
\begin{SourceCode}{Intput}{TeX} |
| 341 |
\SetUNote[noteparstyle=1, notelinecolor=blue] |
| 342 |
|
| 343 |
LaTeX is a \undernote{versatile}{Abundant package that can be used for free.} typesetting system \undernote*{that excels at producing high-quality documents}{I think LaTeX is the most flexibly customizable typesetting software.}, especially those containing complex mathematical formulas or technical structures. |
| 344 |
\end{SourceCode} |
| 345 |
|
| 346 |
|
| 347 |
\begin{OutPut}{Output} |
| 348 |
\SetUNote[noteparstyle=1, notelinecolor=blue] |
| 349 |
|
| 350 |
LaTeX is a \undernote{versatile}{Abundant package that can be used for free.} typesetting system \undernote*{that excels at producing high-quality documents}{I think LaTeX is the most flexibly customizable typesetting software.}, especially those containing complex mathematical formulas or technical structures. |
| 351 |
\end{OutPut} |
| 352 |
|
| 353 |
These are all the keys provided for it.\bigskip |
| 354 |
|
| 355 |
\begin{center} |
| 356 |
\begin{tabular}{lllp{.4\linewidth}} |
| 357 |
\toprule |
| 358 |
\textbf{Key} & \textbf{Type} & \textbf{Default} & \textbf{Description} \\ \midrule |
| 359 |
\texttt{notesize} & tl & \KKverb|\footnotesize| & Font size of the note text. \\ |
| 360 |
\texttt{notepos} & dim & --- & Minimum vertical length of the line connecting to the note. \\ |
| 361 |
\texttt{noteshift} & dim & --- & Vertical shift amount per level for overlapping notes. \\ |
| 362 |
\texttt{noterulethickness} & dim & --- & Thickness of the rules used in the note structure. \\ |
| 363 |
\texttt{noterulehshift} & dim & --- & Horizontal offset of the vertical line from the start of the underline. \\ |
| 364 |
\texttt{noterulehsize} & dim & --- & Length of the horizontal line extending towards the note. \\ |
| 365 |
\texttt{notesep} & dim & --- & Minimum horizontal distance to prevent overlap between notes. \\ |
| 366 |
\texttt{noteoverhang} & dim & --- & Extra horizontal extension for the note's parbox (used in starred version). \\ |
| 367 |
\texttt{noteparstyle} & int & 0 & Border style for the note (0: none, 1: solid, 2: dashed). \\ |
| 368 |
\texttt{notelinecolor} & color & black & Color of the underline and the connected vertical lines. \\ |
| 369 |
\bottomrule |
| 370 |
\end{tabular} |
| 371 |
\end{center}\bigskip |
| 372 |
|
| 373 |
\subsubsection{Additional Description} |
| 374 |
|
| 375 |
You can use the command in mathmode. |
| 376 |
|
| 377 |
\begin{SourceCode}{Intput}{TeX} |
| 378 |
\[ |
| 379 |
\undernote {% |
| 380 |
a + b |
| 381 |
}{In the equation envriomnemt.} |
| 382 |
- |
| 383 |
\undernote*{% |
| 384 |
x^5 + 4x^3 + \int_{c}^{\frac{d}{e}}\sum_{k=1}^{n} {}_n\mathrm{C}_k x^k + 12 |
| 385 |
}{Even the argument includes an expression with large depth, they doesn't overlap the other texts.} |
| 386 |
= \undernote{\frac{a}{b+\frac{x}{6}}}{No problem.} |
| 387 |
\] |
| 388 |
\end{SourceCode} |
| 389 |
|
| 390 |
\begin{OutPut}{Output} |
| 391 |
\[ |
| 392 |
\undernote {% |
| 393 |
a + b |
| 394 |
}{In the equation envriomnemt.} |
| 395 |
- |
| 396 |
\undernote*{% |
| 397 |
x^5 + 4x^3 + \int_{c}^{\frac{d}{e}}\sum_{k=1}^{n} {}_n\mathrm{C}_k x^k + 12 |
| 398 |
}{Even the argument includes an expression with large depth, they doesn't overlap the other texts.} |
| 399 |
= \undernote{\frac{a}{b+\frac{x}{6}}}{No problem.} |
| 400 |
\] |
| 401 |
\end{OutPut} |
| 402 |
|
| 403 |
\section{License} |
| 404 |
Released under the MIT License. |
| 405 |
|
| 406 |
\section{Version History} |
| 407 |
\begin{itemize} |
| 408 |
\item \textbf{v1.0.0--1.1.0} --- Initial public release, and add a fallback for \verb|\zw| and \verb|\ltjgetparameter|. |
| 409 |
\item \textbf{v1.3.1 (2026/01/26)} --- Fixed a bug which occurs when \verb|\undernote| command is used in mathmode. The bug was caused my misreplacement of \verb|\@elt|. |
| 410 |
\item \textbf{v2.1.5 (2026/02/06)} --- In this update, I made changes in the following two points: |
| 411 |
\begin{itemize} |
| 412 |
\item Fixed a bug where the arguments of the \verb|\undernote| with large depth caused text overlap. |
| 413 |
\item Modernized the internal implementation by migrating from TeX primitives to the expl3 framework. |
| 414 |
\end{itemize} |
| 415 |
\item \textbf{v2.1.6 (2026/02/07)} --- Fixed a bug which occurs when \verb|noteparstyle| is set to ``2''. Also, added an error message to warn users when an invalid \verb|noteparstyle| is provided. |
| 416 |
\item \textbf{v2.1.7 (2026/05/18)} --- Internal refactor with no user-facing behavior changes: |
| 417 |
\begin{itemize} |
| 418 |
\item Deduplicated the \verb|noteparstyle| dispatch logic, which was previously written in two places that needed to stay in sync. |
| 419 |
\item Factored shared dash-rendering code between \verb|\mruleth| and \verb|\mruletv| through a common loop and segment emitters. |
| 420 |
\item Unified \verb|\FramedBox| and \verb|\DashedBox| internals and extracted the shared \verb|\parbox| body used by the underlying wrap commands. |
| 421 |
\item Migrated further from TeX primitives to the expl3 framework (\verb|\def| → \verb|\cs_set:Npn|, \verb|\let| → \verb|\cs_set_eq:NN|, \verb|\ifnum| → \verb|\int_case:nnF|, etc.), and removed unused declarations. |
| 422 |
\end{itemize} |
| 423 |
\item \textbf{v2.2.0 (2026/05/19)} --- Further internal refactor with no user-facing behavior changes: |
| 424 |
\begin{itemize} |
| 425 |
\item Replaced primitive scratch registers (\verb|\dimen@|, \verb|\count@|, \verb|\@tempcnt[ab]|, \verb|\@tempdim[ab]|) with semantically named private \verb|\l__modernruler_*| variables. |
| 426 |
\item Rewrote \verb|\undernote|, \verb|\@text@undernote|, \verb|\undernotedata@internal|, \verb|\@check@undernotedata@split[@]|, and \verb|\@check@undernotedata@elt| in expl3 style (\verb|\def| → \verb|\cs_new_protected:Npn|, \verb|\ifmmode| → \verb|\mode_if_math:TF|, \verb|\leavevmode| → \verb|\mode_leave_vertical:|, \verb|\hbox| → \verb|\hbox:n|, \verb|\vtop| → \verb|\vbox_top:n|, etc.). |
| 427 |
\item Collapsed the \verb|\cs_set:Npx \l_tmpa_tl { \write\@auxout{...} } \l_tmpa_tl| idiom for \verb|.aux| writes into a single \verb|\iow_shipout:Nx|. |
| 428 |
\item Converted \verb|\@UNDATA@yfuzz| into a \verb|\dim_const:Nn| constant. |
| 429 |
\end{itemize} |
| 430 |
\end{itemize} |
| 431 |
\end{document} |