8
$\begingroup$

When I increase the notebook magnification beyond a certain level, it pushes the output of a command onto a newline.

Image of the Issue

It does this normally when you enter something like foo // FullForm, because Out[n]= gets replaced by Out[n]//FullForm=, which is so much wider that it has to start a newline for the output. But it's a shame that once n enters double-digits that at a certain magnification, the usual Out[n]= is just barely too wide, and this behavior occurs. Setting the magnification with

SetOptions[EvaluationNotebook[], Magnification -> 1.65]

is enough to get this behavior, but a magnification of 1.6 is still fine. Is there an easy way to avoid this behavior? Can we slightly increase the size of the margin where In[n]:= and Out[n]= live to avoid this issue?

I'm running Mathematica 11.0 in Linux x86 (64-bit), and apparently this is an issue on OS X too, but not on Windows.

$\endgroup$
  • 3
    $\begingroup$ Possible duplicate of Out labels looks strange after turning on magnification $\endgroup$ – m_goldberg Feb 26 '17 at 23:24
  • 4
    $\begingroup$ @m_goldberg Yeah that's about the same question, but the accepted answer of "just use 150% magnification" is a bit disappointing (sorry). The reason I came across this issue is that I'm preparing a presentation in Mathematica, and for the notebook text to be readable to my whole audience, I think I need the magnification to be in the 180% to 200% range. But then is sucks to lose that much vertical space when every output eats up an extra line. $\endgroup$ – Mike Pierce Feb 26 '17 at 23:46
  • 1
    $\begingroup$ It is surprising to see this bug still exists after almost two years. Thank you for bringing this up, so I have got another solution. $\endgroup$ – happy fish Feb 27 '17 at 7:30
9
$\begingroup$

You can increase the CellMargins for the styles "Input" and "Output" in your style sheet to accommodate the increased size of the cell labels. For example, the following setting:

CellMargins -> {{80, 10}, {10, 5}}

fixes the issue for me with a Magnification of 2.


If you don't want to mess around with editing the style sheet, you could evaluate the following instead:

SetOptions[
    EvaluationNotebook[],
    StyleDefinitions -> Notebook[{
        Cell[StyleData[StyleDefinitions->"Default.nb"]],
        Cell[StyleData["Input"],CellMargins->{{80,10},{10,5}}],
        Cell[StyleData["Output"],CellMargins->{{80,10},{10,5}}]
    }]
]
$\endgroup$
  • $\begingroup$ I'm running SetOptions[EvaluationNotebook[], CellMargins -> {{200, 10}, {10, 5}}] and watching the corresponding option change in the Options Inspector, but there is no visible change in the notebook. :/ $\endgroup$ – Mike Pierce Feb 27 '17 at 0:06
  • $\begingroup$ That's because you need to change the CellMargins of the "Input" and "Output" cells, not of the notebook. Do this in the style sheet of your notebook. You can test by selecting the Input/Output cell and setting it's CellMargins in the option inspector. $\endgroup$ – Carl Woll Feb 27 '17 at 0:10
  • $\begingroup$ Ah! I got ya. I've never edited the stylesheet directly, so I was having a hard time figuring it out. But the SetOptions[...] command you posted works perfectly. Thank you. $\endgroup$ – Mike Pierce Feb 27 '17 at 1:01
  • 3
    $\begingroup$ So Magnification doesn't affect Cell margins, right? I thought it magnifies everything... $\endgroup$ – Alexey Popkov Feb 27 '17 at 3:30

Your Answer

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

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