Debian Codegraph @

texmf-dist/source/latex/gs1/rule-D.dtx

raw
1 % \iffalse meta-comment
2 %
3 %% File: rule-D.dtx Copyright (C) 2017-2021 Markus Kohm
4 %%
5 %% It may be distributed and/or modified under the conditions of the
6 %% LaTeX Project Public License (LPPL), either version 1.3c of this
7 %% license or (at your option) any later version. The latest version
8 %% of this license is in the file
9 %%
10 %% http://www.latex-project.org/lppl.txt
11 %%
12 %% This file is part of the "GS1 bundle" (The Work in LPPL)
13 %% and all files in that bundle must be distributed together.
14 %%
15 %% The released version of this bundle is available from CTAN.
16 %%
17 %% -------------------------------------------------------------------------
18 %
19 %<*driver|package>
20 \RequirePackage{expl3}[2019/01/17]
21 \GetIdInfo$Id: rule-D.dtx 23 2021-06-17 07:00:36Z mjk $
22 {rule functions for LaTeX3}
23 %</driver|package>
24 %<*driver>
25 \documentclass{l3doc}
26 \begin{document}
27 \DocInput{\jobname.dtx}
28 \end{document}
29 %</driver>
30 % \fi
31 %
32 % \title{^^A
33 % The \pkg{rule-D} Package\\
34 % Rule Functions\thanks
35 % {^^A
36 % This file describes v\ExplFileVersion,
37 % last revised \ExplFileDate.^^A
38 % }^^A
39 % }
40 %
41 % \author{^^A
42 % Markus Kohm\thanks
43 % {^^A
44 % E-mail: \href{mailto:[email protected]}{[email protected]}^^A
45 % }^^A
46 % }
47 %
48 % \date{Released \ExplFileDate}
49 %
50 % \maketitle
51 %
52 % \begin{documentation}
53 % At \LaTeXe{} you have command \cmd{\rule} to make horizontal and vertical
54 % rules and even boxes. Currently there's no L3 command for this. This
55 % module provides two new L3 functions for rules. The ``-D'' in the module
56 % name indicates, that currently the implementation uses deprecated
57 % functions like \cmd{\tex_vrule:D}. Nevertheless, the new rule functions
58 % aren't declared to be deprecated.
59 %
60 % This package has been made only, because \pkg{GS1} needs such rule
61 % functions. So maybe it's simply a helper package for \pkg{GS1}.
62 %
63 %
64 % \begin{function}{\rule:nn , \rule:nnn}
65 % \begin{syntax}
66 % "\rule:nnn" \Arg{dimexpr_{raise}} \Arg{dimexpr_{width}}^^A
67 % \Arg{dimexpr_{height}}
68 % "\rule:nn" \Arg{dimexpr_{width}} \Arg{dimexpr_{height}}
69 % \end{syntax}
70 % Draw a rule of width \meta{dimexpr_{width}}, height
71 % \meta{dimexpr_{height}} and raise it by \meta{dimexpr_{raise}}. It the
72 % \meta{dimex_{raise}} has not been given, the rule will be drawn at the
73 % base line.
74 % \end{function}
75 %
76 % \end{documentation}
77 %
78 % \begin{implementation}
79 %
80 % \section{\pkg{rule-D} implementation}
81 % \label{sec:rule-D:implementation}
82 %
83 % \begin{macrocode}
84 %<*package>
85 %<@@=rule>
86 % \end{macrocode}
87 %
88 % First of all we have to setup package information:
89 % \begin{macrocode}
90 \ProvidesExplPackage
91 {rule-D} {\ExplFileDate} {\ExplFileVersion}
92 {experimental~L3~rule~functions}
93 % \end{macrocode}
94 %
95 % \begin{macro}[updated = 2021-06-17]{\rule:nn , \rule:nnn}
96 % \begin{macrocode}
97 \cs_new:Npn \rule:nn #1#2
98 {
99 \rule:nnn { \c_zero_dim } { #1 } { #2 }
100 }
101 \cs_new:Npn \rule:nnn #1#2#3
102 {
103 % \end{macrocode}
104 % \changes{v23}{2021/06/17}{deprecated \cs{hbox_unpack_clear} replaced by
105 % \cs{hbox_unpack_drop}}
106 % Following line is same like \cs{leavevmode}, but it's \LaTeX3 instead of
107 % plain\TeX.
108 % \begin{macrocode}
109 \hbox_unpack_drop:N \c_empty_box
110 \hbox:n
111 {
112 \tex_vrule:D width \dim_eval:n { #2 }
113 height \dim_eval:n { #1 + #3 }
114 depth -\dim_eval:n { #1 }
115 }
116 }
117 % \end{macrocode}
118 % \end{macro}
119 %
120 % \begin{macrocode}
121 %</package>
122 % \end{macrocode}
123 %
124 % \end{implementation}
125 %
126 % \PrintIndex
127 %
128 \endinput
129 %
130 % end of file
131
132 % \endinput
133 % Local Variables:
134 % mode: doctex
135 % TeX-master: t
136 % End: