Reputation:
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!
Upvotes: 3
Views: 2195
Reputation: 9425
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...
Upvotes: 2
Reputation: 24336
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]}
Upvotes: 3
Reputation: 14731
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
You can also look at
Dynamic[CurrentValue/@{FontFamily, FontWeight, FontSize}]
Dynamic[CurrentValue/@{FontFamily, FontWeight, FontSize}] // TraditionalForm
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...
Upvotes: 5
Reputation: 1325
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.
Upvotes: -1
Reputation: 16232
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.
Upvotes: 4