Maxima – 219 – alt-display – 2

sl101

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.670.

Funzioni e variabili

define_alt_display (function (input) , expr)
This function is similar to define: it evaluates its arguments and expands into a function definition. The function is a function of a single input input. For convenience, a substitution is applied to expr after evaluation, to provide easy access to Lisp variable names.

Set a time-stamp on each prompt: No, richiede il formato americano per la codifica del tempo; da me da errore.

info_display (form)
This is an alias for the default 1-d display function. It may be used as an alternative 1-d or 2-d display function.

(%i1) load("alt-display.mac")$

(%i2) set_alt_display(2,info_display);

(%o2) done
(%i3) x/y;

(%o3) x/y

mathml_display (form)
Produces MathML output.

219-0

tex_display (form)
Produces TeX output.

(%i1) load("alt-display.mac")$

(%i2) set_alt_display(2,tex_display);
\mbox{\tt\red({\it \%o}_{2}) \black}$$\mathbf{done}$$
(%i3) x/(x^2+y^2);
\mbox{\tt\red({\it \%o}_{3}) \black}$${{x}\over{y^2+x^2}}$$

multi_display_for_texinfo (form)
Produces Texinfo output using all three display functions.

219-1

reset_displays ()
Resets the prompt prefix and suffix to the empty string, and sets both 1-d and 2-d display functions to the default.

set_alt_display (num, display-function)
The input num is the display to set; it may be either 1 or 2. The second input display-function is the display function to use. The display function may be either a Maxima function or a lambda expression.

Here is an example where the display function is a lambda expression; it just displays the result as TeX (o LaTeX).

(%i1) load("alt-display.mac")$

(%i2) set_alt_display(2, lambda([form], tex(?caddr(form))))$

(%i3) integrate(exp(-t^2),t,0,inf);
$${{\sqrt{\pi}}\over{2}}$$

A user-defined display function should take care that it prints its output. A display function that returns a string will appear to display nothing, nor cause any errors.

set_prompt (fix, expr)
Set the prompt prefix or suffix to expr. The input fix must evaluate to one of prefix, suffix, general, prolog or epilog. The input expr must evaluate to either a string or false; if false, the fix is reset to the default value.

(%i1) load("alt-display.mac")$

(%i2) set_prompt('prefix,printf(false,"It is now: ~a~%",timedate()))$

It is now: 2019-03-02 09:14:08+01:00

The following example shows the effect of each option, except prolog. Note that the epilog prompt is printed as Maxima closes down. The general is printed between the end of input and the output, unless the input line ends in $.

Here is an example to show where the prompt strings are placed.

219-2

Here is an example that shows how to colorize the input and output when Maxima is running in a terminal or terminal emulator like Emacs. No, salto.

Posta un commento o usa questo indirizzo per il trackback.

Trackback

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo di WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione /  Modifica )

Google photo

Stai commentando usando il tuo account Google. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )

Connessione a %s...

Questo sito utilizza Akismet per ridurre lo spam. Scopri come vengono elaborati i dati derivati dai commenti.

%d blogger hanno fatto clic su Mi Piace per questo: