diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/gs1/rule-D.dtx |
Initial commit
Diffstat (limited to 'macros/latex/contrib/gs1/rule-D.dtx')
-rw-r--r-- | macros/latex/contrib/gs1/rule-D.dtx | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/macros/latex/contrib/gs1/rule-D.dtx b/macros/latex/contrib/gs1/rule-D.dtx new file mode 100644 index 0000000000..6397e62b3b --- /dev/null +++ b/macros/latex/contrib/gs1/rule-D.dtx @@ -0,0 +1,127 @@ +% \iffalse meta-comment +% +%% File: rule-D.dtx Copyright (C) 2012 Markus Kohm +%% +%% It may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License (LPPL), either version 1.3c of this +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "GS1 bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ------------------------------------------------------------------------- +% +%<*driver|package> +\RequirePackage{expl3}[2017/05/29] +\GetIdInfo$Id: rule-D.dtx 22 2017-07-15 18:03:18Z mjk $ + {rule functions for LaTeX3} +%</driver|package> +%<*driver> +\documentclass{l3doc} +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +%</driver> +% \fi +% +% \title{^^A +% The \pkg{rule-D} Package\\ +% Rule Functions\thanks +% {^^A +% This file describes v\ExplFileVersion, +% last revised \ExplFileDate.^^A +% }^^A +% } +% +% \author{^^A +% Markus Kohm\thanks +% {^^A +% E-mail: \href{mailto:komascript@gmx.info}{komascript@gmx.info}^^A +% }^^A +% } +% +% \date{Released \ExplFileDate} +% +% \maketitle +% +% \begin{documentation} +% At \LaTeXe{} you have command \cmd{\rule} to make horizontal and vertical +% rules and even boxes. Currently there's no L3 command for this. This +% module provides two new L3 functions for rules. The ``-D'' in the module +% name indicates, that currently the implementation uses deprecated +% functions like \cmd{\tex_vrule:D}. Nevertheless, the new rule functions +% aren't declared to be deprecated. +% +% This package has been made only, because \pkg{GS1} needs such rule +% functions. So maybe it's simply a helper package for \pkg{GS1}. +% +% +% \begin{function}{\rule:nn , \rule:nnn} +% \begin{syntax} +% "\rule:nnn" \Arg{dimexpr_{raise}} \Arg{dimexpr_{width}}^^A +% \Arg{dimexpr_{height}} +% "\rule:nn" \Arg{dimexpr_{width}} \Arg{dimexpr_{height}} +% \end{syntax} +% Draw a rule of width \meta{dimexpr_{width}}, height +% \meta{dimexpr_{height}} and raise it by \meta{dimexpr_{raise}}. It the +% \meta{dimex_{raise}} has not been given, the rule will be drawn at the +% base line. +% \end{function} +% +% \end{documentation} +% +% \begin{implementation} +% +% \section{\pkg{rule-D} implementation} +% \label{sec:rule-D:implementation} +% +%\iffalse meta-comment +%<*package> +%\fi +% +% First of all we have to setup package information: +% \begin{macrocode} +\ProvidesExplPackage + {rule-D} {\ExplFileDate} {\ExplFileVersion} + {experimental~L3~rule~functions} +% \end{macrocode} +% +% \begin{macro}{\rule:nn , \rule:nnn} +% \begin{macrocode} +\cs_new:Npn \rule:nn #1#2 + { + \rule:nnn { \c_zero_dim } { #1 } { #2 } + } +\cs_new:Npn \rule:nnn #1#2#3 + { +% \end{macrocode} +% Following line is same like \cs{leavevmode}, but it's \LaTeX3 instead of +% plain\TeX. +% \begin{macrocode} + \hbox_unpack_clear:N \c_empty_box + \hbox:n + { + \tex_vrule:D width \dim_eval:n { #2 } + height \dim_eval:n { #1 + #3 } + depth -\dim_eval:n { #1 } + } + } +% \end{macrocode} +% \end{macro} +% +%\iffalse meta-comment +%</package> +%\fi +% +% \end{implementation} +% +% \PrintIndex +% +\endinput +% +% end of file |