5

Codes such as \right) and \left[ will rescale according to size. But is there any way to do that with the forward-slash? For instance, if I have this expression:

$f\left(1/\sqrt{\tilde{X}}\right)$

Is there any way to rescale that slash just to the left of the square root so that it's high enough? It doesn't look right when it is that short. And yes, to anyone asking, I don't want to use the \frac arrangement here.

6

\sqrt{\tilde{X}} is simply not an easy-to-look-at expression. You may want to think about writing \tilde{X}^{1/2} instead.

enter image description here

\documentclass{article}
\begin{document}
$f\left(1\middle/\sqrt{\tilde{X}}\,\right)$,
$f\bigl(1\!\bigm/\!\sqrt{\tilde{X}}\,\bigr)$

$f(1/\tilde{X}^{1/2})$,
$f(\tilde{X}^{-1/2})$
\end{document}
  • 2
    Different people have different opinions, but to my eyes the "1/2" is too widely spaced horizontally, and the huge "-" in "-1/2" is even worse. And the top of the digits really ought to align with the ~ symbol. But apart from all that, \tilde{X}^{1/2} looks perfect ;-) – alephzero Apr 9 '17 at 22:15
12

use \middle, e.g.

\documentclass{article}

\begin{document}
Text before $f\left(1\middle/\sqrt{\tilde{X}}\right)$ text after
\end{document}

Outputting:

enter image description here

Of course this is not recommended:

  • Often the spacing around left and right are off, and it's better to manually input the right parenthesis like \bigl( \big/ \bigr) etc…
  • The formula upsets the line spacing and possibly will destroy the flow of the text.

If you still don't want to show the formula in display, a better way is to manually select the proper parenthesis and slash.


A visual comparison

\documentclass{article}

\begin{document}

Text before $f(1/\sqrt{\tilde{X}}\,)$ text after (nothing)

Text before $f\bigl(1\big/\sqrt{\tilde{X}}\,\bigr)$ text after (\verb|\big|)

Text before $f\left(1\middle/\sqrt{\tilde{X}}\right)$ text after (automatic)

\end{document}

enter image description here

I usually recommend \, when a radical is followed by a fence.

  • 4
    egreg will \kill you for still using \left( ;) – TeXnician Apr 9 '17 at 20:56
  • @TeXnician I inserted a disclaimer. Unfortunately I feel that such a formula is not suitable for inline display too. – Moriambar Apr 9 '17 at 21:02
  • @TeXnician Next time I'll see him in person. ;-) – egreg Apr 9 '17 at 21:04
  • @egreg probably :P – Moriambar Apr 9 '17 at 21:04
  • @Moriambar You might show the output with standard height, for comparison, maybe along with \bigl(1\big/\sqrt{\tilde{X}}\bigr) – egreg Apr 9 '17 at 21:05
4

Well, yes, it's exactly as you would expect:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$f\left(1\left/\sqrt{\tilde{X}}\right.\right)$

\end{document}

\right. is the invisible paired delimeter.

enter image description here

Beware overusing \left and \right though. It's a rookie error to fall in love with these and there are some users who've been known to advocate never using them. In my opinion, this output is not nice, with lots of empty space below.

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.