Re: StyleSheet -> SubInput & SubOutput
- To: mathgroup at smc.vnet.net
 - Subject: [mg118066] Re: StyleSheet -> SubInput & SubOutput
 - From: John Fultz <jfultz at wolfram.com>
 - Date: Mon, 11 Apr 2011 07:06:34 -0400 (EDT)
 
On Sat, 9 Apr 2011 18:00:27 -0400 (EDT), ShiftyMongoose wrote:
> Hi All,
>
> I've created two new format styles (SubInput & SubOutput) which is
> exactly the same as Input & Output format except that it is indented a
> few characters to the right.
>
> This was done by copying the format from Core.nb and changing
> "Cellmargins" start position.
>
> SubInput works fine, however after calculating the output, Mathematica
> will display the answer using the Output format instead of the SubOutput
> format.
>
> How do I instruct Mathematica to display the answer using the SubOutput
> format?
>
> Thanks,
> SM
Instead of copying the entire styles, you can actually base the
SubInput/SubOutput styles directly off of whatever Mathematica's existing
Input/Output styles are, which is less work and more portable across versions of
Mathematica.  Here's a version of what I'm talking about, with the appropriate
GeneratedCellStyle option set (which is the option you were looking for):
{
Cell[StyleData["SubInput", StyleDefinitions -> StyleData["Input"]],
 CellMargins->{{90, Inherited}, {Inherited, Inherited}},
 GeneratedCellStyles->{"Output"->"SubOutput"}],
Cell[StyleData["SubOutput", StyleDefinitions -> StyleData["Output"]],
 CellMargins->{{90, Inherited}, {Inherited, Inherited}}]
}
Copy the above list into your stylesheet, replacing the previous versions of
SubInput and SubOutput, and you'll have something that works like you want, I
think.
Sincerely,
John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.