\documentclass[luatex,fontsize=8pt,paper=b5,twoside]{jlreq}% \usepackage{amsmath,amssymb} \usepackage{booktabs,caption} \usepackage{luwa-ul} \usepackage[most]{tcolorbox} \usepackage{luatexja-ruby,lltjext} \usepackage[noteoverhang=7em]{modernruler} \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. \makeatletter \RequirePackage[no-math]{fontspec} \RequirePackage[no-math,match,scale=1]{luatexja-fontspec} \RequirePackage[hiragino-pro,deluxe,expert]{luatexja-preset} \setmainfont{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] \setmainjfont{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] \newfontfamily{\sfhira@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6] \newjfontfamily{\sfhiraj@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6] \newfontfamily{\mchira@pre}{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] \newjfontfamily{\mchiraj@pre}{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] \newfontfamily{\gthira@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6,FontFace={eb}{\shapedefault}{HiraKakuStd-W8}] \newjfontfamily{\gthiraj@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6,FontFace={eb}{\shapedefault}{HiraKakuStd-W8}] \newfontfamily{\mghira@pre}{HiraMaruPro-W4} \newjfontfamily{\mghiraj@pre}{HiraMaruPro-W4} \renewcommand{\sffamily}{\sfhira@pre\sfhiraj@pre} \renewcommand{\mcfamily}{\mchira@pre\mchiraj@pre} \renewcommand{\gtfamily}{\gthira@pre\gthiraj@pre} \renewcommand{\mgfamily}{\mghira@pre\mghiraj@pre} \makeatother %%% \usepackage{hyperref} \hypersetup{ luatex, pdfencoding=auto, colorlinks=true, linkcolor=black, citecolor=black, urlcolor=DeepSkyBlue3, pdfborder={0 0 0}, } \colorlet{grayLight}{white!80!black} \NewTCBListing{SourceCode}{ m m !o !O{DeepSkyBlue3} }{% enhanced, colback=black!70, colframe=Snow4, toptitle=-1mm, bottomtitle=-1mm, righttitle=-1mm, lefttitle=-1mm, arc=.5mm, title={\tcbox[on line, arc=.5mm, boxsep=0pt, boxrule=0pt, top=1mm, bottom=0.8mm, left=2mm, right=2.2mm, colback=gray!80, coltext=white]{\raisebox{-0.1ex}{\vphantom{羅}\vphantom{j}#1}}},fonttitle=\gtfamily\footnotesize,boxrule=0.8pt, breakable,before upper={\color{white}},top=-0.5mm,bottom=-0.5mm, after title=\IfNoValueTF{#3}{}{{\hfill\tcbox[on line, arc=.5mm, boxsep=0pt, boxrule=0pt, top=1mm, bottom=0.8mm, left=2mm, right=2.2mm, colback=white!80!black, coltext=#4]{\raisebox{-0.1ex}{\vphantom{羅}\vphantom{j}#3}}}}, listing only, listing options={ language={#2}, basicstyle=\ttfamily, keywordstyle=\ttfamily\color{white}, stringstyle=\itshape\color{white}, commentstyle=\small\gtfamily\color{DeepSkyBlue2}, showspaces=false,showtabs=false, breaklines=true,breakindent=0pt, showstringspaces=false, columns=fullflexible, tabsize=2, numbers=left,numbersep=1.5pt, numberstyle=\scriptsize\gtfamily\color{gray}, } } \NewTColorBox{OutPut}{ m !o !O{DeepSkyBlue3} }{% enhanced, colframe=Snow4, toptitle=-1mm, bottomtitle=-1mm, righttitle=-1mm, lefttitle=-1mm, arc=.5mm, colback=white, title={\tcbox[on line, arc=.5mm, boxsep=0pt, boxrule=0pt, top=1mm, bottom=0.8mm, left=2mm, right=2.2mm, colback=gray!40, coltext=DeepSkyBlue3]{\raisebox{-0.1ex}{\vphantom{羅}\vphantom{j}#1}}},fonttitle=\gtfamily\footnotesize,boxrule=0.8pt, breakable,top=-0.5mm,bottom=-0.5mm, after title=\IfNoValueTF{#2}{}{{\hfill\tcbox[on line, arc=.5mm, boxsep=0pt, boxrule=0pt, top=1mm, bottom=0.8mm, left=2mm, right=2.2mm, colback=white!80!black, coltext=#3]{\raisebox{-0.1ex}{\vphantom{羅}\vphantom{j}#2}}}}, bottom=2mm, top=2mm, } \title{\texttt{modernruler} Package Documentation} \author{KKTeX} \date{Version 1.0.0 (2025/12/28)} \begin{document} \begin{titlepage} \maketitle \end{titlepage} \newpage \tableofcontents \newpage \section{Outline} This package provides modern hrule (\verb|\mruleth|), vrule (\verb|\mruletv|), and \verb|\undernote| internally uses the two commands. \begin{SourceCode}{Intput}{TeX} % normal rule \mruleth[height=1pt, width=5cm, color=blue] % dashed rule \mruleth[height=2pt, width=8cm, color=red, dash=true, dash-len=5pt, gap-len=3pt] % inline rule This is \mruletv[height=\zw, depth=1.5\zw, width=1pt, color=green] a modern vrule. % inline dashed rule This is \mruletv[height=2\zw, width=1.5pt, color=orange, dash=true, dash-len=2pt, gap-len=1pt] a dashed modern vrule. % undernote This is under note. This uses \undernote{these commands}{\texttt{\textbackslash mruleh} and \texttt{\textbackslash mrulev}} internally and enables make flexible outputs. \end{SourceCode} \begin{OutPut}{Output} % normal rule \mruleth[height=1pt, width=5cm, color=blue] % dashed rule \mruleth[height=2pt, width=8cm, color=red, dash=true, dash-len=5pt, gap-len=3pt] % inline rule This is \mruletv[height=\zw, depth=1.5\zw, width=1pt, color=green] a modern vrule. % inline dashed rule This is \mruletv[height=2\zw, width=1.5pt, color=orange, dash=true, dash-len=2pt, gap-len=1pt] a dashed modern vrule. % undernote This is under note. This uses \undernote{these commands}{\texttt{\textbackslash mruleh} and \texttt{\textbackslash mrulev}} internally and enables make flexible outputs. \end{OutPut} \section{Acknowledgements / Credits} This package was inspired by discussions on TeX Forum concerning undernote-like constructions using rules. An improved approach was later presented by Mr.~Yusuke~Terada, which clarified several implementation details. The present package is a complete reimplementation and extension, introducing a generalized rule-based engine, redesigned control flow, and additional features such as modern ruler integration and \texttt{tcolorbox}-based abstractions. Any remaining errors or design decisions are entirely the responsibility of the author. \section{Installation} \begin{SourceCode}{Intput}{TeX} \usepackage[]{modernruler} \end{SourceCode} Detailed information regarding the options will be provided in a later section, specifically during the explanation of the \verb|\undernote| command. \section{Commands} \subsection{\texttt{\textbackslash mruleth, \textbackslash mruletv}} In the first place, \verb|\mruleth| and \verb|mruletv| are extended \verb|\hrule| and \verb|\vrule|. You can use them like this: \begin{SourceCode}{Intput}{TeX} \mruleth[] \mruletv[] \end{SourceCode} These commands share the same keys.\bigskip \begin{center} \begin{tabular}{llll} \toprule \textbf{Key} & \textbf{Type} & \textbf{Default} & \textbf{Description} \\ \midrule width & dim & 0pt & Width of the rule \\ height & dim & 0pt & Height above the baseline \\ depth & dim & 0pt & Depth below the baseline \\ color & tl & black & Color of the rule \\ gap-color & tl & white & Color of the gap segments \\ dash & bool & false & Enables dashed line if true \\ dash-len & dim & 3pt & Length of the dash segment \\ gap-len & dim & 2.5pt & Length of the gap between dashes \\ \bottomrule \end{tabular} \end{center}\bigskip The outputs are as follows: \begin{SourceCode}{Intput}{TeX} \fboxsep=0pt\fboxrule=.1pt% % horizontal rule \fbox{\mruleth[height=1pt, width=55pt, color=blue]} \fbox{\mruleth[height=1pt, width=55pt, color=blue, dash=true]} \fbox{\mruleth[height=1pt, width=57pt, color=blue, dash=true]} \fbox{\mruleth[height=1pt, width=59pt, color=blue, dash=true]} % vertical rule \fbox{\mruletv[width=1pt, height=55pt, color=blue]} \fbox{\mruletv[width=1pt, height=55pt, color=blue, dash=true]} \fbox{\mruletv[width=1pt, height=57pt, color=blue, dash=true]} \fbox{\mruletv[width=1pt, height=59pt, color=blue, dash=true]}\bigskip % Horizontal: Alternating Black and Cyan segments \mruleth[width=120pt, height=2pt, dash=true, dash-len=6pt, gap-len=6pt, color=black, gap-color=cyan]\bigskip % Vertical: Warning Pattern (Yellow and Black) \mruletv[width=3pt, height=50pt, dash=true, dash-len=8pt, gap-len=4pt, color=yellow, gap-color=black] \end{SourceCode} \begin{OutPut}{Output} \fboxsep=0pt\fboxrule=.1pt% \fbox{\mruleth[height=1pt, width=55pt, color=blue]} \fbox{\mruleth[height=1pt, width=55pt, color=blue, dash=true]} \fbox{\mruleth[height=1pt, width=57pt, color=blue, dash=true]} \fbox{\mruleth[height=1pt, width=59pt, color=blue, dash=true]} \fbox{\mruletv[width=1pt, height=55pt, color=blue]} \fbox{\mruletv[width=1pt, height=55pt, color=blue, dash=true]} \fbox{\mruletv[width=1pt, height=57pt, color=blue, dash=true]} \fbox{\mruletv[width=1pt, height=59pt, color=blue, dash=true]} \bigskip % Horizontal: Alternating Black and Cyan segments \mruleth[width=120pt, height=2pt, dash=true, dash-len=6pt, gap-len=6pt, color=black, gap-color=cyan] \bigskip % Vertical: Warning Pattern (Yellow and Black) \mruletv[width=3pt, height=50pt, dash=true, dash-len=8pt, gap-len=4pt, color=yellow, gap-color=black] \end{OutPut} \subsection{\texttt{\textbackslash undernote}} This commands provides underlined \undernote{annotation}{Like this.}. There is some optional parameters which adjust the position of the annotation text. \begin{SourceCode}{Intput}{TeX} % grammar \undernote[]{}{}[