[Tex/LaTex] Size of a vertical bar symbol

amsmathstix

I am using stix fonts to type a formula containing bra-ket notations from quantum mechanics. I observe that the size of a vertical bar is either too small:

enter image description here \big\}\lvert\psi\rangle ,

or too large:

enter image description here \big\}\big\lvert\psi\big\rangle .

I would like to make the \lvertand the \rangle symbols be of the same height as \big\}. Is it possible to achieve this somehow? For a reference I posting the full source:

\documentclass[11pt,a4paper,onecolumn,openright,final]{memoir}
  %===============================================
  \settrims{0.cm}{0.cm}
  \setbinding{1cm} % space for binding
  \setlrmarginsandblock{*}{3cm}{1} % spine = edge. Edge=3cm
  \setulmarginsandblock{3cm}{*}{1} % upper=lower. Upper=3cm
  \checkandfixthelayout
  \pagestyle{empty}
  %===============================================
  \usepackage[]{stix,amsmath}
  %===============================================
  \begin{document}
  Compare different height of vertical bars here
  \begin{subequations}
  \begin{eqnarray}
  g(t-t')&=&-i\langle\psi\lvert T \bigl\{\hat c(t)\,\hat c^\dagger(t')\bigr\}\lvert\psi\rangle,\\
  g(t-t')&=&-i\langle\psi| T \bigl\{\hat c(t)\,\hat c^\dagger(t')\bigr\} |\psi\rangle;
  \end{eqnarray}
  \end{subequations}
  and  here
  \begin{subequations}
  \begin{eqnarray}
  g(t-t')&=&-i\bigl\langle\psi\bigr\rvert T \bigl\{\hat c(t)\,\hat c^\dagger(t')\bigr\}\bigl\lvert\psi\bigr\rangle,\\
  g(t-t')&=&-i\bigl\langle\psi\bigr| T \bigl\{\hat c(t)\,\hat c^\dagger(t')\bigr\}\bigl|\psi\bigr\rangle.
  \end{eqnarray}
  \end{subequations}
  and here $\big\}\big|\psi\big\rangle$.
\end{document}

and the full output:

enter image description here

Any help is much appreciated!

Best Answer

It is a bug in the STIX fonts, I'm afraid.

All delimiters I tried scale perfectly with \big, \Big, \bigg, and \Bigg, whereas it doesn't happen with the vertical bar, for which \big| and \Big| produce the same size.

The \delcode of | with the STIX fonts is "3F03F3 and the characters in stix-mathex have metrics

(CHARACTER O 360
   (CHARWD R 0.32)
   (CHARHT R 0.69)
   (CHARDP R 0.189)
   )

(CHARACTER O 363
   (CHARWD R 0.32)
   (CHARHT R 0.55)
   (VARCHAR
      (REP O 363)
      )
   )

to be compared with the metrics in the Computer Modern fonts when the delcode is "26A30C; first the normal variant in cmsy10 that has

(CHARACTER O 152
   (CHARWD R 0.277779)
   (CHARHT R 0.75)
   (CHARDP R 0.25)
   )

and then the larger variant in cmex10

(CHARACTER O 14
   (CHARWD R 0.333334)
   (CHARDP R 0.600006)
   (VARCHAR
      (REP O 14)
      )
   )

As you can see, the depth is set, and not the height.

A workaround is to redefine \big in such a way that it adjusts the choice when | follows.

\documentclass{article}

\usepackage{stix,amsmath}

\makeatletter
\let\amstexbig\big
\def\newbig#1{%
  \ifx#1|%
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
  {\big@bar}%
  {\amstexbig{#1}}%
}
\AtBeginDocument{\let\big\newbig}
\def\big@bar{\bBigg@{1.1}|}
\makeatother


\begin{document}

$\}|\rangle$

$\big\}\big|\psi\big\rangle$.

$|\big|\Big|\bigg|\Bigg|$

$\{\big\{\Big\{\bigg\{\Bigg\{$

$(\big(\Big(\bigg(\Bigg($

$[\big[\Big[\bigg[\Bigg[$

\end{document}

Making it work with \lvert and \rvert would be possible, but requires pure expansion, so many layers of \expandafter.

enter image description here

Related Question