diff options
author | Karl Berry <karl@freefriends.org> | 2022-12-16 21:04:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-12-16 21:04:26 +0000 |
commit | 157b2a3c8827e13a0d2a00ac3ff69a2d42eca9e2 (patch) | |
tree | 47bab3fb70995896690ff00d33e759365c4568ea /Master/texmf-dist | |
parent | 0162343d7dc5db79a2500b02ba34dddbd5d95b37 (diff) |
namedtensor (16dec22)
git-svn-id: svn://tug.org/texlive/trunk@65291 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/namedtensor/LICENSE.md | 7 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/namedtensor/README.md | 44 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/namedtensor/namedtensor.sty | 13 |
3 files changed, 64 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/namedtensor/LICENSE.md b/Master/texmf-dist/doc/latex/namedtensor/LICENSE.md new file mode 100644 index 00000000000..c7c06527ca9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/namedtensor/LICENSE.md @@ -0,0 +1,7 @@ +Copyright 2022 by the University of Notre Dame, Cornell University, and Harvard University. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Master/texmf-dist/doc/latex/namedtensor/README.md b/Master/texmf-dist/doc/latex/namedtensor/README.md new file mode 100644 index 00000000000..f4443242a9d --- /dev/null +++ b/Master/texmf-dist/doc/latex/namedtensor/README.md @@ -0,0 +1,44 @@ +# Named tensor notation in LaTeX + +This style file provides macros for named tensor notation. Please see +the paper [Named Tensor Notation](https://arxiv.org/abs/2102.13196) +for background on this notation. + +To use the style file, put + + \usepackage{namedtensor} + +into the preamble of your LaTeX source file (after +`\documentclass{article}` but before `\begin{document}`). + +We write axis names in sans-serif font. To make this easier, +`\name{axis}` prints the axis name "axis", and `\ndef{\ax}{axis}` +defines a macro `\ax` that prints the axis name "axis". + +Binary operators + +- Use `A \ndot{\ax} B` for contractions. You can use `\\` to stack up + several names. + +- You can use `\nbin` to make new binary operators. For example, `A + \nbin{\ax}{\star} B` gives you a star operator with "axis" written + under it. + +Functions + +- Use `\nsum{\ax} A` for summation over a named axis. + +- You can use `\nfun` to make new functions. For example, + `\nfun{\ax}{qux} A` defines a function "qux" with "axis" written + under it. + +## Credits + +- David Chiang, University of Notre Dame, dchiang@nd.edu +- Alexander M. Rush, Cornell University, arush@cornell.edu +- Boaz Barak, Harvard University, b@boazbarak.org + +## License + +This software is licensed under the MIT License. Please see LICENSE.md +for copyright notice. diff --git a/Master/texmf-dist/tex/latex/namedtensor/namedtensor.sty b/Master/texmf-dist/tex/latex/namedtensor/namedtensor.sty new file mode 100644 index 00000000000..0f81f689714 --- /dev/null +++ b/Master/texmf-dist/tex/latex/namedtensor/namedtensor.sty @@ -0,0 +1,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}}} |