How to modify OUTPUT font type?

2k Views Asked by At

Is it possible to change the OUTPUT font type instead of the default one? How?

This is my default stylesheet: http://filefactory.com/file/cfc2cb0/n/blueOutput.nb

Thanks!

5

There are 5 best solutions below

3
On BEST ANSWER

The problem lies in StandardForm not respecting the FontFamily option, although it does seem to respect most other font options. Sjoerd's answer used TraditionalForm output and thus worked. You can see this problem if you run

SetOptions[EvaluationNotebook[], StyleDefinitions -> Notebook[{
    Cell[StyleData[StyleDefinitions -> "Default.nb"]],
    Cell[StyleData["Output"],
     FontColor -> RGBColor[0, 0, .5], FontSize -> 14, 
     FontFamily -> "Symbol", FontWeight -> "Bold"]}]]

Then compare

{1 + 1, "abc", Sin[x]} (* This is by default in StandardForm *)
{1 + 1, "abc", Sin[x]} // StandardForm
{1 + 1, "abc", Sin[x]} // OutputForm
{1 + 1, "abc", Sin[x]} // TraditionalForm

output from above

You can also look at

Dynamic[CurrentValue/@{FontFamily, FontWeight, FontSize}]
Dynamic[CurrentValue/@{FontFamily, FontWeight, FontSize}] // TraditionalForm

output from above

which shows that the CurrentValue of FontFamily "seen" in the output depends on the output format.

Unfortunately, I don't see how to get around this issue...

5
On

You could try wrapping your inputs using the Style[] command. For example:

test="This is a test string.";
Style[test,{Red,"Title"}]

This generates the string in my style sheet's 'title' settings in the colour red. The solution of changing your Stylesheets is obviously preferable to this, but this might be a quick and dirty temporary workaround.

1
On

In light of Simon's answer, you could force output printing in a certain style using $PrePrint.

$PrePrint = Style[#, FontFamily -> "Symbol"] &;

{1 + 1, "abc", Sin[x]}

enter image description here

0
On

You can do this by redefining the StandardForm style which is used for Output style by default (see the DefaultFormatType option in the Output style):

SetOptions[EvaluationNotebook[], 
 StyleDefinitions -> 
  Notebook[{Cell[StyleData[StyleDefinitions -> "Default.nb"]], 
    Cell[StyleData["StandardForm"], 
     FontFamily -> "Palatino Linotype"]}, 
   StyleDefinitions -> "PrivateStylesheetFormatting.nb"]]

But Input style in this case is also affected because it is based on the StandardForm style too...

7
On

Just go to the Format > Edit Stylesheet... menu. Then in the private style definitions sheet that pops-up choose 'Output' from the pull-down menu and change the looks of the resulting Output cell. This stylesheet will be stored with your open notebook.

enter image description here

enter image description here