我宁愿我的张量积看起来像$A\underset{R}{\otimes}B$
但仍然写$A\otimes_R B$
。有没有办法通过序言中的一些命令来实现这一点?(如果它只在显示模式下工作就可以了)
答案1
也许你喜欢把环放在张量积符号下面,但排版却不这么认为。原因如下:
\documentclass{article}
\usepackage{amsmath}
\newcommand{\tens}[1]{%
\mathbin{\mathop{\otimes}\limits_{#1}}%
}
\begin{document}
Here is a tensor product $M\tens{R}N$, but note that
it will have a very bad influence on the spacing of
lines.
Here is a tensor product $M\tens{R}N$, but note that
it will have a very bad influence on the spacing of
lines.
Here is a tensor product $M\tens{R}N$, but note that
it will have a very bad influence on the spacing of
lines.
Here is a tensor product $M\tens{R}N$, but note that
it will have a very bad influence on the spacing of
lines.
Here is a tensor product $M\tens{R}N$, but note that
it will have a very bad influence on the spacing of
lines.
Here is a tensor product $M\tens{R}N$, but note that
it will have a very bad influence on the spacing of
lines.
\end{document}
简单的改变也许会让您喜欢它,但我不确定是否会非常喜欢它。
\documentclass{article}
\usepackage{amsmath}
\newcommand{\tens}[1]{%
\mathbin{\mathop{\otimes}\displaylimits_{#1}}%
}
\begin{document}
Here is a tensor product $M\tens{R}N$, note that
it won't have a very bad influence on the spacing of
lines.
Here is a tensor product $M\tens{R}N$, note that
it won't have a very bad influence on the spacing of
lines.
Here is a tensor product $M\tens{R}N$, note that
it won't have a very bad influence on the spacing of
lines.
Here is a tensor product $M\tens{R}N$, note that
it won't have a very bad influence on the spacing of
lines.
Here is a tensor product $M\tens{R}N$, note that
it won't have a very bad influence on the spacing of
lines.
Here is a tensor product $M\tens{R}N$, note that
it won't have a very bad influence on the spacing of
lines.
\[
M\tens{R}N
\]
Here is a tensor product $M\tens{R}N$, note that
it won't have a very bad influence on the spacing of
lines.
\end{document}
您可以使用\tens
通常的语法:
\documentclass{article}
\usepackage{xparse}
\NewDocumentCommand{\tens}{t_}
{%
\IfBooleanTF{#1}
{\tensop}
{\otimes}%
}
\NewDocumentCommand{\tensop}{m}
{%
\mathbin{\mathop{\otimes}\displaylimits_{#1}}%
}
\begin{document}
In line we have $M\tens N=M\tens_{R}N$, but displayed we have
\[
M\tens N=M\tens_{R}N
\]
\end{document}
更符合 LaTeX3 的实现,使用(不太)实验性的e
参数说明符(装饰):
\documentclass{article}
\usepackage{xparse}
\NewDocumentCommand{\tens}{e{_^}}{%
\mathbin{\mathop{\otimes}\displaylimits
\IfValueT{#1}{_{#1}}
\IfValueT{#2}{^{#2}}
}%
}
\begin{document}
In line we have $M\tens N=M\tens_{R}N$, but displayed we have
\[
M\tens N=M\tens_{R}N
\]
For a derived functor $M\tens^{L}N=M\tens_{R}^{L}N$ or
\[
M\tens^{L}N=M\tens_{R}^{L}N
\]
\end{document}