MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How do I stop Mathematica changing the format of fractions in Input cells?

  • To: mathgroup at
  • Subject: [mg125813] Re: How do I stop Mathematica changing the format of fractions in Input cells?
  • From: John Fultz <jfultz at>
  • Date: Tue, 3 Apr 2012 04:51:26 -0400 (EDT)
  • Delivered-to:
  • Reply-to: jfultz at

On Sat, 31 Mar 2012 03:44:21 -0500 (EST), John Browne wrote:
> I am writing a notebook where I want to display some expressions in
> Input cells, in the 2-D fractional numerator-over-denominator format.
> However, I find that when I open the notebook again some time later,
> Mathematica has of its own accord decided to rewrite some of the
> fractions in the 1-D format using a "/". I have not been able to pin
> down precisely under what circumstances this happens, but it might be
> happening when the numerator and/or denominator gets over a certain
> length (or perhaps complexity). My trials have failed to find a reliable
> pattern of behaviour.
> The Input cells are not entered to create Output. They are just used for
> typesetting. Expressions copied from these Input cells into other Cell
> styles also show the same problem.
> Is there some option I can set for the affected cells (or the whole
> notebook) to tell Mathematica to leave them formatted just as I compose
> them?
> John

Mathematica's line-breaking algorithm will break a fraction into a 1-dimensional 
version if the 2D version was so long as to require scrolling to represent it.  
Once the fraction is in 1D form, it doesn't automatically reconstruct the 2D
form again.

You can try to get it back by using the Cell->Convert To->StandardForm (or 
TraditionalForm if that's what you're using), which will reinterpret and 
re-canonicalize the entire cell.  One of the side effects of that 
re-canonicalization is that it will reconstruct 2D fractions and try once again 
to see if they can be displayed without line-breaking.

So, one possibility that might be causing the problems you're seeing is that you 
might be resizing the notebooks to such a narrow width that you inadvertently 
trigger the behavior I'm describing.  If that doesn't seem to explain it, then 
I'd have to see one of the affected notebooks to comment further on what's going 


John Fultz
jfultz at
User Interface Group
Wolfram Research, Inc.

  • Prev by Date: Re:recursively solve equation and save the values only
  • Next by Date: Re: recursively solve equation and save the values only
  • Previous by thread: Re: How do I stop Mathematica changing the format of fractions in Input cells?
  • Next by thread: vlookup like function sugestion