我正在使用\langle
and\langle
函数,我想精确地(在索引中)定义此内积的空间。任何帮助都将不胜感激
答案1
Mathtools
可以自动调整分隔符的大小:
\documentclass{article}
\usepackage{mathtools, nccmath}
\usepackage{xparse, etoolbox}
\DeclarePairedDelimiterX{\innerp}[1]{\langle}{\rangle}{\innpargs{#1}}
\NewDocumentCommand{\innpargs}{>{\SplitArgument{1}{,}}m}
{\innpargsaux#1}
\NewDocumentCommand{\innpargsaux}{mm}
{\ifblank{#1}%
{\ifblank{#2}{~{,}~}{{\,\cdot\,}{,}{\mkern2mu#2}}}%
{{#1\,}{,}\ifblank{#2}{\,\cdot\,}{\mkern2mu#2}}%
}%
%}%
\begin{document}
\[ \innerp{u, v}_{\!_E}, \quad \innerp*{\tfrac{1}{2}u, v}_{\!E} \quad \innerp*{\frac{u}{2}, v}_{\!E} \]
\end{document}