3

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!

  • 2
    You might find [this So discussion](http://stackoverflow.com/questions/5058854/using-mathematica-to-build-presentations-and-documents) to be of use. Also, you may find the [documentation on stylesheets](http://reference.wolfram.com/mathematica/guide/Stylesheets.html) helpful. – DavidC Nov 03 '11 at 20:57

5 Answers5

5

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...

Community
  • 1
  • 1
Simon
  • 14,631
  • 4
  • 41
  • 101
  • 1
    By the way, this is probably a deliberate design choice by WRI. `StandardForm` is meant to be a clear and unambiguous format. Using a dingbats font would definitely remove the clarity of the format. – Simon Nov 04 '11 at 04:29
  • So is it wrong if I use TraditionalForm instead of StandardForm ? –  Nov 04 '11 at 18:18
  • @Nazaf: No, it's not wrong. I know of a few Mma gurus who use `TraditionalForm` for a bulk of their work... – Simon Nov 04 '11 at 21:48
4

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

Sjoerd C. de Vries
  • 16,122
  • 3
  • 42
  • 94
  • Try TraditionalForm instead of StandardForm (`Cell > Convert to`). Most font options (size, color, weight, slant) work fine in both Forms but it looks like the font family choice in TraditionalForm is more restricted than in StandardForm. – Sjoerd C. de Vries Nov 03 '11 at 19:24
  • I am using my own custom stylesheet. –  Nov 03 '11 at 19:30
  • I don't, see pictures. What version do you have? – Sjoerd C. de Vries Nov 03 '11 at 19:35
  • Could you try removing the `$Failed` Cell, and try formatting an Output cell again? I saw that $Failed once too when I was playing around, but it went away. – Sjoerd C. de Vries Nov 03 '11 at 20:06
  • @Nazaf Interesting - does it work if you start a new blank notebook and try to just change straightforward output? i.e. `test="testing this output font"` and see if you can get that very simple output to change? – canadian_scholar Nov 03 '11 at 20:30
  • 1
    By the way, I have the DefaultStyleDefinitions global option set to a custom stylesheet. This is not a problem, right? –  Nov 03 '11 at 20:54
  • Perhaps there's something wrong with that stylesheet? Could you try with everything set at default? – Sjoerd C. de Vries Nov 03 '11 at 21:11
3

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

Mr.Wizard
  • 24,179
  • 5
  • 44
  • 125
  • 3
    The problem with that is that the output is not copy/paste-able... Maybe `$PrePrint = Interpretation[Style[#, FontFamily -> "Symbol"], #] &;` – Simon Nov 04 '11 at 05:28
2

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...

Alexey Popkov
  • 9,355
  • 4
  • 42
  • 93
-1

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.

canadian_scholar
  • 1,315
  • 12
  • 26
  • I see a red text in large font size. so what now? –  Nov 03 '11 at 20:48
  • I need to automate this in a stylesheet, so I don't have to type it each time. –  Nov 03 '11 at 20:51
  • 1
    @Nazaf Perhaps you could provide some more information in your question. Something odd is going on if you can't change your style sheet.. – canadian_scholar Nov 03 '11 at 20:54
  • If I use Shift + Ctrl + E to edit the expression manually change font family it works !! But how do I save changes to the global stylesheet ? –  Nov 03 '11 at 21:19
  • @Nazaf This would be a good thing to edit your question to add - just so other users don't miss it (hidden down here in comments). – canadian_scholar Nov 03 '11 at 21:36