3

So I am using \frac and it looks like the content in my denominator is touching the line, is there any way I can use a simple \vspace to correct the issue? Is there an easy fix or do I have to mess around with something else?

I'm using:

$= \frac{P(A \ \cap \ B)}{P(B)}$

sorry, couldn't get the Google Chart API to show what I wanted

This is what I was thinking:

$= \frac{P(A \ \cap \ B)}{\vspace{1mm} P(B)}$

This is being called in an article class, inside an \enumerate and \item.

Edit: So after trying some of the suggestions in the comments I found that using \displaystyle prior to \frac made the text match the default font size rather than the whole fraction matching the font size like in just using \frac.

The differences don't show in Google Chart API. (At least it didn't seem to be any different for me)

I liked using \vphantom{} as an exponent to create an invisible character, when just using \frac it actually fixed the issue with the denominator touching the line. Pretty clever.

Edit2: \dfrac is simpler alternative to \displaystyle\frac but it requires the amsmath package. \mfrac is a nice in-between the display and regular styles and it requires the nccmath.

  • The problem is because now it is inline equation. So you can change this to $\displaystyle\frac{P(A \ \cap \ B)}{P(B)}$ (the size will be bigger) or $\frac{P(A \ \cap \ B)}{P(B)^{\vphantom{X}}}$ as an easy fix. – Jagath Aug 4 '16 at 3:01
  • Use \vphantom{} with something tall inside the curlies. – JPi Aug 4 '16 at 3:02
  • \mathstrut is generally big enough (no \phantom required) \rule{0pt}{?ex} is adjustable. – John Kormylo Aug 4 '16 at 3:31
  • 1
    Welcome to TeX.SE. Instead of describing the use case, it would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. – Peter Grill Aug 4 '16 at 6:45
  • Use \dfrac in that case? – Manuel Aug 4 '16 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.