1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
* Maths Server In Node
math-server.js is a NodeJS script that implements a simple socket
server. This server accepts LaTeX math expressions, and processes
them using MathJax and the Speech-Rule-Engine to produce
spoken math using Aural CSS.
Note that this is early, experimental code, i.e. there is no support,
and if it breaks, you get to keep both pieces.
* Setup Instructions
** Install ~node~, ~npm~ and ~nvm~
First some terminology:
- nvm :: Node Version Manager
- npm :: Node Package Manager
- node :: Node executable
1. Install node and npm. You need a newer node than the default node (nodejs)
installed in Ubuntu, use nvm (Node Version Manager) to manage the node installation. See
file ~nvm-setup~ in this directory for instructions.
2. Copy the ~nvm-setup~ file to your home directory as ~.nvm-setup~,
and make sure it runs correctly by executing:
: . .nvm-setup
3. If the above runs without errors, add the line
: . .nvm-setup
to your ~.bash_profile~.
4. Make sure that your environment is set up to find the right ~node~
executable:
: which node
in bash should show that the ~node~ executable is found under ~$HOME/.nvm/...~.
** Install Dependencies
type
: npm install
in ~$EMACSPEAK_DIR/js/node~ to install dependencies.
** Test the server at the shell
: node math-server.js
Then, from a different shell window, connect to the server.
: nc localhost 5000
: enter: \frac{a+b}{c+d}
If all goes well, you'll see an S-expression printed out. Hit _C-d_ to
close client and server.
** Connect From Within Emacspeak
- First time: M-x package-install nvm to configure Emacs to find
the right ~node~ executable.
- M-x load-library emacspeak-maths
- M-x emacspeak-maths-start --- start the server/client.
- Invoke the /Maths Navigator/ AKA emacspeak-maths muggle using key
_s-SPC_ --- here _s-_ means press the Windows key.
- Read the docs and profit --- see info node /emacspeak-maths/ in
the emacspeak manual.
|