RE: Re: copying
- To: mathgroup at smc.vnet.net
- Subject: [mg45775] RE: [mg45751] Re: copying
- From: "David Park" <djmp at earthlink.net>
- Date: Sat, 24 Jan 2004 03:29:02 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
That seems very complicated. In a regular Mathematica notebook place the cursor in a cell you wish to copy and change it to InputForm. (Use Shift-Ctrl-I, Shift-Ctrl-N to go back to StandardForm and Shift-Ctrl-T to go to TraditionalForm.) Or you may wish to copy the cell down first (Ctrl-L) and then change to InputForm. Then just copy and paste into an email or posting. I always think it is better to just copy the contents and not the entire cell with the In or Out numbers. Then a series of cells can be easily copied from the posting and pasted back into a Mathematica notebook. About a month ago Bobby Treat posted code for a palette that allows you to simply select and copy Mathematica code in InputForm. I find this quite useful. I have attached a copy of the code below. Paste it into a notebook and choose to interpret it so that it will create a new notebook with a button. Then select it and generate a palette from the selection. Save it in Configuration/FrontEnd/Palettes. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Harold Noffke [mailto:Harold.Noffke at wpafb.af.mil] To: mathgroup at smc.vnet.net Jim: There are two ways to post an example. The first way is to launch the Mathematica Kernel, which will display a text window into which you can copy your Input lines, and recreate your output lines in TextForm. The second way is to view your Notebook with a text editor, and then copy all of that text into a posting. This can be used by downloaders to recreate your notebook. Most simple examples are done the TextForm way. For an example of the Notebook route, see ... From: Alex (akhmel at hotmail.com) To: mathgroup at smc.vnet.net Subject: [mg45775] [mg45751] For general discussion Regards, Harold ************************************************************************ Notebook[{ Cell[BoxData[ ButtonBox[\(Copy\ As\n \ InputForm\), ButtonFunction:>Module[ {cpy, cpynb, evalnb}, CompoundExpression[ Set[ cpy, NotebookRead[ InputNotebook[ ]]], If[ SameQ[ cpy, {}], Return[ ]], Set[ cpynb, NotebookCreate[ Visible -> False]], NotebookWrite[ cpynb, cpy], SelectionMove[ cpynb, All, Notebook], FrontEndExecute[ { FrontEndToken[ cpynb, "SelectionConvert", "InputForm"]}], Set[ evalnb, NotebookPut[ Notebook[ Map[ Cell[ #, "Input"]&, { BoxData[ RowBox[ {"cpynb", "=", ToBoxes[ cpynb]}]], "FrontEndExecute[{FrontEndToken[cpynb, \ \"CopySpecial\",\"PlainText\"]}]", "NotebookClose[cpynb]", "NotebookClose[EvaluationNotebook[]]"}], Visible -> False]]], SelectionMove[ evalnb, All, Notebook], SelectionEvaluate[ evalnb], Null]], ButtonEvaluator->Automatic, Active->True]], NotebookDefault, CellMargins->{{Inherited, Inherited}, {7, Inherited}}, PageBreakAbove->True, CellLabelMargins->{{12, Inherited}, {Inherited, Inherited}}, InputAutoReplacements->{ "->"->"\[Rule]", ":>"->"\[RuleDelayed]", "<="->"\[LessEqual]", ">="->"\[GreaterEqual]", "!="->"\[NotEqual]", "=="->"\[Equal]", Inherited}, "TwoByteSyntaxCharacterAutoReplacement"->True, Hyphenation->True, LineSpacing->{1.25, 0}, ScriptMinSize->9, CounterIncrements->"Text", StyleMenuListing->None, FontFamily->"Courier"] }, FrontEndVersion->"5.0 for Microsoft Windows", ScreenRectangle->{{0, 1280}, {0, 941}}, WindowSize->{492, 740}, WindowMargins->{{21, Automatic}, {Automatic, 27}} ]