fbed99da

Пример создания палитры функций



Пример создания палитры функций

С помощью директивы Notebook [...] можно создать документ-«блокнот». Ниже представлен такой документ, создающий палитру из нескольких простых функций.

Notebook[{

Cell[BoxData[GridBox[{{

ButtonBox[\(Create\ a\ New\ Notebook\), ButtonFunction:>CompoundExpression[ Needs[ "Graphics"Graphics*"] , Needs[ "Graphics'Colors' "], Clear[ targetNB], Set[ targetNB,

NotebookCreate[ ] ] ] , ButtonEvaluator->Automatic]}, {ButtonBox[\(f[x_] := \)]},

{ButtonBox[\(Apply\ DefinitionX),

ButtonFunction:>CompoundExpression[ NotebookWrite[ targetNB, Cell[

BoxData[

FractionBox[ RowBox[ {

RowBox[ {"f", "[", "x", "]"}]/ "-", RowBox[ {"f", "[", "a", "]"}]}], RowBox[ {"x", "-", "a"}]]],

"Input"], All],

SelectionEvaluateCreateCell[ targetNB]], ButtonEvaluator->Automatic]},

{ButtonBox[\(Cancel[\[SelectionPlaceholder]]\)]}, {ButtonBox[\(Limit[\[SelectionPlaceholder] , x -> a]\)]}, {ButtonBox[\(DisplayX TogetherX),

ButtonFunction:>CompoundExpression[ NotebookWrite[ targetNB, Cell[

BoxData[

RowBox [ {

RowBox[ {"DisplayTogether", "[", "\n", "\t'V

RowBox[ {RowBox[ {"Plot", "[",

RowBox[ {RowBox[ {"f", "[", "x", "]"}], ",",

RowBox[ {"{", RowBox[ {"x", ",",

RowBox[ {"-", "5"}], ",", "5"}], "}"}],",",

RowBox[ {"PlotStyle", "->",

RowBox[ {"{", "Orange", "}"}]}]}], "]"]],

RowBox[ {"Plot", "[",

RowBox[ {"\[Placeholder]", ",",

RowBox[ {"{",

RowBox[ {"a", ",",

D/-M7i2^vr ;» "» "5"}] " , " , "5"}] '} " } ] , " , " KOWBOX [1~л -3)J, ,, Э ] \ , s ) J , ,,

RowBox[ {"PlotStyle", "->", RowBox [ {"{", "Violet", "}"}]}]}], "]"}]}']/ "]"}], ";"}]], "Input"], All]], ButtonEvaluator->Automatic]}}, RowSpacings->0, ColumnSpacings->0, GridDefaultElement:>ButtonBox[ "\\[Placeholder]"]]],

NotebookDefault,

CellMargins->{{Inherited, Inherited}, {5, Inherited}}, Evaluatable->True,

CellGroupingRules->"InputGrouping", PageBreakAbove->True, PageBreakWithin->False, GroupPageBreakWithin->False, CellLabelMargins->{{11, Inherited},

{Inherited, Inherited}},

DefaultFormatType->DefaultInputFormatType, LineSpacing->{!.25, 0}, AutoItalicWords->{}, FormatType->InputForm, ScriptMinSize->9, ShowStringCharacters->True, NumberMarks->True, Counterlncrements->"lnput", StyleMenuListing->None, FontFamily->"Courier", FontWeight->"Bold"]},

FrontEndVersion->"Microsoft Windows 3.0", ScreenRectangle->{{0, 800}, {0, 544}},

Editable->False, WindowToolbars->{},PageWidth->358 WindowSize->{151, 105}, WindowMargins->{{291, Automatic} Automatic, 19}},

WindowFrame->"Palette", WindowElements->{},

WindowFrameElements->"CloseBox",

WindowClickSelect->False,

ScrollingOptions->{"PagewiseScrolling"->True}, ShowCellBracket->False, CellMargins->{{0, 0}/ {Inherited, 0}}, Active->True, CellOpen->True, ShowCellLabel->False, ShowCellTags->False, ImageMargins->{{0, Inherited}, {Inherited! 0}}, Magnification->l]

Справа показано окно, в котором выполнены операции, шаблоны которых выводит созданная палитра функций. Это окно создается если нажать кнопку Create New Notebook (Создать новый документ)



Содержание раздела