From 9cc90d88c282b4e608952238f7187924c08cabbe Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 17 Mar 2024 19:48:22 +0000 Subject: dashrulex (17mar24) git-svn-id: svn://tug.org/texlive/trunk@70673 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/dashrulex/README.md | 7 ++ .../texmf-dist/doc/latex/dashrulex/dashrulex.pdf | Bin 0 -> 54472 bytes .../texmf-dist/doc/latex/dashrulex/dashrulex.tex | 81 +++++++++++++++++++++ .../texmf-dist/tex/latex/dashrulex/dashrulex.sty | 49 +++++++++++++ Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 + Master/tlpkg/tlpsrc/dashrulex.tlpsrc | 0 7 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/latex/dashrulex/README.md create mode 100644 Master/texmf-dist/doc/latex/dashrulex/dashrulex.pdf create mode 100644 Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex create mode 100644 Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty create mode 100644 Master/tlpkg/tlpsrc/dashrulex.tlpsrc (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/dashrulex/README.md b/Master/texmf-dist/doc/latex/dashrulex/README.md new file mode 100644 index 00000000000..c0e441ac99a --- /dev/null +++ b/Master/texmf-dist/doc/latex/dashrulex/README.md @@ -0,0 +1,7 @@ +# The dashrulex package + +The `dashrulex` package provides a flexible solution for drawing dashed rules in the body, and currently provides two commands `\hdashrule` and `\hanyrule`. It's written in LaTeX3 and can be used as an alternative to the `dashrule` package. + +## License + +This work may be distributed and/or modified under the conditions of the CC-BY 4.0 License. The latest version of this license is in https://creativecommons.org/licenses/by/4.0/legalcode \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/dashrulex/dashrulex.pdf b/Master/texmf-dist/doc/latex/dashrulex/dashrulex.pdf new file mode 100644 index 00000000000..71e4597be0d Binary files /dev/null and b/Master/texmf-dist/doc/latex/dashrulex/dashrulex.pdf differ diff --git a/Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex b/Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex new file mode 100644 index 00000000000..1d4ce592b96 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dashrulex/dashrulex.tex @@ -0,0 +1,81 @@ +\documentclass[load-preamble+]{cnltx-doc} + +\usepackage{setspace,hologo,dashrulex} +\usepackage[noto]{newtxmath} +\setcnltx + { + package = dashrulex, + title = the dashrulex package, + version = v1.00, + date = 2024/03/16, + authors = Qu Yi, + info = Draw dashed rules, + email = toquyi@163.com, + abstract = + { + The \pkg*{dashrulex} package provides a flexible solution for drawing dashed rules in the body, and currently provides two commands \cs{hdashrule} and \cs{hanyrule}. It's written in \hologo{LaTeX3} and can be used as an alternative to the \pkg*{dashrule} package. + }, + color-scheme = blue, + title-format = \huge\bfseries\scshape, + listings-options = {numbers = none,gobble = 2,lineskip = 1pt}, + pre-output = {\parindent = 0em\setstretch{1.3}}, + before-skip = \smallskipamount, + after-skip = \smallskipamount + } +\makeatletter +\newcommand{\splitmeta}[3][\code{,}]{\meta{#2}#1\meta{#3}} +\newcommand{\newsplitarg}[4][\splitmeta] + { + \newcommand{#2}[2] + {\code{\textcolor{argument}{#3\textnormal{#1{##1}{##2}}#4}}} + } +\newcommand{\kvsplit}[3] + { + \item\code{\option{#1}\cnltx@isvalue\splitmarg{#2}{#3}} + \cnltx@checkdefault{\hfill\newline} + } +\newsplitarg{\splitoarg}{[}{]} +\newsplitarg{\splitmarg}{\{}{\}} +\newsplitarg{\splitdarg}{(}{)} +\newnote{\newtag}[1][New]{\textcolor{red}{\ding{73}\ #1}} +\renewcommand{\emph}[1]{\textcolor{red}{#1}} +\renewcommand{\cnltx@write@lastname}{} +\makeatother + +\begin{document} +\section{Preface} +Sometimes it is necessary to draw dashed rules when writing documents, such as guides in the table of contents and indexes, horizontal lines in headers and footers, and even adding horizontal lines after headings. Macro packages such as \pkg*{dashrule} and \pkg*{nccrules} are available to accomplish this. Considering that \pkg*{dashrule} has not been updated for a long time, \pkg*{dashrulex} rewrites it using \hologo{LaTeX3} syntax and enhances it a bit. + +\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 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. + \begin{example} + 1X\rule{2cm}{1pt}x \\ + 2X\hdashrule{2cm}{1pt}{}x \\ + 3X\hdashrule{2cm}{1pt}{1pt}x \\ + 4X\hdashrule{4cm}{1pt}{1pt}x \\ + 5X\hdashrule[0.5ex]{4cm}{1pt}{1pt}x \\ + 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 + \end{example} + \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} + 1X\hanyrule[]{5cm}{\makebox[6pt][l]{$\cdot$}}x \\ + 2X\hanyrule[c]{5cm}{\makebox[6pt][l]{$\cdot$}}x \\ + 3X\hanyrule[x]{5cm}{\makebox[6pt][l]{$\cdot$}}x \\ + 4X\hanyrule[x]{5cm}{\makebox[6pt][c]{$\cdot$}}x \\ + 5X\hanyrule[x]{5cm}{\makebox[6pt][c]{$\cdot$},\makebox[6pt]{$\circ$}}x + \end{example} +\end{commands} + +\section{Known issues} +Currently only horizontal dashed line drawing is supported, with future plans to support vertical dashed lines, and even box dashed borders and so on. + +\appendix +\nocite{*} + +\end{document} \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty b/Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty new file mode 100644 index 00000000000..aba9f203d3f --- /dev/null +++ b/Master/texmf-dist/tex/latex/dashrulex/dashrulex.sty @@ -0,0 +1,49 @@ +% +% ***************** THE DASHRULEX PACKAGE ***************** +% +% Copyright (C) 2024 by Qu Yi +% +% This work may be distributed and/or modified under the +% conditions of the CC-BY 4.0 License. +% The latest version of this license is in +% https://creativecommons.org/licenses/by/4.0/legalcode +\NeedsTeXFormat{LaTeX2e}[2012/02/12] +\RequirePackage{xparse} +\ProvidesExplPackage{dashrulex}{2024/03/16}{1.00} + {Customize superscripts and subscripts} +\DeclareDocumentCommand{\hdashrule}{O{0pt}O{x}mmm} + { + \tl_if_blank:nTF {#5} + { \rule[#1]{#3}{#4} } + { + \mbox{} + \use:c { #2leaders } + \hbox:n + { + \clist_map_inline:nn {#5} + { \drx@parse@dash{#1}{#4}{##1} } + } + \skip_horizontal:n {#3} + \mbox{} + } + } +\NewDocumentCommand{\drx@parse@dash} + {mm>{\SplitArgument{1}{|}}m} + {\drx@parse@dash@inner{#1}{#2}#3} +\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}} + } +\NewDocumentCommand{\hanyrule}{O{x}mm} + { + \mbox{} + \use:c { #1leaders } + \hbox:n { \clist_map_inline:nn {#3} {##1} } + \skip_horizontal:n {#2} + \mbox{} + } +\endinput +% +% End of file `dashrulex.sty'. \ No newline at end of file diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 1adc6127816..d1808505931 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -242,7 +242,7 @@ my @TLP_working = qw( custom-bib customdice customenvs cutwin cv cv4tw cvss cweb-latex cyber cybercic cyklop cyrillic cyrplain dad dancers dantelogo darkmode - dashbox dashrule dashundergaps dataref datax datatool + dashbox dashrule dashrulex dashundergaps dataref datax datatool dateiliste datenumber datestamp datetime datetime2 datetime2-bahasai datetime2-basque datetime2-breton datetime2-bulgarian datetime2-catalan diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index f3023d2fa4d..98c8ebcdc5a 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -300,6 +300,7 @@ depend cybercic depend darkmode depend dashbox depend dashrule +depend dashrulex depend dashundergaps depend dataref depend datatool diff --git a/Master/tlpkg/tlpsrc/dashrulex.tlpsrc b/Master/tlpkg/tlpsrc/dashrulex.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.3