diff options
author | Karl Berry <karl@freefriends.org> | 2024-03-19 20:38:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-03-19 20:38:45 +0000 |
commit | 96e5952276ff4da2ecceacb9544371590343c126 (patch) | |
tree | 137730e173752013e8c4a16e8ddff61ab0e2ebfa | |
parent | a184f84d4ff7999c500728355c9e22c32ebf0a33 (diff) |
dashrulex (19mar24)
git-svn-id: svn://tug.org/texlive/trunk@70704 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/dashrulex/dashrulex.pdf | bin | 56156 -> 58949 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex | 16 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty | 49 |
3 files changed, 56 insertions, 9 deletions
diff --git a/Master/texmf-dist/doc/latex/dashrulex/dashrulex.pdf b/Master/texmf-dist/doc/latex/dashrulex/dashrulex.pdf Binary files differindex e38ec5a63dc..5ed12594f63 100644 --- a/Master/texmf-dist/doc/latex/dashrulex/dashrulex.pdf +++ b/Master/texmf-dist/doc/latex/dashrulex/dashrulex.pdf diff --git a/Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex b/Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex index acf2025a28f..fdb4fd69fc6 100644 --- a/Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex +++ b/Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex @@ -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@163.com, @@ -48,8 +48,8 @@ Sometimes it is necessary to draw dashed rules when writing documents, such as g \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 @@ Sometimes it is necessary to draw dashed rules when writing documents, such as g 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 @@ Sometimes it is necessary to draw dashed rules when writing documents, such as g 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} diff --git a/Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty b/Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty index 4b476963e69..58c104c0e1f 100644 --- a/Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty +++ b/Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty @@ -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@parse@dash@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@step@counter@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@step@counter@height{##1} } + { + \kern -#4 + \exp_args:NV + \raisebox\l__drx_vrule_height_dim{\rule{#4}{##1}} + \drx@step@counter@height{##1} + } + } + { + \rule{#4}{##1} + \drx@step@counter@height{##1} + } + } + } + \group_end: + } \endinput % % End of file `dashrulex.sty'.
\ No newline at end of file |