I'm using $f(x)\xrightarrow[x\to\infty] l$
to denote that a function tends to a certain value. However, this stretches the current line vertically. Is there any way to fix this?
[Tex/LaTex] How to get a limit arrow without modifying the current line’s height
math-modespacing
Related Solutions
For very strange reasons, the slot "6B
in the font sy-iwona
is empty. The \lVert
and \rVert
commands point to that slot, so you can't see any symbol because it's not there to begin with. The definition of \lVert
and \rVert
given by amsmath
are
\DeclareMathDelimiter{\lVert}
{\mathopen}{symbols}{"6B}{largesymbols}{"0D}
\DeclareMathDelimiter{\rVert}
{\mathclose}{symbols}{"6B}{largesymbols}{"0D}
which mean: in normal size take the character living in the symbol
font in slot "6B
while for bigger sizes take the character living in the largesymbols
font in slot "0D
. The difference between the two is that the former is given \mathopen
type, the latter is \mathclose
.
Indeed
$\norm[\big]{x}$
works, because the bigger delimiter is found.
There's not so much to do except taking the symbol from another font, for instance
\documentclass[border=4]{standalone}
\usepackage[math]{iwona}
\usepackage{mathtools}
\DeclareSymbolFont{extrasymbols}{OMS}{cmsy}{m}{n}
\DeclareMathDelimiter{\lVert}
{\mathopen}{extrasymbols}{"6B}{largesymbols}{"0D}
\DeclareMathDelimiter{\rVert}
{\mathclose}{extrasymbols}{"6B}{largesymbols}{"0D}
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
\begin{document}
Testing $\norm{x}$.
Testing $\norm[\big]{x}$.
\end{document}
Unfortunately, a compatible candidate would be Kurier, which also lacks the symbol.
A different solution, that doesn't require a substitute font, is to emulate the symbol at the size it's missing.
\documentclass[border=4]{standalone}
\usepackage[math]{iwona}
\usepackage{mathtools}
\usepackage{xparse}
\DeclarePairedDelimiter\xnorm{\lVert}{\rVert}
\NewDocumentCommand{\norm}{som}
{\IfBooleanTF{#1}
{\xnorm*{#3}}
{\IfNoValueTF{#2}
{\mathopen{|\mkern-.8mu|}#3\mathclose{|\mkern-.8mu|}}
{\xnorm[#2]{#3}}%
}
}
\begin{document}
Testing $\norm{x}$.
Testing $\norm[\big]{x}$.
\end{document}
The \norm
symbol does like xnorm
unless it has no optional argument, in which case the two bars are produced from the single bar.
If you want a definition that works without doing the hack when the bug is fixed, you can do like this:
\documentclass[border=4]{standalone}
\usepackage[math]{iwona}
\usepackage{mathtools}
\usepackage{xparse}
\makeatletter
\AtBeginDocument{%
\check@mathfonts
\iffontchar\textfont2 "6B
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
\else
\DeclarePairedDelimiter\xnorm{\lVert}{\rVert}
\NewDocumentCommand{\norm}{som}
{\IfBooleanTF{#1}
{\xnorm*{#3}}
{\IfNoValueTF{#2}
{\mathopen{|\mkern-1mu|}#3\mathclose{|\mkern-1mu|}}
{\xnorm[#2]{#3}}%
}%
}
\fi
}
\makeatother
\begin{document}
Testing $\norm{x}$.
Testing $\norm[\big]{x}$.
\end{document}
It works with all fonts so long as they don't use bizarre slots for the double vertical bar. It will define \norm
in the easier way if the character exists, otherwise it will do the hack.
The amount of shrinkability is defined by the font metrics of the current font. Its value can be retrieved as \fontdimen4\font
and it should be compared to the standard interword space, residing in \fontdimen2\font
. The standard Computer Modern Roman font at 10pt has
\fontdimen 2 = 3.33333pt
\fontdimen 4 = 1.11111pt
whereas the NewTX font (a clone of Times) has
\fontdimen 2 = 2.5pt
\fontdimen 4 = 1.00006pt
so the interword space can shrink up to 1.5pt. By contrast, TeX Gyre Bonum, which is quite a wide font has
\fontdimen 2 = 3.2pt
\fontdimen 4 = 1.06999pt
There is no “universal threshold”: the font designer decides.
You can change the value of the relevant \fontdimen
, but there are some points to be considered:
- any assignment to a
\fontdimen
is global; - assigning a different
\fontdimen
must be done for every font variant (shape, weight or size) you use.
So, if you do
\AtBeginDocument{\fontdimen4\font=1pt }
this would only affect the \normalfont
at \normalsize
. You might hook into \selectfont
for setting \fontdimen4\font
to, say, one third of \fontdimen2\font
, but this would also act on the monospaced fonts that, usually, have zero shrinkability.
Example.
\documentclass{article}
\usepackage{newtx}
\AddToHook{selectfont}{%
\ifdim\fontdimen4\font>0pt
\fontdimen4\font=\dimexpr\fontdimen2\font/3\relax
\fi
}
\begin{document}
2: \the\fontdimen2\font
4: \the\fontdimen4\font
\itshape
2: \the\fontdimen2\font
4: \the\fontdimen4\font
\upshape\Large
2: \the\fontdimen2\font
4: \the\fontdimen4\font
\ttfamily
2: \the\fontdimen2\font
4: \the\fontdimen4\font
\end{document}
Without the \AddToHook
declaration, the same code would produce
Best Answer
Perhaps you meant to say
$f(x) \xrightarrow{x\to\infty} l$
which produces better results.Otherwise,
\scriptstyle
does what is asked for, but not sure you'll like the results: