0

Sometimes when I have an input, mathematica will give the out put with a visual output of the fraction:

i.e

Input:3/4
Output:
 3
---
 4

whereas other times it represents this with the division symbol:

Input:3/4
Output:
 3 / 4

I'm not sure what the triggering factor is for how it is chosen to be displayed nor how to force it into one method versus the other.

Any explanation would be appreciated.

As requested here is something that seems to be on the edge case of how it wants to be displayed:

In[1]:= (2 (-6 a^2  Derivative[1][f][b]^2 + 
     b c^2 Derivative[1][f][a] Derivative[1][f][b]^2 - 
     2 (a - b)^3 b Derivative[1][f][b]^3 + 
     2 (a - b)^3 b c^2 Derivative[1][f][b]^3))/(a (a - b) Derivative[
    1][f][b] (-1 + 
     a + (a - b)^2 Derivative[1][f][b]^2 - (a - b)^2 c^2 Derivative[
       1][f][b]^2))

enter image description here

where as after adding a couple more terms I get:

In[2]:= (2 (-6 a^2  Derivative[1][f][b]^2 b^3 - 
     6 a^2  Derivative[1][f][b]^2 - 6 c^2  Derivative[1][f][b]^2 + 
     b c^2 Derivative[1][f][a] Derivative[1][f][b]^2 - 
     2 (a - b)^3 b Derivative[1][f][b]^3 + 
     2 (a - b)^3 b c^2 Derivative[1][f][b]^3))/(a (a - b) Derivative[
    1][f][b] (-1 + 
     a + (a - b)^2 Derivative[1][f][b]^2 - (a - b)^2 c^2 Derivative[
       1][f][b]^2))

enter image description here

akozi
  • 853
  • 3
  • 10
  • This is probably somewhat convoluted. Perhaps you could provide two specific inputs that generate the two formats? – MarcoB Feb 15 '22 at 18:26
  • I'll give it a try. My suspicion was that it was somehow related to the display size of the monitor and so I was concerned that a simple test case I came up with would be different for other users – akozi Feb 15 '22 at 18:27
  • Related: https://mathematica.stackexchange.com/questions/33618/outputting-a-fraction-on-one-line-with-an-oblique-division-sign, https://mathematica.stackexchange.com/questions/33655/how-to-write-beveled-fractions -- There may be others. – Michael E2 Feb 15 '22 at 18:34
  • Perhaps one of you could confirm whether the change in display format occurs at the same step as for me? I'm particularly curious if its a uniform change based on the length of characters or related to the display size. There are also other cases whereby it also choose to split the fraction into a number of fractions summed together. – akozi Feb 15 '22 at 18:39
  • There's also this form: Expand[(x + a)^15]/x. I find that examples like the OP's depend on the window size at the time the output is typeset. – Michael E2 Feb 15 '22 at 18:41
  • @MichaelE2 I think the links you posted are about forcing a third fraction display option rather than the two default options mentioned above. Perhaps there's more detail in them, I'll read more thoroughly now. – akozi Feb 15 '22 at 18:42
  • You should also consider the somewhat poorly documented FractionBox, FractionBoxOptions, and MultilineFunction. Example: Style[Expand[(x + a)^15]/Expand[(x + a)^4], FractionBoxOptions -> {MultilineFunction -> LineWrapParts}] -- (The other links are about controlling the output form of a fraction, which may or may not help in this case; however, if they do not, they may help others looking to solve a slightly different problem than yours.) – Michael E2 Feb 15 '22 at 18:47
  • 1
    I find it's based on the width of the window. When I make the window narrow, both of your expressions display in-line using a solidus (/). When I make it a bit wider, the top one displays as a 2D fraction, but the bottom one remains in-line. When I made it wider still, both display as 2D fractions. When I then shrink the window back to the narrow version, both revert to an inline display. [Though if I re-expand, they stay in-line; I need to reevalute to get the 2D display back.]. The principle is that Mathematica doesn't want to break a 2D fraction across two lines (for obvious reasons). – theorist Feb 16 '22 at 00:01
  • 1
    [...continued...] Mathematica also retains space for a small margin, so it won't go 2D right up the cell indicators at the right, but it comes pretty close. [Note: The above was tested on a 27" 4k display using a Mac and Mathematica 12.2 , with Mathematica's default font and magnification.] – theorist Feb 16 '22 at 00:02
  • @theorist ahhh this makes sense. I thought I was testing that but I was only shrinking it after I ran the lines but obviously that shouldn't change. What you described is exactly what I experience on a 29" 1080p monitor. Thank you everyone for the input. Obviously this isn't quite inline with stack-exchange; more of a curiosity than an issue, but all the comments were greatly appreciated :) – akozi Feb 16 '22 at 13:43

0 Answers0