summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/resmes/resmes.dtx
blob: 7497320eaf810caeaca194dcb8c9b33b75a9d752 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
% \iffalse meta-comment
%
% resmes Restriction of measures symbol in LaTeX
%
% Copyright (c) 2022 Paolo
%
% Licensed under MIT (https://github.com/Loara/resmes/blob/main/LICENSE)
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{resmes.dtx}[2022/12/27 v1.0 Restriction of measures symbol in LaTeX]
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{resmes}[2022/12/27 v1.0 Restriction of measures symbol in LaTeX]
%<package>\RequirePackage{xparse}
%<package>\RequirePackage{tikz}
%<*driver>
\documentclass{ltxdoc}
\usepackage{resmes}
\begin{document}
\DocInput{resmes.dtx}
\end{document}
%</driver>
% \fi
%
%\newcommand{\thpkg}{\texttt{resmes}}
%
%\title{\thpkg}
%\author{Paolo De Donato}
%\date{2022/21/27\ v1.0}
%
%\maketitle
%
% This package defines the |\resmes| command in order to print measure restriction symbol. For example in mathmode
% \begin{verbatim}
%  \mu\resmes A
% \end{verbatim}
% expands as
% \[
%  \mu\resmes A
% \]
%
% 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}}$).
%\StopEventually
%
%\section{Implementation}
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
%    \begin{macrocode}

\NewDocumentCommand{\ress@D}{}{
  \tikz{\draw[thick, join=round, cap=round] (0.24, 0) -- (0,0) -- (0, 0.24);}}
\NewDocumentCommand{\ress@T}{}{
  \tikz{\draw[semithick, join=round, cap=round] (0.23, 0) -- (0,0) -- (0, 0.23);}}
\NewDocumentCommand{\ress@S}{}{
  \,\tikz{\draw[thin, join=round] (0.154, 0) -- (0,0) -- (0, 0.154);}}
\NewDocumentCommand{\ress@SS}{}{
  \tikz{\draw[very thin, join=round] (0.11, 0) -- (0,0) -- (0, 0.11);}}

\NewDocumentCommand{\resmes}{}{
  \mathchoice{\mathbin{\ress@D}}{\mathbin{\ress@T}}
  {\mathbin{\ress@S}}{\mathbin{\ress@SS}}}

%    \end{macrocode}
%
%    \begin{macrocode}
%</package>
%    \end{macrocode}
%
%\Finale
%
%\PrintIndex