|
|
Re: Stylesheet for input side by side with output
Posted:
Oct 3, 2012 3:12 AM
|
|
Ok, here ie the margin :-) .... but it is only a non-debugged sketch of a start... the rest does not fit in the margin....
Define the function SideBySideFunction,
ClearAll[SideBySideFunction];
SideBySideFunction[nb_] := Catch@Module[{nbrInput, nbrOutput},
SelectionMove[nb, All, EvaluationCell, AutoScroll -> False];
nbrInput = NotebookRead[nb];
SelectionMove[nb, Next, Cell, AutoScroll -> False];
nbrOutput = NotebookRead[nb];
If[nbrOutput[[2]] =!= "Output", Throw[Null]];
NotebookDelete[nb];
SelectionMove[nb, Previous, Cell, AutoScroll -> False];
NotebookWrite[nb, ToBoxes@TextCell[ Grid[{{RawBoxes[nbrInput], RawBoxes[nbrOutput]}}], "Text", StripOnInput -> True]]
];
SideBySideFunction[] := SideBySideFunction[EvaluationNotebook[]]
Then, in the notebook set the option at the Notebook level by:
SetOptions[EvaluationNotebook[], CellEpilog :> SideBySideFunction[]]
Or, to not depend on the function definition of SideBySideFunction execute the following in the notebook:
SetOptions[EvaluationNotebook[],
CellEpilog :> Catch@Module[{nb, nbrInput, nbrOutput},
nb = EvaluationNotebook[];
SelectionMove[nb, All, EvaluationCell, AutoScroll -> False];
nbrInput = NotebookRead[nb];
SelectionMove[nb, Next, Cell, AutoScroll -> False];
nbrOutput = NotebookRead[nb];
If[nbrOutput[[2]] =!= "Output", Throw[Null]];
NotebookDelete[nb];
SelectionMove[nb, Previous, Cell, AutoScroll -> False];
NotebookWrite[nb, ToBoxes@TextCell[ Grid[{{RawBoxes[nbrInput], RawBoxes[nbrOutput]}}], "Text", StripOnInput -> True]]
]
]
With apologies to Fermat....
--David
On Sep 29, 3:10 am, Brentt <brenttnew...@gmail.com> wrote: > Thank you, I was thinking it could probably be done if I got down and dir= ty > with some notebook programming. As for the margins, I'm thinking it would > work well for doing scratch calculations, as in those times I usually hav= e > a lot of real estate on the right and find myself wanting to look at > results and input separately. > > Fermat was proven correct in two respects I suppose: the theorem is > (apparently) correct, and there actually wasn't enough room in the margin= s > for the proof. > > Fermat was proved correct in two respects: that proof really couldn't hav= e > fit in the margins. > > > > > > > > On Thu, Sep 27, 2012 at 12:05 AM, Brentt <brenttnew...@gmail.com> wrote: > > > Thank you for the suggestions :) > > > On Wed, Sep 26, 2012 at 1:12 AM, christopher arthur < > > chris.arth...@gmail.com > > > wrote: > > > > You could use authortools "makebilateralcells" afterwards...but it > > > wouldn't be automatic. > > > > Brentt a =E9crit : > > > > Hi, is there a way to make input on the left side of the screen, an= d > > then > > > > output appear on the right side of the screen? For example instead = of > > the > > > > default notebook style > > > > > Input[n]: foo > > > > Output[m]: bar > > > > > have > > > > > Input[n]: foo | = Output[m]: bar > > > > > where there is some sort of split screen type divider. Seems to me = like > > > it > > > > would be a nicer way to work.
|
|