Debian Codegraph @

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

raw
1 %\iffalse meta-comment
2 %Copyright 2020 Lars Quentin, Matthew Scroggs, Adam Townsend
3 %
4 %Permission is hereby granted, free of charge, to any person obtaining a copy of this software
5 %and associated documentation files (the "Software"), to deal in the Software without restriction,
6 %including without limitation the rights to use, copy, modify, merge, publish, distribute,
7 %sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
8 %furnished to do so, subject to the following conditions:
9 %
10 %The above copyright notice and this permission notice shall be included in all copies or
11 %substantial portions of the Software.
12 %
13 %THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
14 %BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 %NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
16 %DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 %OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 %\fi
19
20 %\iffalse
21 %<*realtranspose>
22 \NeedsTeXFormat{LaTeX2e}
23 \ProvidesPackage{realtranspose}[2020/10/08 realtranspose 1.1]
24 \RequirePackage{graphicx}
25
26 \newcommand{\realtranspose}[1]{
27 % The problem is, that within mathbin it always gets
28 % rendered as textstyle.
29 %
30 % To bypass that, we detect which style was used before
31 %
32 % This way, we can do fun stuff like
33 %
34 % \int_0^T dt = \realtranspose{ \int_0 } dt
35 %
36 \mathchoice{
37 % displaystyle
38 \mathbin{\rotatebox[origin=c]{90}{$\displaystyle #1$}}
39 }{
40 % textstyle
41 \mathbin{\rotatebox[origin=c]{90}{$\textstyle #1$}}
42 }{
43 % scriptstyle
44 \mathbin{\rotatebox[origin=c]{90}{$\scriptstyle #1$}}
45 }{
46 %scriptscriptstyle
47 \mathbin{\rotatebox[origin=c]{90}{$\scriptscriptstyle #1$}}
48 }
49 }
50
51 %</realtranspose>
52 %\fi