5

I have code similar to this:

\[
x / \sqrt{\frac{a}{b}}
\]

I.e. the first part (x) is normal height while the second part is tall. How do I get the / to be stretched vertically to match the second part?

Szabolcs
  • 2,685

2 Answers2

7

Depending on the spacing surrounding the symbol, you could use one of the \big, \Big, \bigg, or \Bigg commands or their friends for relation symbols \bigm, \Bigm, \biggm, or \Biggm:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
x \Biggm/ \sqrt{\frac{a}{b}}
\]

\[
x \Bigm/ \sqrt{a/b}
\]

\[
x \Bigg/ \sqrt{\frac{a}{b}}
\]

\[
x \Big/ \sqrt{a/b}
\]

\end{document}
Gonzalo Medina
  • 505,128
3

You could use something like this that automatically re sizes the slant and handles different sizes on both sides of the slant:

\documentclass{article}
\usepackage{amsmath}

\newcommand*{\nfrac}[2]{#1\left/\vphantom{#1}#2\right.}
\begin{document}


\[
\nfrac{x}{\sqrt{\frac{a}{b}}}
\]

\[
\nfrac{\sqrt{\frac{a}{b}}}{x}
\]

\[
\nfrac{x}{\sqrt{a/b}}
\]

\[
\nfrac{\sqrt{a/b}}{x}
\]

\end{document}

The \phantom handles the case where the numerator is taller than the denominator.

Peter Grill
  • 223,288