Debian Codegraph @

texmf-dist/source/latex/resmes/resmes.dtx

raw
1 % \iffalse meta-comment
2 %
3 % resmes Restriction of measures symbol in LaTeX
4 %
5 % Copyright (c) 2022 Paolo
6 %
7 % Licensed under MIT (https://github.com/Loara/resmes/blob/main/LICENSE)
8 %
9 % \fi
10 %
11 % \iffalse
12 %<*driver>
13 \ProvidesFile{resmes.dtx}[2022/12/27 v1.0 Restriction of measures symbol in LaTeX]
14 %</driver>
15 %<package>\NeedsTeXFormat{LaTeX2e}
16 %<package>\ProvidesPackage{resmes}[2022/12/27 v1.0 Restriction of measures symbol in LaTeX]
17 %<package>\RequirePackage{xparse}
18 %<package>\RequirePackage{tikz}
19 %<*driver>
20 \documentclass{ltxdoc}
21 \usepackage{resmes}
22 \begin{document}
23 \DocInput{resmes.dtx}
24 \end{document}
25 %</driver>
26 % \fi
27 %
28 %\newcommand{\thpkg}{\texttt{resmes}}
29 %
30 %\title{\thpkg}
31 %\author{Paolo De Donato}
32 %\date{2022/21/27\ v1.0}
33 %
34 %\maketitle
35 %
36 % This package defines the |\resmes| command in order to print measure restriction symbol. For example in mathmode
37 % \begin{verbatim}
38 % \mu\resmes A
39 % \end{verbatim}
40 % expands as
41 % \[
42 % \mu\resmes A
43 % \]
44 %
45 % This package works also in inline math mode ($\mu\resmes A$) and in subscript/superscript emvironments ($a^{\mu\resmes A}, b_{c^{\mu\resmes A}}$).
46 %\StopEventually
47 %
48 %\section{Implementation}
49 % \begin{macrocode}
50 %<*package>
51 % \end{macrocode}
52 %
53 % \begin{macrocode}
54
55 \NewDocumentCommand{\ress@D}{}{
56 \tikz{\draw[thick, join=round, cap=round] (0.24, 0) -- (0,0) -- (0, 0.24);}}
57 \NewDocumentCommand{\ress@T}{}{
58 \tikz{\draw[semithick, join=round, cap=round] (0.23, 0) -- (0,0) -- (0, 0.23);}}
59 \NewDocumentCommand{\ress@S}{}{
60 \,\tikz{\draw[thin, join=round] (0.154, 0) -- (0,0) -- (0, 0.154);}}
61 \NewDocumentCommand{\ress@SS}{}{
62 \tikz{\draw[very thin, join=round] (0.11, 0) -- (0,0) -- (0, 0.11);}}
63
64 \NewDocumentCommand{\resmes}{}{
65 \mathchoice{\mathbin{\ress@D}}{\mathbin{\ress@T}}
66 {\mathbin{\ress@S}}{\mathbin{\ress@SS}}}
67
68 % \end{macrocode}
69 %
70 % \begin{macrocode}
71 %</package>
72 % \end{macrocode}
73 %
74 %\Finale
75 %
76 %\PrintIndex