summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/namedtensor/namedtensor.sty
blob: 0f81f689714198fbd167ed103a3ac8fc94c6bb71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{namedtensor}[2021/02/22 v0.4 Named tensors]
\RequirePackage{amsmath}

\newcommand{\namedtensorstrut}{\vphantom{fg}} % milder than \mathstrut

\newcommand{\name}[1]{\ensuremath{\mathsf{\namedtensorstrut #1}}}
\newcommand{\nbin}[2]{\mathbin{\underset{\substack{#1}}{\namedtensorstrut #2}}}
\newcommand{\ndot}[1]{\nbin{#1}{\odot}}
\newcommand{\ncat}[1]{\nbin{#1}{\oplus}}
\newcommand{\nsum}[1]{\sum\limits_{\substack{#1}}}
\newcommand{\nfun}[2]{\mathop{\underset{\substack{#1}}{\namedtensorstrut\mathrm{#2}}}}
\newcommand{\ndef}[2]{\newcommand{#1}{\name{#2}}}