6

The following code:

Inline mode $\|f\|_{H^{-1}}, \|f\|_{_{H^{-1}}}, \|f\|_{_{\scalebox{0.7}{$H^{-1}$}}},\|f\|_{_{\scalebox{0.5}{$H^{-1}$}}}$, 
display mode $$\|f\|_{H^{-1}}, \|f\|_{_{H^{-1}}}, \|f\|_{_{\scalebox{0.7}{$H^\{-1}$}}},\|f\|_{_{\scalebox{0.5}{$H^{-1}$}}}$$

Results in the following:

Result

I want to have $H^{-1}$ as a sub-index, in the first case it is just too big to be a subindex.

I added a second subindex in the second, the H looks good, but the -1 is just too big, in particular the minus sign.

I added scalebox, in the last two cases, which seems to give a better looking result, and it actually scale correctly the term H^{-1}, but I hate to use it, I can see this failing once I have to modify this for other formats, but I'm not sure.

Is there a way to tell that minus sign to scale appropriately with respect to the sub-index level used?


It seems that one way to solve the problem is to correctly set the norms either by grouping or defining a norm command as perfectly shown in some answer.

I still found that the minus sign is too big in what follows:

\begin{equation}
  \begin{aligned}
    &f^{-1}(x) &&L_{f^{-1}}[\eta] \\
    &f(x)   &&L_{f}[\eta]
  \end{aligned}
\end{equation}

enter image description here

The "-1" sign takes even more width than the "f" in the first case, in the seconds it gets close to the width of the $L_f$.

I imagine I could use a different symbol, i.e. a minus in $1-2$ could be different that in $-1$.

  • I've taken the liberty of editing the title of your posting, as I believe the main issues are not about the size of the "minus" sign in the subscript terms. Feel free to revert if you disagree with my action. – Mico Apr 3 '17 at 5:51
  • @Mico even though my example has the norm, I found the minus sign to be too big in other cases like when attached to an inverse function, I guess I could use a different symbol to express the "minus" not as a binary operation "1-1" but just "-1". I will revert the title and add the example with inverse as well. – Jorge E. Cardona Apr 3 '17 at 14:45
  • Is your main concern, then, with the size of the "minus" sign in compound sub/super-script subformulas? Please advise. – Mico Apr 3 '17 at 15:19
  • @Mico Yes, I'm mostly concerned with the width taken by the minus sign, in super-scripts and compound sub/super-scripts formulas. Thanks for your help! – Jorge E. Cardona Apr 3 '17 at 15:22
  • Your best bet may be to define a couple of macros like this -- \newcommand{\mym}{\mkern-1.5mu-\mkern-3mu 1} and \newcommand\finv{f^{\mym}} -- and then write $L_{\finv}[\eta]$. Note that this approach simply reduces the amount of whitespace around the scriptscript-style minus symbol. It does not reduce the size of either the minus symbol or the digit 1. – Mico Apr 3 '17 at 15:57
4

(I revised this answer thoroughly after receiving additional comments from the OP.)

I think there are two issues that need to be addressed: One is the spacing around the - ("minus") sign when it occurs in scriptscript-style math mode, and the other is the vertical positioning of the subscript formulas that follow a "norm" (double vertical bar) symbol.

Regarding the first issue, I suggest you define some macros like this

\newcommand{\mym}{\mkern-1.5mu-\mkern-3mu 1}
\newcommand\finv{f^{\mym}}
\newcommand\Hinv{H^{\mym}}

and then write $L_{\finv}[\eta]$ instead of L_{f^{-1}}[\eta]. Note that this approach simply reduces the amount of whitespace around the scriptscript-style minus symbol. It does not reduce the size of either the minus symbol or the digit 1; I'm concerned that reducing the size of the scriptscript-style glyphs would also reduce their basic readability. If you think the compressed -1 still takes up too much space, you should probably coming up with new and space-saving notation to denote the inverse of a function. E.g., something like f* or \bar{f}...

Regarding the second issue: Note that the formula \|f\|_{H^{-1}} may be broken down into two sub-formulas: \|f\| and _{H^{-1}}. What you're encountering is that TeX has special rules for placing subscripts that follow a "math atom" such as \|: The subscripts (and superscripts) are set in a cramped mode. While this is OK in most settings, it's clearly not optimal for your use case. I can think of two remedies: Either change the first sub-formula from \|f\| to {\|f\|}, changing its type to "math-ordinary", or -- more LaTeX-ishly -- define a macro called \norm (say) using the machinery of the mathtools package, and then write \norm{f} instead of {\|f\|}.

