-
Notifications
You must be signed in to change notification settings - Fork 5
/
macros.tex
26 lines (23 loc) · 1.26 KB
/
macros.tex
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
\section{\LaTeX{} Macros}
Many of the \LaTeX{} macros used in this document are available in the style file \verb|namedtensor.sty|, available
%at \url{https://namedtensor.github.io/namedtensor.sty}
on CTAN at \url{https://ctan.org/pkg/namedtensor}. To use it, put
\begin{quote}
\begin{verbatim}
\usepackage{namedtensor}
\end{verbatim}
\end{quote}
in the preamble of your \LaTeX{} source file (after \verb|\documentclass{article}| but before \verb|\begin{document}|).
We write axis names in sans-serif font. To make this easier, \verb|\name{ax}| prints an axis name (like this: \name{ax}), and \verb|\ndef{\ax}{ax}| defines a macro \verb|\ax| that does the same.
\begin{itemize}
\item Binary operators
\begin{itemize}
\item Use \verb|A \ndot{\ax} B| for contraction: $A \ndot{\ax} B$. You can use \verb|\\| to stack up several names.
\item In general, you can use \verb|\nbin| to make a new binary operator with a name under it: \verb|A \nbin{\ax}{\star} B| gives you $A \nbin{\ax}{\star} B$.
\end{itemize}
\item Functions
\begin{itemize}
\item Use \verb|\nsum{\ax} A| for summation: $\nsum{\ax} A$.
\item In general, you can use \verb|\nfun| to make a function with a name under it: \verb|\nfun{\ax}{qux} A| gives you $\nfun{\ax}{qux} A$.
\end{itemize}
\end{itemize}