1
0
Fork 0

Reorganize documentation of plug-ins

This commit is contained in:
Joris van der Hoeven 2012-03-07 14:03:34 +00:00
parent cb4e04585c
commit 5d5c1110e0
4 changed files with 186 additions and 129 deletions

View File

@ -1,9 +1,9 @@
<TeXmacs|1.0.7.11> <TeXmacs|1.0.7.14>
<style|tmdoc> <style|tmdoc>
<\body> <\body>
<tmdoc-title|Plugins as scripting languages> <tmdoc-title|Plug-ins as scripting languages>
<TeXmacs> provides a few other kinds of additional interfaces to external <TeXmacs> provides a few other kinds of additional interfaces to external
systems in addition to shell-like interfaces. First of all, it is possible systems in addition to shell-like interfaces. First of all, it is possible
@ -19,17 +19,67 @@
evaluated output <script-output|maxima|default|diff(x^x,x)|<math|x<rsup|x>*<around*|(|log evaluated output <script-output|maxima|default|diff(x^x,x)|<math|x<rsup|x>*<around*|(|log
<around*|(|x|)>+1|)>>>. Using <shortcut|(kbd-shift-return)>, you enable <around*|(|x|)>+1|)>>>. Using <shortcut|(kbd-shift-return)>, you enable
multi-line input. This kind of executable switches are very useful for multi-line input. This kind of executable switches are very useful for
plugins such as <name|Dra<TeX>>, <name|Eukleides>, <name|Feynmf>, plug-ins such as <name|Dra<TeX>>, <name|Eukleides>, <name|Feynmf>,
<abbr|etc.>, which are mainly used for the efficient computation and <abbr|etc.>, which are mainly used for the efficient computation and
insertion of special graphics inside <TeXmacs> documents. insertion of special graphics inside <TeXmacs> documents.
Some plugins such as <name|Maxima> can even be selected as a <em|scripting Some plug-ins such as <name|Maxima> can even be selected as a <em|scripting
language> using <menu|Document|Scripts|Maxima>. When doing so, a special language> using <menu|Document|Scripts|Maxima>. When doing so, a special
<menu|Maxima> menu will appear, which allows for many useful operations <menu|Maxima> menu will appear, which allows for many useful operations
directly on formulas. For instance, when putting the cursor inside the directly on formulas. For instance, when putting the cursor inside the
formula <math|1+1> and pressing <shortcut|(kbd-return)> or <menu|Evaluate>, formula <math|1+1> and pressing <shortcut|(kbd-return)> or <menu|Evaluate>,
the formula gets evaluated automatically to yield <math|2>. the formula gets evaluated automatically to yield <math|2>.
If a plug-in can be used as a scripting language, then it is possible to
create executable switches with links between them. More precisely,
assuming that you selected a scripting language from
<menu|Document|Scripts>, you may insert a new <em|executable input field>
using <shortcut|(make-calc-input)> or <menu|Insert|Link|Executable input
field>. As before, when pressing <key|return>, the current input is
evaluated and you will see the corresponding output; you may switch back to
the input by pressing <key|return> once more.
Contrary to executable switches, you may attach an identifier to the
executable input field by disactivating the field or by editing the
<samp|Ref> field in the focus bar. Inside other executable input fields,
you may then refer to the value of the field by inserting a <em|field
reference> using <shortcut|(make 'calc-ref)> or <menu|Insert|Link|Field
reference>. As a variant to executable input fields, you may sometimes
prefer to insert plain <em|input fields> using <shortcut|(make-calc-inert)>
or <menu|Insert|Link|Input field>. These fields can only be used as inputs
and pressing <key|return> inside such a field will only recompute those
other fields which depend on it.
<\example>
The excutable input fields may for instance be nice in pedagogic
documents in which parts of the document may be modified and recomputed
by the reader. For instance, evaluation of the input fragment
<\quote-env>
The derivative of <with|prog-scripts|maxima|<calc-inert|function|<math|x<rsup|x>>>>
equals <with|prog-scripts|maxima|<calc-input|derivative|diff(<calc-ref|function>,x)|<math|x<rsup|x>*<around*|(|log
<around*|(|x|)>+1|)>>>>.
The second derivative is given by <with|prog-scripts|maxima|<calc-input|second|diff(<calc-ref|derivative>,x)|<math|x<rsup|x>*<around*|(|log
<around*|(|x|)>+1|)><rsup|2>+x<rsup|x-1>>>>.
</quote-env>
yields
<\quote-env>
The derivative of <with|prog-scripts|maxima|<calc-inert|function2|<math|x<rsup|x>>>>
equals <with|prog-scripts|maxima|<calc-output|derivative2|diff(<calc-ref|function2>,x)|<math|x<rsup|x>*<around*|(|log
<around*|(|x|)>+1|)>>>>.
The second derivative is given by <with|prog-scripts|maxima|<calc-output|second2|diff(<calc-ref|derivative2>,x)|<math|x<rsup|x>*<around*|(|log
<around*|(|x|)>+1|)><rsup|2>+x<rsup|x-1>>>>.
</quote-env>
Of course, if the reader changes the input function <math|x<rsup|x>> into
something else and presses <key|return>, then the first and second
derivatives will be updated automatically.
</example>
<tmdoc-copyright|1998--2002|Joris van der Hoeven> <tmdoc-copyright|1998--2002|Joris van der Hoeven>
<tmdoc-license|Permission is granted to copy, distribute and/or modify this <tmdoc-license|Permission is granted to copy, distribute and/or modify this

View File

@ -1,6 +1,6 @@
<TeXmacs|1.0.7.11> <TeXmacs|1.0.7.14>
<style|tmdoc> <style|<tuple|tmdoc|maxima>>
<\body> <\body>
<tmdoc-title|Editing sessions> <tmdoc-title|Editing sessions>
@ -27,11 +27,69 @@
Subsessions have a nice rendering on the screen when using the Subsessions have a nice rendering on the screen when using the
<tmpackage|varsession> package in <menu|Document|Use package|Program>. <tmpackage|varsession> package in <menu|Document|Use package|Program>.
Notice that input/output fields and subsessions are foldable: when clicking
on the prompt with the mouse, you may fold or unfold the entry to hide or
show the output. For laptop presentations, this folding and unfolding
process is done automatically when traversing your presentation. It is also
possible to fold or unfold all fields in a session using
<menu|Session|Session|Fold all fields> and <menu|Session|Session|Unfold all
fields>.
Other useful editing operations are <menu|Session|Session|Clear all Other useful editing operations are <menu|Session|Session|Clear all
fields>, which is useful for creating a demo session which will be executed fields>, which is useful for creating a demo session which will be executed
later on, and <menu|Session|Split session>, which can be used for splitting later on, and <menu|Session|Split session>, which can be used for splitting
a session into parts for inclusion into a paper. a session into parts for inclusion into a paper.
<\example>
<label|session-example>A typical <name|Maxima> session is given below. If
<name|Maxima> is present on your system, then you may put your cursor in
one of the inputs, perform some edits, and try to reexecute it.
<\session|maxima|default>
<\output>
Maxima 5.25.1 http://maxima.sourceforge.net
using Lisp SBCL 1.0.51
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
</output>
<\unfolded-io>
<with|color|red|(<with|math-font-family|rm|%i>1) >
<|unfolded-io>
diff (x^x^x, x)
<|unfolded-io>
<math|<with|math-display|true|<text|<with|font-family|tt|color|red|(<with|math-font-family|rm|%o1>)
>>x<rsup|x<rsup|x>>*<around*|(|x<rsup|x>*log
<around*|(|x|)>*<around*|(|log <around*|(|x|)>+1|)>+x<rsup|x-1>|)>>>
</unfolded-io>
<\unfolded-io>
<with|color|red|(<with|math-font-family|rm|%i>2) >
<|unfolded-io>
integrate (%o1, x)
<|unfolded-io>
<math|<with|math-display|true|<text|<with|font-family|tt|color|red|(<with|math-font-family|rm|%o2>)
>>\<mathe\><rsup|\<mathe\><rsup|x*log <around*|(|x|)>>*log
<around*|(|x|)>>>>
</unfolded-io>
<\unfolded-io>
<with|color|red|(<with|math-font-family|rm|%i>3) >
<|unfolded-io>
integrate (x^5 / (x^2 - x + 17), x)
<|unfolded-io>
<math|<with|math-display|true|<text|<with|font-family|tt|color|red|(<with|math-font-family|rm|%o3>)
>><frac|239*log <around*|(|x<rsup|2>-x+17|)>|2>+<frac|1361*arctan
<around*|(|<frac|2*x-1|<sqrt|67>>|)>|<sqrt|67>>+<frac|3*x<rsup|4>+4*x<rsup|3>-96*x<rsup|2>-396*x|12>>>
</unfolded-io>
</session>
</example>
<tmdoc-copyright|1998--2002|Joris van der Hoeven> <tmdoc-copyright|1998--2002|Joris van der Hoeven>
<tmdoc-license|Permission is granted to copy, distribute and/or modify this <tmdoc-license|Permission is granted to copy, distribute and/or modify this

View File

@ -1,87 +1,88 @@
<TeXmacs|1.0.1.21> <TeXmacs|1.0.7.14>
<style|tmdoc> <style|tmdoc>
<\body> <\body>
<expand|tmdoc-title|Selecting the input method> <tmdoc-title|Selecting the input method>
By default, <TeXmacs> will attempt to evaluate the input field when By default, <TeXmacs> will attempt to evaluate the input field when
pressing <key|return>. Multiline input can be created using pressing <key|return>. Multiline input can be created using <key|S-return>.
<key|S-return>. Alternatively, when selecting the multiline Alternatively, when selecting the multiline input mode using
input mode using <apply|menu|Session|Input mode|Multiline input>, the <menu|Session|Input mode|Multiline input>, the <key|return> key will behave
<key|return> key will behave as usual and as usual and <key|S-return> may be used in order to evaluate the input
<key|S-return> may be used in order to evaluate the input
field. Notice finally that certain systems admit built-in heuristics for field. Notice finally that certain systems admit built-in heuristics for
testing whether the input has been completed; if not, then the testing whether the input has been completed; if not, then the <key|return>
<key|return> may behave as usual. may behave as usual.
Certain applications allow you to type the mathematical input in a Certain applications allow you to type the mathematical input in a
graphical, two dimensional form. This feature can be used by selecting graphical, two dimensional form. This feature can be used by selecting
<apply|menu|Session|Input mode|Mathematical input>. If this feature is <menu|Session|Input mode|Mathematical input>. If this feature is available,
available, then it is usually also possible to copy and paste output back then it is usually also possible to copy and paste output back into the
into the input. However, it depends on the particular application how well input. However, it depends on the particular application how well this
this works. works.
<apply|tmdoc-copyright|1998--2002|Joris van der Hoeven> <\example>
Below, you will find the <hlink|previous example
session|man-session-edit.en.tm#session-example>, but now using
mathematical input:
<expand|tmdoc-license|Permission is granted to copy, distribute and/or <\session|maxima|default>
modify this document under the terms of the GNU Free Documentation License, <\output>
Version 1.1 or any later version published by the Free Software Foundation; Maxima 5.25.1 http://maxima.sourceforge.net
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the section entitled using Lisp SBCL 1.0.51
"GNU Free Documentation License".>
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
</output>
<\unfolded-io-math>
<with|color|red|(<with|math-font-family|rm|%i>1) >
<|unfolded-io-math>
diff<around*|(|x<rsup|x<rsup|x>>,x|)>
<|unfolded-io-math>
<math|<with|math-display|true|<text|<with|font-family|tt|color|red|(<with|math-font-family|rm|%o1>)
>>x<rsup|x<rsup|x>>*<around*|(|x<rsup|x>*log
<around*|(|x|)>*<around*|(|log <around*|(|x|)>+1|)>+x<rsup|x-1>|)>>>
</unfolded-io-math>
<\unfolded-io-math>
<with|color|red|(<with|math-font-family|rm|%i>2) >
<|unfolded-io-math>
<big|int>%o1*\<mathd\> x
<|unfolded-io-math>
<math|<with|math-display|true|<text|<with|font-family|tt|color|red|(<with|math-font-family|rm|%o2>)
>>\<mathe\><rsup|\<mathe\><rsup|x*log <around*|(|x|)>>*log
<around*|(|x|)>>>>
</unfolded-io-math>
<\unfolded-io-math>
<with|color|red|(<with|math-font-family|rm|%i>3) >
<|unfolded-io-math>
<big|int><frac|x<rsup|5>|x<rsup|2>-x+17>*\<mathd\> x
<|unfolded-io-math>
<math|<with|math-display|true|<text|<with|font-family|tt|color|red|(<with|math-font-family|rm|%o3>)
>><frac|239*log <around*|(|x<rsup|2>-x+17|)>|2>+<frac|1361*arctan
<around*|(|<frac|2*x-1|<sqrt|67>>|)>|<sqrt|67>>+<frac|3*x<rsup|4>+4*x<rsup|3>-96*x<rsup|2>-396*x|12>>>
</unfolded-io-math>
</session>
</example>
<tmdoc-copyright|1998--2002|Joris van der Hoeven>
<tmdoc-license|Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled "GNU Free
Documentation License".>
</body> </body>
<\initial> <\initial>
<\collection> <\collection>
<associate|paragraph width|150mm>
<associate|odd page margin|30mm>
<associate|shrinking factor|4>
<associate|page right margin|30mm>
<associate|page top margin|30mm>
<associate|reduction page right margin|25mm>
<associate|page type|a4>
<associate|reduction page bottom margin|15mm>
<associate|even page margin|30mm>
<associate|reduction page left margin|25mm>
<associate|page bottom margin|30mm>
<associate|reduction page top margin|15mm>
<associate|language|english> <associate|language|english>
</collection> </collection>
</initial> </initial>
<\references>
<\collection>
<associate|idx-5|<tuple|<uninit>|?>>
<associate|idx-6|<tuple|<uninit>|?>>
<associate|idx-7|<tuple|<uninit>|?>>
<associate|idx-8|<tuple|<uninit>|?>>
<associate|idx-1|<tuple|<uninit>|?>>
<associate|idx-2|<tuple|<uninit>|?>>
<associate|idx-3|<tuple|<uninit>|?>>
<associate|idx-4|<tuple|<uninit>|?>>
</collection>
</references>
<\auxiliary>
<\collection>
<\associate|idx>
<tuple|<tuple|<with|font family|<quote|ss>|Session>|<with|font
family|<quote|ss>|Insert fields>>|<pageref|idx-1>>
<tuple|<tuple|<with|font family|<quote|ss>|Session>|<with|font
family|<quote|ss>|Remove fields>>|<pageref|idx-2>>
<tuple|<tuple|<with|font family|<quote|ss>|Session>|<with|font
family|<quote|ss>|Insert fields>|<with|font family|<quote|ss>|Insert
text field>>|<pageref|idx-3>>
<tuple|<tuple|<with|font family|<quote|ss>|Text>|<with|font
family|<quote|ss>|Session>>|<pageref|idx-4>>
<tuple|<tuple|<with|font family|<quote|ss>|Text>|<with|font
family|<quote|ss>|Session>|<with|font
family|<quote|ss>|Other>>|<pageref|idx-5>>
</associate>
</collection>
</auxiliary>

View File

@ -78,59 +78,7 @@
Similarly, automatic renumbering is used when inserting new columns or Similarly, automatic renumbering is used when inserting new columns or
rows, or when removing existing columns or rows. rows, or when removing existing columns or rows.
<TeXmacs> also allows you to use some of the spreadsheet capacities outside We also notice that field references can be used inside spreadsheet cells
tables. For instance, assuming that you selected a scripting language from
<menu|Document|Scripts>, you may insert a new <em|executable input field>
using <shortcut|(make-calc-input)> or <menu|Insert|Link|Executable input
field>. The behaviour is similar to the one of <hlink|executable
switches|man-scripting-language.en.tm>: when pressing <key|return>, the
current input is evaluated and you will see the corresponding output; you
may switch back to the input by pressing <key|return> once more. In
particular, the input does not need to be preceded by <samp|=> (as in the
case of spreadsheet cells).
Contrary to executable switches, you may attach an identifier to the
executable input field by disactivating the field or by editing the
<samp|Ref> field in the focus bar. Inside other executable input fields,
you may then refer to the value of the field by inserting a <em|field
reference> using <shortcut|(make 'calc-ref)> or <menu|Insert|Link|Field
reference>. As a variant to executable input fields, you may sometimes
prefer to insert plain <em|input fields> using <shortcut|(make-calc-inert)>
or <menu|Insert|Link|Input field>. These fields can only be used as inputs
and pressing <key|return> inside such a field will only recompute those
other fields which depend on it.
<\example>
The excutable input fields may for instance be nice in pedagogic
documents in which parts of the document may be modified and recomputed
by the reader. For instance, evaluation of the input fragment
<\quote-env>
The derivative of <with|prog-scripts|maxima|<calc-inert|function|<math|x<rsup|x>>>>
equals <with|prog-scripts|maxima|<calc-input|derivative|diff(<calc-ref|function>,x)|<math|x<rsup|x>*<around*|(|log
<around*|(|x|)>+1|)>>>>.
The second derivative is given by <with|prog-scripts|maxima|<calc-input|second|diff(<calc-ref|derivative>,x)|<math|x<rsup|x>*<around*|(|log
<around*|(|x|)>+1|)><rsup|2>+x<rsup|x-1>>>>.
</quote-env>
yields
<\quote-env>
The derivative of <with|prog-scripts|maxima|<calc-inert|function2|<math|x<rsup|x>>>>
equals <with|prog-scripts|maxima|<calc-output|derivative2|diff(<calc-ref|function2>,x)|<math|x<rsup|x>*<around*|(|log
<around*|(|x|)>+1|)>>>>.
The second derivative is given by <with|prog-scripts|maxima|<calc-output|second2|diff(<calc-ref|derivative2>,x)|<math|x<rsup|x>*<around*|(|log
<around*|(|x|)>+1|)><rsup|2>+x<rsup|x-1>>>>.
</quote-env>
Of course, if the reader changes the input function <math|x<rsup|x>> into
something else and presses <key|return>, then the first and second
derivatives will be updated automatically.
</example>
We notice that field references can also be used inside spreadsheet cells
in order to refer to some computational markup outside the table. in order to refer to some computational markup outside the table.
Inversely, each spreadsheet also carries an invisible <samp|Ref> field Inversely, each spreadsheet also carries an invisible <samp|Ref> field
which can be edited by deactivating the spreadsheet or from the focus bar which can be edited by deactivating the spreadsheet or from the focus bar
@ -138,7 +86,7 @@
spreadsheet is used as a prefix for refering to the contents of cells spreadsheet is used as a prefix for refering to the contents of cells
outside the table or from within other spreadsheets. For instance, if outside the table or from within other spreadsheets. For instance, if
<samp|Ref> equals <samp|sheet>, then <samp|sheet-c4> will refer to the <samp|Ref> equals <samp|sheet>, then <samp|sheet-c4> will refer to the
field <samp|c4> inside the table. field <samp|c4> inside the spreadsheet.
<tmdoc-copyright|2012|Joris van der Hoeven> <tmdoc-copyright|2012|Joris van der Hoeven>