Math-Intensive Reports with GNU Emacs and Calc, Part 2
One aspect of Calc that is difficult to simulate properly for publication is its interactive behavior. In order to explain how to use Calc interactively in the static medium of the printed page, I had to resort in a couple of places to the trick of showing a line twice. The first is what I typed in the editing buffer before invoking Calc. The second is what I got back on the same line after invoking Calc. Therefore, if I run Calc a second time on the article file, it won't come out identical. This isn't generally a problem when preparing a report, because one is normally using Calc instead of trying to demonstrate it.
Emacs
General description: www.gnu.org/software/software.html
FTP mirror list & instructions for downloading: www.gnu.org/order/ftp.html
Emacs Wiki: www.emacswiki.org/cgi-bin/wiki.pl
NTEmacs
Download: ftp.gnu.org/gnu/windows/emacs
FAQ: www.cs.washington.edu/~voelker/ntemacs.html
Calc
Download: ftp.gnu.org/gnu/calc
Manual: www.cl.cam.ac.uk/texinfodoc/calc_toc.html
Cygwin Tools
Download: sources.redhat.com/cygwin
User's Guide: sources.redhat.com/cygwin/cygwin-ug-net/cygwin-ug-net.html
Emacs Lisp
The Emacs Lisp Archive: archive.cis.ohio-state.edu/pub/emacs-lisp
The Emacs Lisp List: thalamus.wustl.edu/wonglab/stephen/ell/ell.html
AucTeX
Download code and documentation: mirrors.sunsite.dk/auctex/www/auctex
Octave
Download code and documentation: www.octave.org
email: clhiii@attglobal.net
- « first
- ‹ previous
- 1
- 2
- 3
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.
Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.
Sponsored by ActiveState
| Speed Up Your Web Site with Varnish | Jun 19, 2013 |
| Non-Linux FOSS: libnotify, OS X Style | Jun 18, 2013 |
| Containers—Not Virtual Machines—Are the Future Cloud | Jun 17, 2013 |
| Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer | Jun 12, 2013 |
| Weechat, Irssi's Little Brother | Jun 11, 2013 |
| One Tail Just Isn't Enough | Jun 07, 2013 |
- Speed Up Your Web Site with Varnish
- Containers—Not Virtual Machines—Are the Future Cloud
- Linux Systems Administrator
- Non-Linux FOSS: libnotify, OS X Style
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- RSS Feeds
- Reply to comment | Linux Journal
3 hours 29 min ago - Yeah, user namespaces are
4 hours 45 min ago - Cari Uang
8 hours 16 min ago - user namespaces
11 hours 10 min ago - yea
11 hours 36 min ago - One advantage with VMs
14 hours 4 min ago - about info
14 hours 37 min ago - info
14 hours 38 min ago - info
14 hours 39 min ago - info
14 hours 41 min ago
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



Comments
Re: Math-Intensive Reports with GNU Emacs and Calc, Part 2
The author seemingly does not have worked extensively with calc. calc-2.02f does not work too well with Emacs-21. There are a lot of problems with symbolic simplifications, and some quirks with regard to input, scrolling and display.
For that reason, Emacs-21 users should, if at all, get calc directly from the Emacs CVS archive at Savannah.gnu.org where it is maintained as part of the next new-feature release of Emacs (probably 21.4). That version works quite better.
It is a pity that calc's author Dave Gillespie has stopped working on calc while still having a significantly faster (calc-2 does not even use Emacs' floating point variables!) and more extensive version of calc up his sleeves and already in use privately. If anybody manages to wheedle out those floppy disks or whatever else he has been storing this work on...
Re: Math-Intensive Reports with GNU Emacs and Calc, Part 2
You're correct, in that at the time I wrote the article I was quite inexperienced with Calc. Yes, I had noticed some problems on the symbolic side when using 2.02f with Emacs-21 (my setup). I thought it might be me, but you have confirmed the existence of a general problem. Thanks! And I also thank you for the pointer to the CVS version--and for the intelligence about Dave Gillespie's newer version. I, too, hope he takes steps to release it to the public.
But my article's emphasis was mostly on straight-ahead numerical evaluation, as that accounts for 95% or more of my typical usage. My setup works quite well for that, and I would advise anybody whose patterns of usage resembles mine not to be put off too much by the issues you quite correctly raise in your letter.
Thanks for the comments.
Charles Hethcoat, author.
Re: Math-Intensive Reports with GNU Emacs and Calc, Part 2
The auther writes:
"The only problem I had with it as a publication tool is that your input file requires #-style comment lines for documentation,
Re: Math-Intensive Reports with GNU Emacs and Calc, Part 2
Hi, everyone. I didn't realize until today that my article was already on-line! I appreciate the nice feedback.
Concerning the syntax of Calc: I repeat, I'm still fairly new to it, but my reading of the manual leads me to believe that it's probably configurable within elisp, but I haven't tried to figure out how. For my purposes, the `=>' is fine. In any event, you certainly can post-process these marks to taste within or without Emacs.
The only thing to keep in mind is whether you may need to re-process the file with Calc later on. (Remember my discussion of design changes?) You don't want to leave your master file damaged with respect to Calc's ability to read and process the formulas.
So if you create a filter to fix up the syntax, try to create the corresponding "unfilter" as well. Better still, create a processing pipeline to first /copy/ your file to another name and work on that one. Now your original remains untouched. When the need arises to update your original, just rerun your pipeline.
Charles Hethcoat
Re: Math-Intensive Reports with GNU Emacs and Calc, Part 2
You're right, Emacs certainly can auto-convert those comments. One would need to use something like:
M-x replace-regexp ^# RET RET
to remove all #s at the starts of words, and then
M-x replace-regexp ^[^$] RET # SPACE RET
to put them back again. (This assumes all lines start either with a Calc $ or a comment #, which may be incorrect - I haven't used Calc myself.)
But the author was referring to Octave, not to Emacs+Calc. He wrote:
"you need to perform some downstream editing with tools like sed or awk. Not at all difficult on UNIX but not easy on Windows, and the additional processing requires more steps than the combination of Emacs+Calc."
So the fact that it needs processing that could be easily done in Emacs may be precisely his point...
calc math syntax constraint
Thanks a lot. Very interesting article.
One question. Is there a way to get free of the calc package syntax constraint? I mean that in my report, i want to use the '=' caracter for assignments as well as for 'evaluates to' operations. For example, I want to see things like:
c = sqrt( a^2 + b^2 ) = 5.14003891036
and NOT:
c := sqrt(a^2 + b^2) => 5.14003891036
Is it possible, or are we stuck with one and only one syntax?
Re: calc math syntax constraint
Ok, done a bit of reading and the following should work
M-x replace-regexp RET:=|=>RET=RET
Do what you need to do to print the file then Ctrl-_ will set things back to how they were .
Hope that's of help
Euan
Re: calc math syntax constraint
BAH! Bloody stripped the backslash!
M-x replace-regexp RET :=BACKSLASH|=>RET=RET
Re: calc math syntax constraint
One possible solution is to run a regex-replace on the document prior to printing. I'm fairly new to Emacs so not too sure of the syntax for regex. In Vi it would look something like this:
1,$ s/=>|:=/=/g
Which tranlates to search the whole file for => or := and replace with =.
Once you've published it you can then hit Ctrl_ to undo the regex.
If anyone's read this and knows how to do it in Emacs regex then please post :-)
Re: calc math syntax constraint
oops, regex missing a backslash. Should read:
1,$ s/=>|:=/=/g
Sorry,
Euan
Re: calc math syntax constraint
OK, for reasons unknown the backlsash gets stripped when I post. Here we go once more:
1,$ s/=>BACKSLASH|:=/=/g
>sigh<
Re: calc math syntax constraint
Not that i know of... This syntax is used as a programming language one, rather than a symbolic one. And, as such, it has been elaborated since the early days of Pascal...