https://github.com/nilqed/fricas-texmacs
FriCAS & TeXmacs (plugin enhancements)
https://github.com/nilqed/fricas-texmacs
computer-algebra-system fricas texmacs-config texmacs-plugin
Last synced: 5 months ago
JSON representation
FriCAS & TeXmacs (plugin enhancements)
- Host: GitHub
- URL: https://github.com/nilqed/fricas-texmacs
- Owner: nilqed
- License: other
- Created: 2025-01-15T15:30:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-09T20:32:19.000Z (about 1 year ago)
- Last Synced: 2025-03-09T21:25:21.148Z (about 1 year ago)
- Topics: computer-algebra-system, fricas, texmacs-config, texmacs-plugin
- Language: Scheme
- Homepage:
- Size: 316 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fricas-texmacs
FriCAS & TeXmacs (plugin enhancements + SPAD support)
:construction: work in progress :warning:
### Improved Math Input
Using the pattern matcher of guile/scheme.

### Package TMSPT (tmspt.spad)
The `TexmacsSupport` package allows to control most of the __TeXmacs__
menu commands from __FriCAS__.

### .fricas.input
One may use the FriCAS startup file `~/.fricas.input` to tailor the initial
__TeXmacs__ environment.
Example:
-- Usage: quickLoad pkg
-- => same as )lisp (ql:quickload pkg)
macro quickLoad(s) ==
syscmd(s) ==> systemCommand(s)$MoreSystemCommands
lisp2(f,a) ==> syscmd string(FORMAT('NIL,"lisp (~A _"~A_")",f,a)$Lisp)
syscmd "lisp (defvar |$inclAssertions| NIL)"
lisp2("load", "~/quicklisp/setup")
lisp2("ql:quickload",s)
-- Usage: setPromot("beforeNumber","afterNumber")
-- Example: setprompt("",". ") --> "10. " instead of "(10)-> "
macro setPrompt(beg,end) ==
syscmd(s) ==> systemCommand(s)$MoreSystemCommands
fmt1:="(DEFUN MKPROMPT () (PROG () (RETURN (STRCONC "
fmt2:="(STRINGIMAGE |$IOindex|) "
fmt3:= "))))"
cmd:="lisp " fmt1 "_"" beg "_"" fmt2 "_"" end "_"" fmt3
syscmd(cmd)
-- Usgae: lisp str (evaluates the string in Lisp and returns an SExpression)
lisp(s:String):SExpression == EVAL(READ_-FROM_-STRING(s)$Lisp)$Lisp
-- If one calls the following macro, the prompt will be changed
-- the package TMSPT will be loaded (if in ~/quicklisp/local-projects),
-- the "types" output will be redefined and the start banner will be deleted.
macro tmenv ==
setPrompt("",". ")
quickLoad tmspt
ioHook()
removeBanner()
One may also call a `FriCAS` session in `TeXmacs` by a shell script. The example
below will start `TeXmacs` then creates a `FriCAS` session and calls the macro
`tmenv()` from `.fricas.input` (if defined).
#!/bin/sh
#if [ -z "$1" ]; then echo *.input ... filename expected; exit 1; fi
texmacs -x "(begin \
(make-session \"fricas\" \"default\") \
(insert \"tmenv() \") \
(session-evaluate))"
TODO:
* more math input patterns
* menu
* documentation
* tidy up
:date: 15-JAN-2025
:revised: 15-AUG-2025