Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ In order to install the library do the following:
2. then run `make`
3. after that `make install`
4. put `mechanics` from `bin` directory to your `PATH`
5. also don't forget to install LaTeXiT and put `scmutils-latexit`
from `bin` to you `PATH` if you want be able to use `pe-li` function

## Contributors to this library include:

Expand Down
20 changes: 20 additions & 0 deletions bin/scmutils-latexit
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env osascript

-- gets a tex expression as an input
-- and then passes it to LaTeXiT
on run argv
set appName to "LaTeXiT"
set latexExpr to item 1 of argv

activate application appName

tell application "System Events"
tell front window of (process appName)
set value of text area 1 of scroll area 1 of splitter group 1 of group 2 to latexExpr
click radio button "Display" of radio group 1 of group 1 of group 2
click button "LaTeX it!" of group 1 of group 2
-- suppress the output buy returning an empty string
return ""
end tell
end tell
end run
16 changes: 16 additions & 0 deletions display/print.scm
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,25 @@ USA.
(define (print-expression-tex expr #!optional simplifier)
(display (get-expression-tex expr simplifier)))

(define (print-expression-latexit expr #!optional simplifier)
(let ((apple-script-command
(string-append
"/usr/bin/env scmutils-latexit"
" "
"'"
(get-expression-tex expr simplifier)
"'"
)))
;; first let's also print out
;; the expression first
(print-expression expr simplifier)
;; then let's execute the latexit command
(run-shell-command apple-script-command)
))

(define pe print-expression)
(define pet print-expression-tex)
(define pe-li print-expression-latexit)
(define se show-expression)


Expand Down