5

My question is about what you guys think about the formatting of the inner product when we have large characters. Like, do you think that it is better to resize the braces "$\langle$" and "$\rangle$" according to the equation inside or do you think its better not. For example, which one is better graphically:

$$\langle x, \sum_{j\in I_{n^m-k}}p_j^i\xi_j+\sum_{j\in I_k}l_j^i\eta_j \rangle$$

or

$$\left\langle x, \sum_{j\in I_{n^m-k}}p_j^i\xi_j+\sum_{j\in I_k}l_j^i\eta_j \right\rangle$$

I will write a sequence of equalities of inner products and some of them have big symbols inside and others don't, like

$$\langle x, \zeta_i\rangle =\left\langle x, \sum_{j\in I_{n^m-k}}p_j^i\xi_j+\sum_{j\in I_k}l_j^i\eta_j \right\rangle = \sum_{j\in I_{n^m-k}}p_j^i\langle x, \xi_j\rangle+\sum_{j\in I_k}l_j^i\langle x, \eta_j\rangle.$$

Is that weird graphically for you? It is better to write like below?

$$\langle x, \zeta_i\rangle =\langle x, \sum_{j\in I_{n^m-k}}p_j^i\xi_j+\sum_{j\in I_k}l_j^i\eta_j \rangle = \sum_{j\in I_{n^m-k}}p_j^i\langle x, \xi_j\rangle+\sum_{j\in I_k}l_j^i\langle x, \eta_j\rangle.$$
1

2 Answers 2

5

Neither of those is good. As you can see the unscaled delimiters, as well as the automatically scaled ones, look out of place. Therefore, I advise you to use manually scaled delimiters. They come in four different sizes and different spacing variants for left, middle, and right delimiters. In ascending order:

left    middle  right
\bigl   \big    \bigr
\Bigl   \Big    \Bigr
\biggl  \bigg   \biggr
\Biggl  \Bigg   \Biggr

Here you can see an example of usage. Personally I also like to define a macro for the simple \langle ... \rangle combination, so I don't have to type so much.

\documentclass{article}
\def\<#1>{\mathinner{\langle#1\rangle}}
\begin{document}
\[
  \<x, \zeta_i>
  = \biggl< x, \sum_{j\in I_{n^m-k}}p_j^i\xi_j+\sum_{j\in I_k}l_j^i\eta_j \biggr>
  = \sum_{j\in I_{n^m-k}}p_j^i \<x, \xi_j> + \sum_{j\in I_k}l_j^i \<x, \eta_j>.
\]
\end{document}

You could also get away with \Big instead of \bigg and it would still look decent.

enter image description here

1
  • I had no idea angle brackets could be used like this to define a macro. Commented Jul 21, 2022 at 18:18
4

You also have the innerp command defined in the documentation of mathtools (an extension of amsmath) with its \DeclarePairedDelimiter command, which accepts two arguments and an optional \big, ``\Big, &c.. It also has a starred version, which adds an implicit pair \left \rìght in front of the delimiters.

With the help of xparse and mathtools, I define a similar command, \Innerp, which groups the two mandatory arguments in a single one,, separated by a comma, so as to have a syntax close to what one writes by hand. Should the arguments contain a real comma, they should be enclosed within a pair of braces. If one of the arguments is empty, it is replaced with a dot.

\documentclass{article}
\usepackage{mathtools}
\usepackage{xparse, etoolbox}
\DeclarePairedDelimiterX\innerp[2]{\langle}{\rangle}{#1,#2}

\DeclarePairedDelimiterX{\Innerp}[1]{\langle}{\rangle}{\Innpargs{#1}}
\NewDocumentCommand{\Innpargs}{>{\SplitArgument{1}{,}}m}
{\Innpargsaux#1}
\NewDocumentCommand{\Innpargsaux}{mm}
{\ifblank{#1}%
{\ifblank{#2}{\, \cdot \,{,}\, \cdot \,}{{\, \cdot \,}{,}{\mkern2mu#2}}}%
{{#1\,}{,}\ifblank{#2}{\, \cdot \,}{\mkern2mu#2}}%
}%

\begin{document}

\[
  \innerp{x}{\zeta_i}
  = \innerp[\bigg]{ x}{\,\, \smashoperator{\sum_{j \in I_{n^m-k}}}p_j^i\xi_j+\sum_{j \in I_k}l_j^i\eta_j }
  = \,\,\smashoperator{\sum_{j \in I_{n^m-k}}}p_j^i \innerp{x}{\xi_j} + \sum_{j \in I_k}l_j^i \innerp{x}{\eta_j}.
\]

\[
  \Innerp{x, \zeta_i}
  = \Innerp[\bigg]{ x, \mkern6mu \smashoperator{\sum_{j \in I_{n^m-k}}}p_j^i\xi_j+\sum_{j \in I_k}l_j^i\eta_j }
  = \,\,\smashoperator{\sum_{j \in I_{n^m-k}}}p_j^i \Innerp{x, \xi_j} + \sum_{j \in I_k}l_j^i \Innerp{x, \eta_j}.
\]
\[
  \Innerp{x, \zeta_i}
  = \Innerp*{ x, \mkern6mu \smashoperator{\sum_{j \in I_{n^m-k}}}p_j^i\xi_j+\sum_{j \in I_k}l_j^i\eta_j }
  = \,\,\smashoperator{\sum_{j \in I_{n^m-k}}}p_j^i \Innerp{x, \xi_j} + \sum_{j \in I_k}l_j^i \Innerp{x, \eta_j}.
\]
\[ \Innerp{x, }\quad \Innerp{, \zeta_i}\quad \Innerp{,}\]%
\end{document} 

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .