Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a fraction written inside parentheses. Instead of increasing the size of the parentheses using \left( or \big(, I actually want the fraction to automatically shrink. (Specifically, I want it to resize so that it does not extend beyond the vertical bounds of the size of a default (.)

What is the simplest way to do this manually? And is there a rule I can implement at the top of my document so that this always happens automatically?

\documentclass{article}
\begin{document}
The symbol $(\frac{n^\alpha}{(1 + p)^n})$ is taller than the parentheses,
so it extends below and above them, which I don't want.
\end{document}
share|improve this question
2  
You can use \scalebox from the \graphicx package, or perhaps the relsize package. –  Peter Grill Mar 29 '12 at 14:51
1  
Scaling down the box is really bad style and the text will be hardly readible, instead you should flatten your fraction $((n^\alpha)/(1 + p)^n)$ or use display equation, whatever fits better. –  Khaled Hosny Mar 29 '12 at 19:05
add comment

3 Answers

up vote 2 down vote accepted

While I don't recommend it because it is really bad style, you could scale the content using \resizebox{!}{<height>}{..} or \scalebox{<factor>}{..} from the graphicx package. You might want to raise the baseline using \raisebox{<amount>}{..}.

\documentclass{article}
\usepackage{graphicx}
\usepackage{calc}
\begin{document}
The symbol $($\resizebox{!}{\heightof{$()$}}{$\frac{n^\alpha}{(1 + p)^n}$}$)$ is taller than the parentheses,
so it extends below and above them, which I don't want.

The symbol $($\raisebox{.1ex}{\resizebox{!}{1.4ex}{$\frac{n^\alpha}{(1 + p)^n}$}}$)$ is taller than the parentheses,
so it extends below and above them, which I don't want.

\end{document}

The adjustbox package can also be used to simplify the command, e.g. \adjustbox{height=<height>,raise=<amount>}{..}. Also try totalheight instead of height and see if the results fit better.

share|improve this answer
1  
neat! hadn't thought of it as "graphic" material! –  Koji Mar 29 '12 at 14:53
1  
@Koji: Usually you shouldn't ;-) –  Martin Scharrer Mar 29 '12 at 14:58
2  
@Koji: Note that the scaling and resizing commands are needed to include images in a given size, so they are added to graphicx. They also work on other things like text or math. –  Martin Scharrer Mar 29 '12 at 14:58
add comment

My best shot would be $(\frac{\scriptscriptstyle n^\alpha}{\scriptscriptstyle(1 + p)^n})$, but that is also bigger that the regular parenthesis (besides looking horrible).

Would you consider $n^\alpha/(1+p)^n$?

share|improve this answer
add comment

On the off chance that your question is raised in the hopes of not needing to remember to use \left/\right/\bigs (or something), how about \def\pfrac#1#2{ {#1 \overwithdelims() #2} }? amsmath will nag though, but not error.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.