Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Hiding Input Cells

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82198] Re: Hiding Input Cells
  • From: David Reiss <dbreiss at gmail.com>
  • Date: Sun, 14 Oct 2007 06:18:06 -0400 (EDT)
  • References: <fepq5p$dfs$1@smc.vnet.net>

Much of the functionality that you are looking for is contained in the
Tagging palette in A WorkLife FrameWork
(http://scientificarts.com/worklife/).  But here is a pair of quick
and dirty functions that will do what you are looking for by
evaluating them in the desired notebook.

This is a function that will do what you want (evaluate it in the
notebook whose input cells you are wating to evaluate).

ClearAll[EvaluateAndHideInputCells];

EvaluateAndHideInputCells[] :=
  Module[{nb},

   nb = EvaluationNotebook[];
   NotebookFind[nb, "Input", All, CellStyle];
   MathLink`CallFrontEnd[FrontEnd`SelectionAddCellTags[nb,
{"toevaluate"}]];

   SelectionMove[nb, All, EvaluationCell];
   MathLink`CallFrontEnd[
    FrontEnd`SelectionRemoveCellTags[nb, {"toevaluate"}]];

   NotebookFind[nb, "toevaluate", All, CellTags];

   FrontEndExecute[FrontEndToken[nb, "EvaluateCells"]];

   NotebookFind[nb, "toevaluate", All, CellTags];
   MathLink`CallFrontEnd[
    FrontEnd`SelectionRemoveCellTags[nb, {"toevaluate"}]];
   SetOptions[NotebookSelection[nb], Editable -> True, CellOpen ->
False,
    ShowCellBracket -> False]

   ];

And this one will re-show the input cells to see them onece again.
Again evaluate it in the desired notebook.

ClearAll[ReopenInputCells];

ReopenInputCells[] :=
 Module[{nb},

  nb = EvaluationNotebook[];
  NotebookFind[nb, "Input", All, CellStyle];
  SetOptions[NotebookSelection[nb], Editable -> True, CellOpen ->
True,
   ShowCellBracket -> True]

  ]


I hope this helps...

--David
http://scientificarts.com/worklife
A WorkLife FrameWork
E x t e n d i n g MATHEMATICA's Reach...


On Oct 13, 2:55 am, "Harvey P. Dale" <h... at nyu.edu> wrote:
>             Is it possible to hide input cells following notebook
> evaluation?  I would like to have the output cells visible, but hide the
> input cells, so I can print the output without printing the input cells.
> I'd like this to happen automatically, so I don't have to delete the
> input cells one by one each time.
>
>             Thank you.
>
>             Sincerely,
>
>             Harvey P. Dale




  • Prev by Date: Re: Re: Re: [Mathematica 6] Format->Magnification does notwork on notebook
  • Next by Date: Re: Re: Strange Manipulate+ContourPlot behavior
  • Previous by thread: Re: Hiding Input Cells
  • Next by thread: Re: Re: Hiding Input Cells