I have known \overset{K}{\|} to set above. However how to do like this:

enter image description here


The same vertical size as \sum:




\nnn_{k=1}^K\quad \sum_{k=1}^K
\begin{center}% just to show inline math below displaystyle


enter image description here

| improve this answer | |

Currently, the width of the widest compnent (k=1) determines the width of the stack. If it is needed so that the width of K or the vertical bars determines the width of the stack, please let me know.

It was not clear (to me) from the context of the question whether the baseline is aligned with the K or the vertical bars. Thus, I offer both possibilities. In the latter, the bars will be sized the same as \sum:

K baseline: 
  \rule{.6pt}{15pt}\mkern2mu\rule{.6pt}{15pt}}{\scriptstyle k=1}}$

Rule baseline:

$\vbars^K_{k=1}$ (textstyle)

$\displaystyle\vbars^K_{k=1}$ (displaystyle)

enter image description here

In the latter case (\vbars math operator), if one wishes the rule thickness and gap to remain the same in both text and display styles, then, in the definition of \vbars, merely change \scalerel to \stretchrel.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.