texlive[70704] Master/texmf-dist: dashrulex (19mar24)
commits+karl at tug.org
commits+karl at tug.org
Tue Mar 19 21:38:45 CET 2024
Revision: 70704
https://tug.org/svn/texlive?view=revision&revision=70704
Author: karl
Date: 2024-03-19 21:38:45 +0100 (Tue, 19 Mar 2024)
Log Message:
-----------
dashrulex (19mar24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/dashrulex/dashrulex.pdf
trunk/Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex
trunk/Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty
Modified: trunk/Master/texmf-dist/doc/latex/dashrulex/dashrulex.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex 2024-03-19 16:55:48 UTC (rev 70703)
+++ trunk/Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex 2024-03-19 20:38:45 UTC (rev 70704)
@@ -6,8 +6,8 @@
{
package = dashrulex,
title = the dashrulex package,
- version = v1.00a,
- date = 2024/03/17,
+ version = v1.00b,
+ date = 2024/03/18,
authors = Qu Yi,
info = Draw dashed rules,
email = toquyi at 163.com,
@@ -48,8 +48,8 @@
\section{User commands}
\begin{commands}
- \command{hdashrule}[\oarg{raise}\oarg{leader}\marg{width}\marg{thickness}\marg{dash rules}]
- The command to draw horizontal dashed rules, based on the \cs{rule} command, and the same as the \cs{rule} command when the \meta{dash rules} are empty. \meta{raise} is the vertical offset of the rule. \meta{leader} is the alignment of the dashed line fill, which can be empty, \code{c}, or \code{x} (the default), corresponding to the \cs{leaders}, \cs{cleaders}, and \cs{xleaders} commands, respectively. \meta{width} is the length of the dashed rule, which can be set to \cs{fill} to indicate an arbitrarily long distance when you need to fill the entire horizontal center of the plate. \meta{dash rules} is expressed as \splitmeta[\code{|}]{length 1}{length a}\code{,}\splitmeta[\code{|}]{length 2}{length b}\code{,...}, where \meta{length 1} represents the length of the solid line and \meta{length a} represents the length of the empty space, such as \code{5pt|2pt,3pt}, if the empty space is empty, then it is equal to the solid line length.
+ \command{hdashrule}[\oarg{raise}\oarg{leader}\marg{width}\marg{thickness list}\marg{dash rules}]
+ The command to draw horizontal dashed rules, based on the \cs{rule} command, and the same as the \cs{rule} command when the \meta{dash rules} are empty. \meta{raise} is the vertical offset of the rule. \meta{leader} is the alignment of the dashed line fill, which can be empty, \code{c}, or \code{x} (the default), corresponding to the \cs{leaders}, \cs{cleaders}, and \cs{xleaders} commands, respectively. \meta{width} is the length of the dotted line, which can be set to \cs{fill} when used to fill the remaining center of the current text line. \meta{thickness list} is a rule for the height of vertically oriented lines, separated by \textcolor{red}{commas} and written as \splitmeta{height 1}{height a}\code{,...}, where \meta{height 1} denotes the height of a solid line and \meta{height a} denotes the height of a blank space.\meta{dash rules} is expressed as \splitmeta[\code{|}]{length 1}{length a}\code{,}\splitmeta[\code{|}]{length 2}{length b}\code{,...}, where \meta{length 1} represents the length of the solid line and \meta{length a} represents the length of the blank space, such as \code{5pt|2pt,3pt}, if the blank space is empty, then it is equal to the solid line length.
\begin{example}
1X\rule{2cm}{1pt}x \\
2X\hdashrule{2cm}{1pt}{}x \\
@@ -59,8 +59,11 @@
6X\hdashrule[0.5ex]{4cm}{1pt}{3mm}x \\
7X\hdashrule[0.5ex]{4cm}{1mm}{3mm}x \\
8X\hdashrule[0.5ex]{4cm}{1mm}{3mm|3pt}x \\
- 9X\hdashrule[0.5ex]{4cm}{1mm}{3mm|3pt,1mm|2pt}x
+ 9X\hdashrule[0.5ex]{4cm}{1mm}{3mm|3pt,1mm|2pt}x \\
+ 10X\hdashrule[0.5ex]{4cm}{2pt,1pt,1pt}{3mm|3pt,1mm|2pt}x
\end{example}
+ \command{vrulemod}[\oarg{raise}\oarg{height}\oarg{depth}\marg{width}\marg{thickness list}]
+ The vertical component used to fill the dashed line. \meta{thickness list} is consistent with the \cs{hdashrule} command, \meta{width} represents the length of the component, and the three optional parameters are consistent with those of the \cs{raisebox} command.
\command{hanyrule}[\oarg{leader}\marg{width}\marg{symbol list}]
This command sets the length of the dotted rule and fills it with arbitrary symbols. \meta{symbol list} can be more than one symbol and they are separated by \textcolor{red}{commas}. Symbols are best packed in boxes of a certain length, as spacing between symbols is not provided.
\begin{example}
@@ -78,7 +81,8 @@
4X\hanyrule[c]{5cm}{\makebox[8pt]{$\cdot$}}x \\
5X\hanyrule[x]{5cm}{\makebox[8pt]{$\cdot$}}x \\
6X\hanyrule[x]{5cm}{\makebox[8pt]{$\cdot$},\makebox[8pt]{$\circ$}}x \\
- 7X\hanyrule[x]{5cm}{\makebox[5mm]{\dblelement}}x
+ 7X\hanyrule[x]{5cm}{\makebox[5mm]{\vrulemod{3mm}{2pt,1pt,1pt}}}x \\
+ 8X\hanyrule[x]{5cm}{\makebox[5mm]{\dblelement}}x
\end{example}
\end{commands}
Modified: trunk/Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty 2024-03-19 16:55:48 UTC (rev 70703)
+++ trunk/Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty 2024-03-19 20:38:45 UTC (rev 70704)
@@ -9,7 +9,7 @@
% https://creativecommons.org/licenses/by/4.0/legalcode
\NeedsTeXFormat{LaTeX2e}[2012/02/12]
\RequirePackage{xparse}
-\ProvidesExplPackage{dashrulex}{2024/03/17}{1.00a}
+\ProvidesExplPackage{dashrulex}{2024/03/18}{1.00b}
{Draw dashed rules}
\DeclareDocumentCommand{\hdashrule}{O{0pt}O{x}mmm}
{
@@ -33,8 +33,8 @@
\cs_set_protected:Npn \drx at parse@dash at inner #1#2#3#4
{
\IfNoValueTF{#4}
- {\rule[#1]{#3}{#2}\skip_horizontal:n {#3}}
- {\rule[#1]{#3}{#2}\skip_horizontal:n {#4}}
+ {\vrulemod[#1]{#3}{#2}\skip_horizontal:n {#3}}
+ {\vrulemod[#1]{#3}{#2}\skip_horizontal:n {#4}}
}
\NewDocumentCommand{\hanyrule}{O{x}mm}
{
@@ -44,6 +44,49 @@
\skip_horizontal:n {#2}
\mbox{}
}
+
+\int_new:N \l__drx_vrule_counter_int
+\int_set:Nn \l__drx_vrule_counter_int { 1 }
+\dim_new:N \l__drx_vrule_height_dim
+\tl_new:N \l__drx_tmpa_tl
+\cs_new_protected:Npn \drx at step@counter at height #1
+ {
+ \int_incr:N \l__drx_vrule_counter_int
+ \dim_add:Nn \l__drx_vrule_height_dim {#1}
+ }
+\NewDocumentCommand{\vrulemod}{O{0pt}oomm}
+ {
+ \group_begin:
+ \IfValueTF{#2}
+ {
+ \tl_set:Nn \l__drx_tmpa_tl { [#2] }
+ \IfValueT{#3}{\tl_put_right:Nn \l__drx_tmpa_tl { [#3] }}
+ }
+ {\IfValueT{#3}{\tl_set:Nn \l__drx_tmpa_tl { [#3] }}}
+ \exp_last_unbraced:Nnf
+ \raisebox{#1}{\l__drx_tmpa_tl}
+ {
+ \clist_map_inline:nn {#5}
+ {
+ \int_compare:nNnTF { \l__drx_vrule_counter_int } > { 1 }
+ {
+ \int_if_even:nTF { \l__drx_vrule_counter_int }
+ { \drx at step@counter at height{##1} }
+ {
+ \kern -#4
+ \exp_args:NV
+ \raisebox\l__drx_vrule_height_dim{\rule{#4}{##1}}
+ \drx at step@counter at height{##1}
+ }
+ }
+ {
+ \rule{#4}{##1}
+ \drx at step@counter at height{##1}
+ }
+ }
+ }
+ \group_end:
+ }
\endinput
%
% End of file `dashrulex.sty'.
\ No newline at end of file
More information about the tex-live-commits
mailing list.