Combining the solutions to the two issues, I think you should write \norm{f}_{\Hinv} instead of \|f\|_{H^{-1}}.

enter image description here

\documentclass{article}
\usepackage{mathtools} % for "\DeclarePairedDelimiter" macro
\DeclarePairedDelimiter\norm\lVert\rVert     % create a "\norm" macro
\newcommand{\mym}{\mkern-1.5mu-\mkern-3mu 1} % short for "my minus one"
\newcommand\finv{f^{\mym}}
\newcommand\Hinv{H^{\mym}}

\begin{document}
$L_{f^{-1}}[\eta]$ vs.\ $L_{\finv}[\eta]$

\bigskip
\emph{Original code}

\quad$\|f\|_{H^{-1}}\quad\|f\|_{\Hinv}$

\bigskip
\emph{Employ grouping}

\quad${\|f\|}_{H^{-1}}\quad{\|f\|}_{\Hinv}$

\bigskip
\emph{Dedicated \emph{\texttt{\textbackslash norm}} macro}

\quad$\norm{f}_{H^{-1}}\quad\norm{f}_{\Hinv}$
\end{document}
3

What you probably want is adding a (possibly empty) superscript, which will push down the subscript.

Here's an augmented version of \DeclarePairedDelimiter that does it:

\documentclass{article}

\usepackage{mathtools} % for \DeclarePairedDelimiter
\usepackage{xparse}    % for \NewDocumentCommand
\usepackage{booktabs}  % for the table

\DeclarePairedDelimiter{\normAux}{\lVert}{\rVert}
\NewDocumentCommand{\norm}{sO{}me{_^}}{%
  \IfBooleanTF{#1}
    {\normAux*{#3}\normS#4}
    {\normAux[#2]{#3}\normS#4}%
}
\NewDocumentCommand{\normS}{mm}{%
  \IfValueT{#1}{_{#1}}^{\IfValueT{#2}{#2}}%
}

\begin{document}

\renewcommand{\arraystretch}{1.5}

\begin{tabular}{lll}
\toprule
Style & New & Old \\
\midrule
Inline
  & $\norm{f}$ & $\|f\|$ \\
  & $\norm{f}^{2}$ & $\|f\|^2$ \\
  & $\norm{f}_{H^{-1}}$ & $\|f\|_{H^{-1}}$ \\
  & $\norm{f}_{H^{-1}}^{2}$ & $\|f\|_{H^{-1}}^{2}$ \\
\midrule
Display
  & $\displaystyle\norm{f}$ & $\displaystyle\|f\|$ \\
  & $\displaystyle\norm{f}^{2}$ & $\displaystyle\|f\|^2$ \\
  & $\displaystyle\norm{f}_{H^{-1}}$ & $\displaystyle\|f\|_{H^{-1}}$ \\
  & $\displaystyle\norm{f}_{H^{-1}}^{2}$ & $\displaystyle\|f\|_{H^{-1}}^{2}$ \\
\midrule
Sizes
  & \multicolumn{2}{l}{%
      $\norm[\big]{f}_{H^{-1}},\norm[\Big]{f}_{H^{-1}},\norm*{\dfrac{f}{2}}_{H^{-1}}$%
    } \\
\bottomrule
\end{tabular}

\end{document}

(Beware: the syntax for the e argument type might change.)

enter image description here

2

I would complete the answer from Miko. Why it works? Why ${\|f\|}_H$ behaves differently than $\|f\|_H$? The answer is in TeXbook, page 445, paragraphs 18a and 18b. Roughly speaking, when nucleus (i.e. the object which is subscripted) is single character, then the subscript is lowered by \fondimen16 independent of the depth of the nucleus. But if the nucleus includes more characters then the depth of nucleus is measured and the subscript is lowered by this depth plus \fondtimen19. The reason of this feature is our requirement that we need to have subscripts of $a_2, f_2$ in the same vertical position.

  • Hi, thanks for your answer, I can see why it makes sense in text mode to keep the subscripts and superscripts aligned, but I can't see why in math mode the same is true. For terms like $H^1$, $L^p$ and so on, I found the superscripts are to close to the mid part of the symbol. In terms like $u^m$ it looks fine, but in $u^m \in L^p$ I prefer to have no alignment of superscripts, and have the p raised, do you know how to make latex to behave the same as if there is a group with a single character? Beside using vphantom. – Jorge E. Cardona Apr 7 '17 at 15:33

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.