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

enter image description here

2 Answers 2


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


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.

You must log in to answer this question.

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