Showing posts with label metapost. Show all posts
Showing posts with label metapost. Show all posts

23 August 2013

499. Briefly: Drawing NMR sequences using metapost and Mark White's

Since it's Friday afternoon and I'm not likely to get anything useful done in the hour that remains before going home, I might as well put up another post.

Since posting I've had a look at this:

And that actually is (almost -- let's not get carried away here) exactly what I have been looking for. The main issue was that it's meant for metapost -- or rather, the main issue was my unfamiliarity with metapost. Anyway, my life is know complete.

So here's how to get started...

First 'install' the metapost script:
sudo apt-get install texlive-metapost
mkdir ~/texmf/metapost
cd ~/texmf/metapost -p
sudo texhash

Next, time to test-drive it
mkdir ~/tmp/pulse_test -p
cd ~/tmp/pulse_test
input beginfig(0); initf; startline(rf,"RF"); xline(1); xpulse(0.5,0.5,"90"); ospan(-0.25,-1.0,1.5,"d1"); xline(0.75); xpulse(1.0,0.5,"180"); ospan(-0.5,-1.0,1.5,"d1"); xline(1.0); ospan(0,-1.0,1.5,"vd"); xline(1.5); xacq(2); endfig;
mpost mptopdf test.0 pdftops -eps test-0.pdf test-0.eps

Now, I somehow suspect you can embed metapost scripts directly in .tex documents, but from my brief testing I haven't quite managed to make it work.