Resizing in a manner similar to mathclap

Is there something similar to \mathclap in TeXmacs?
In particular the following code:

  <\equation*>
  \<phi\>\<in\>\<Psi\><rsub|<around*|(|k,\<infty\>|)>><around*|<left|(|-2>|\<star\>,\<ldots\>,\<star\>,<wide|\<theta\><rsub|j>|\<wide-overbrace\>><rsup|j<rsup|th>
  position>,\<star\>,\<ldots\>,\<star\>|<right|)|-2>>
</equation*>

gets rendered with a huge space around the overbrace because of the string “j^th position” string on top. Is there a way to tell TeXmacs to avoid using the box of the superscript in space computations? The only solution I found for now is using the “resize” macro and manually specifying the bounding box dimensions. This is unstable if I change the actual inside the superscript and below, under the brace.

This might work

 <\equation*>
  \<phi\>\<in\>\<Psi\><rsub|<around*|(|k,\<infty\>|)>><around*|<left|(|-2>|\<star\>,\<ldots\>,\<star\>,<wide|\<theta\><rsub|j>|\<wide-overbrace\>><rsup|<resize|<move|j<rsup|th>
  position|-0.5w|>|0em||0em|>>,\<star\>,\<ldots\>,\<star\>|<right|)|-2>>
</equation*>

By trial and error :slight_smile:
Inside the move tag I have used the w parameter (valid within the move tag) after I saw that with the resize tag only I would move the superscript to the right

Edit: perhaps this is simpler and therefore better:

  <\equation*>
    \<phi\>\<in\>\<Psi\><rsub|<around*|(|k,\<infty\>|)>><around*|<left|(|-2>|\<star\>,\<ldots\>,\<star\>,<wide|\<theta\><rsub|j>|\<wide-overbrace\>><rsup|<resize|j<rsup|th>
    position|<plus|1l|0.5w>||<plus|1r|-0.5w>|>>,\<star\>,\<ldots\>,\<star\>|<right|)|-2>>
  </equation*>

I use the box widths as parameters of the resize tag.

P.S. the box widths are available within some of the resizing and positioning tags, see e.g. the help for the move tag.

2 Likes

Alternatively one can do

\<phi\>\<in\>\<Psi\><rsub|<around*|(|k,\<infty\>|)>>
<around*|<left|(|-2>|\<star\>,\<ldots\>,\<star\>,<wide|\<theta\><rsub|j>|\<wide-overbrace\>>
<rsup|<resize|j<rsup|th> position|<plus|0.5w|-0.5em>||<plus|0.5w|0.5em>|>>,
\<star\>,\<ldots\>,\<star\>|<right|)|-2>>

So that the script occupy the size of 1em. This is similar to the solution of @pireddag but looks like that one does not need to use 1l and 1r.

Unfortunately the editing of the content is not anymore possible in this way… I’m not sure there is a better solution.