The code

%\RequirePackage{fix-cm}%%% makes no difference
%\usepackage{lmodern}%%% makes no difference
\({}_{N_n^m}\) \({}_{\mathbb{N}_n^m}\)


result of generation

The meaning of the term is {1,2,...,n} × ... × {1,2,...,n} (m times), i.e., {1,2,...n}^m. I'm using this term in, say \[\bigcup_{b\in\mathbb{N}_n^m} \prod_{i=1}^n \mleft(A_i\setminus\mleft(\bigcup_{\substack{1\le j\le m\\b_j=i}}P^j_i\mright)\mright)\].

For my taste, the letter m is placed too low, apparently unrelated to the height of the preceding N. How to place m on a suitable height in all possible contexts automatically? That is, I'd like to have a macro (say, in LaTeX3) such as

{ m m } 

except that #2 is placed on a proper height automatically.

  • I've posted an answer that works in display, text, script, and scriptscript style. :-) – Mico Dec 5 '16 at 18:03

A trick might be forcing TeX into not using the cramped style:




\({}_{\cubeOfNaturals{n}{m}}\) \({}_{\mathbb{N}_n^m}\)


enter image description here


Here's an idea: Insert a "top-smashed" \mathstrut in the superscript position. Specifically, insert a \mathstrut whose height above the baseline has been smashed. Smashing the top of an object (via a \smash[t]{...} directive) leaves the its depth below the baseline unchanged. (Aside: \mathstrut is defined as \vphantom{)}, i.e., it's an invisible object with the height and depth of a round parenthesis.)

enter image description here

\usepackage{amsfonts,mathtools} % mathtools loads amsmath, which provides '\smash[t]' macro
\newcommand{\Nnm}{N_n^{m\smash[t]{\mathstrut}}} % smash away the top of '\mathstrut'
$N_n^m$ $\mathbb{N}_n^m$ vs.\ $\Nnm$ $\NNnm$

$\displaystyle \bigcup_{b\in\NNnm} \prod_{i=1}^n \biggl(A_i \setminus 
   \biggl(\,\smashoperator[r]{\bigcup_{\substack{1\le j\le m\\b_j=i}}}P^j_i\biggr)\biggr)$

Your Answer

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