Adding the DOI to the unsrt bibliography style in LaTeX

I wanted to show the DOI of the documents in my bibliography.  The bibliography style files I could find any useful documentation for did not have quite what I wanted.  I wanted the unsrt.bst style with a DOI on the end.  Thanks to this file, I was by slavish imitation able to make this file (http://djg.altervista.org/downloads/unsrtDOI.bst).  It seems to work, amazingly enough.

VGA!

You Need This Book: Serway, Jewett, Wilson and Wilson

I would like to take this opportunity to run some advertising.  A wonderful new Physics textbook was recently published here in Australia.  It is called Physics: Asia-Pacific Edition by Serway, Jewett, Wilson and Wilson (ISBN-10: 0170189309  ISBN-13: 9780170189309).  It is a localised version of the well-known US Physics text Physics for Scientists and Engineers by Serway and Jewett, but it is more than that.  Not only has every single reference to baseball been replaced by a reference to cricket, not only does it drive on the left and spell ‘colour’ with a ‘u’, but it contains a series of case studies by Australian scientists, covering topics like the Australian Synchrotron, how the didjeridu works, and how to shear sheep without straining your back.  I mean, how Australian can you get?

You may scoff and ask: is it really necessary to localise a Physics text?

“Are Newton’s Laws different in the southern hemisphere?” I hear you guffaw, amazed at your own wit.

Well, no.  But science does not take place in a cultural vacuum, despite our best efforts to the contrary.  While we work hard to make sure that the results of an experiment are independent of who is doing it and where, we have students who are doing their degrees with one eye on the job market, and who don’t know where the career might take them and what opportunities they might have.  Science is a deeply human endeavour — it is about humanity collectively increasing its understanding of itself and its environment — and putting a human face on it, and a relevant and local one, is very valuable.  Most students using a first year Physics text will not go on and become Physicists, or professional partisans for science in any capacity.  But it would be good if they walked away with a strong sense of the contribution that Physics makes to people’s lives, on every level from the sheer wonder of cosmology to the incredibly practical — like developing new imaging techniques that can save your life.

That they also walk away knowing some topic content is handy too, I guess.

Oh yes, and I should note for conflict-of-interest reasons: One of the author’s is my wife

Interstellar Fiction

So it is required in the age of interconnectivity that I point out the current issue of Interstellar Fiction. This estimable magazine publishes work of high quality. Clearly what I am saying is that they have recently put out one of my stories, something called ‘Unfinished Projects’. They would appreciate a small contribution, but you can have a read for free, so why not?

The story is meant to be funny, and I think it is. There is one line that made me laugh out loud when I wrote it. Of course, few things are as personal as a sense of humour.

Like most of my stories, it started out as a one page scene that went nowhere for about four years. That is the standard time — I write a scene that seems funny, it peters out, I forget about it, then one day when I am at a loss as to what to write but feel like doing something I go through my files and find the scene and get a hint as to where it might lead. Then I knock out the rest of the story, cut about 15 to 20% off the length of the manuscript and start shopping it around, occasionally with some success.

What can I say, it’s a hobby. I doubt it’ll amount to much but if I amuse myself and a few others then there’s no harm. Some of my funny little stories have shown up in Andromeda Spaceways, which I also recommend if you like a good read and don’t feel like excessive doom and gloom.

I have to say the Interstellar Fiction editorial process was very impressive — thorough and collaborative. I would recommend it to anybody, but most strongly to those looking to submit a story to a magazine…

Anyway, ‘Unfinished Projects’ concerns a Hillman Imp, a broken spacecraft, and string. What can I say? ‘Do yourself a favour.’ If you’re from the US you can ‘Do yourself a favor’ instead, I guess.

vi, LaTeX and amusing myself

So as I have said I use LaTeX to prepare most of my professional documents.  Since I work almost exclusively in a Linux environment — or on a Mac, and Mac OS X is thankfully essentially a variant of UNIX with a GUI — I mostly use an editor called vi (or really vim).

Why?  Because it is there.  It comes with Linux and it isn’t Emacs.

There are many tools to make it into a shell for LaTeX (Vim-LaTeX, LaTeX Box) and I’ve put together what is quite probably the most simple-minded of them possible.  It is the opposite of full-featured.

Basically, I have some extra text in my vi configuration file (this is called .vimrc and it lives in your home directory).  That is very simple


syntax enable
setl tw=72


command L   !latex %
command B   !bib.sh %
command V   !dviv.sh %
command A   !dvia.sh %
command D   !dvips.sh %
command G   !gv.sh %
command M   !maki.sh %
command F   !pdfv.sh %
command I   !spell.sh %
command PP  !ps2pdf.sh %
command PDF !pdflatex %
command W   !wc %
command XF  !xfig &
command T   !dvi2tty.sh %
command WT  !wctty.sh %
command VT  !viewtty.sh %

and all it is is a bunch of extra vi commands, accessed by typing ‘:CMD‘ where CMD is the command (case sensitive).  I assume that I have started vi with a command like

$vi filename.tex

where the $ is the command line prompt.  Some of the commands are just that — commands.  Like run LaTeX on the file, or run pdfLaTeX on it.  Most call a tiny shell script.  It does not have to be done this way, but I have my reasons — the main one being that there is a second editor I also use when the mood takes me (TDE), and it can be configured to call the same bunch of shell scripts. In fact, they were first written for it.

The shell scripts are available at http://djg.altervista.org/downloads/latex_vi_scripts.zip, and you just stick them somewhere in your path.  Apart from LaTeX and its various ancillaries, the programs I call include:

  • evince (this can be replaced with the name of your favourite pdf viewer.  evince is good because if you update the pdf file, it will reload automatically).
  • gv (this can be replaced with the name of your favourite postscript viewer, including).
  • dvi2tty (this renders a dvi file (LaTeX output) as plain text.  Notionally this lets you review your work on a text terminal.  I suspect this rarely happens these days, but I quite like it, plus it is a good way to see how many words your article is in length — run dvi2tty and pipe into wc (word counter).  It would be possible to run pdflatex and then pdftotext and do something similar).
  • xfig (I use this all the time to annotate figures then export them to LaTeX-friendly formats).
  • ispell (this is just a spell checker.  I have it create a custom dictionary associated with the document, called say filename.tex.dic, so that once you have inserted all the character combinations particular to your file into it, it won’t ask you about them again.  This is very useful with scientific documents where you might have a chemical formula or something that a spell checker would pick up every time, and you don’t want to clutter up your global dictionary with cruft that is specific to a single project).
  • advi (an alternative dvi viewer to xdvi).

Apart from that, it calls a bunch of standard stuff like dvips, xdvi, wc, basename, view, bibtex, makeindex and so on, all of which would either be part of your Linux core system or your LaTeX core system.  It is also pretty damned obvious how to add in new commands if you want them.

I know this is all pretty simple-minded, but I am putting it up here for two reasons.  One, it means I can get at it and ‘install’ it on any machine I am using and, two, someone might find some value in it; why not?

So the clear usage instructions:

(1) Add the stuff in ‘.vimrc‘ to your own ‘.vimrc‘ file.

(2) Unpack the archive of small shell scripts into some directory in your path (they are shown in a badly formatted list at the end of this post, as well).

(3) Make sure the small number of tools this uses are installed.

(4) Add any new commands you want.

(5) Run vi as normal.

If you get any benefit from it. let me know.  If you make a better version, let me know.  If you think it is a waste of time, you are probably right but you don’t need to tell me.


The scripts and what they do:


————–
bib.sh
————–
#!/bin/bash
NM=`basename $1 .tex`
bibtex $NM
————–
dvi2tty.sh
————–
#!/bin/bash
NM=`basename $1 .tex`.tty
IM=`basename $1 .tex`.dvi
dvi2tty -w132 $IM > $NM
————–
dvia.sh
————–
#!/bin/bash
NM=`basename $1 .tex`.dvi
advi $NM &
————–
dvips.sh
————–
#!/bin/bash
NM=`basename $1 .tex`
dvips $NM
————–
dviv.sh
————–
#!/bin/bash
NM=`basename $1 .tex`
xdvi $NM &
————–
gv.sh
————–
#!/bin/bash
NM=`basename $1 .tex`.ps
gv $NM &
————–
maki.sh
————–
#!/bin/bash
NM=`basename $1 .tex`
makeindex $NM
————–
pdfv.sh
————–
#!/bin/bash
NM=`basename $1 .tex`.pdf
evince $NM &
#xpdf $NM &
————–
ps2pdf.sh
————–
#!/bin/bash
NM=`basename $1 .tex`.ps
ps2pdf $NM
————–
spell.sh
————–
#!/bin/bash
echo $1
echo $1.dic
touch $1.dic
echo “ispell -t -p $1.dic $1”
ispell -t -p $1.dic $1
————–
viewtty.sh
————–
#!/bin/bash
NM=`basename $1 .tex`.tty
IM=`basename $1 .tex`.dvi
dvi2tty -w132 $IM > $NM
echo Created $NM, piping into view
sleep 2s
view $NM
————–
wc.sh
————–
#!/bin/bash
wc $1
sleep 5s
————–
wctty.sh
————–
#!/bin/bash
NM=`basename $1 .tex`.tty
IM=`basename $1 .tex`.dvi
dvi2tty -w132 $IM | wc
sleep 5s

bib.sh run bibtex
dvi2tty.sh convert dvi file to text
dvia.sh view dvi file in advi
dvips.sh convert dvi file to postscript
dviv.sh view dvi file in xdvi
gv.sh view postscript file in gv
maki.sh run makeindex
pdfv.sh view pdf file (in evince in this case)
pdfv.sh view pdf file (in evince in this case)
ps2pdf.sh convert postscript to pdf
spell.sh run ispell on .tex file
viewtty.sh convert dvi to tty (text file) and view in view
wc.sh word count .tex file
wctty.sh word count the textified .dvi file

Magnetic structure and glassiness in…

So, the latest paper to come out is ‘Magnetic structure and glassiness in Fe0.5Ni0.5PS3‘, in Journal of Magnetism and Magnetic Materials 334 (2013) 82–86 (http://dx.doi.org/10.1016/j.jmmm.2013.01.023).

The science is I think interesting.  We find that by mixing Ni and Fe on the metal site we induce a time-dependence in the magnetic behaviour. That is to say that the system likes to order antiferromagnetically, with the magnetic moments on the metal sites cancelling each other out, but that this ordering is quite slow. It takes hours for the magnetic moments to reach their final arrangement.

This shows up in the magnetic susceptibility in the way that the susceptibility — how strongly the material reacts to an applied magnetic field, basically — depends on whether you are warming the sample up or cooling it down.  The picture below shows that — as we heat up the cusp in the (admittedly noisy) data comes in at about 140K, but on cooling it comes in at about 90K.  So as we cool down from the paramagnetic high temperature state, the system remains paramagnetic till 90K, where if we heat up from the low temperature magnetically ordered state, the system stays ordered up to 140K.  If we are cooling and we get to, say, 100K then stop cooling and just measure as a function of time, we get a nice stretched exponential decay of the magnetisation until it reaches the value it would have on the lower curve.  that is, it follows the red line, and take about three hours to get there.  That means that the lower curve — what we measure on heating — is measuring the true equilibrium state.

Magnetic susceptibility
Magnetic susceptibility of Fe0.5Ni0.5PS3 as a function of temperature.

One of the other nice things about this paper is that two of the authors — S. Brazier-Hollins and D.R. James — were project students rather than full academics or Ph.D. scholars. Their work on the project was enthusiastic and of high quality, and it was really nice to pull a range of disparate contributions together and see it in print.

www.writelatex.com

Note that this service is now known as overleaf.


I have to admit; I’m partisan. I think LaTeX is so much better than a word processor it isn’t funny. I avoid publishing in journals that won’t take a LaTeX document, I write minor documents and notes-to-self using it. I’ve even written fiction in LaTeX, for some reason that I can’t fathom. I mean, fiction is one thing that LaTeX is no good at. Manuscript format — double spaced, fixed-width font, underlines instead of italics — is practical but ugly. LaTeX is impractical but pretty… hang on, that’s not quite what I meant. What it does is lay your document out for you in a way that (mostly) conforms to the rules of good typesetting and page design.

LaTeX (www.ctan.org) is built on top of TeX by Donald Knuth (http://www-cs-faculty.stanford.edu/~uno/), author of The Art of Computer Programming.

These days, it is a whole ecosystem for handling anything from a bit of verse to a multivolume illustrated opus. But it can be daunting for a new user (I cordially dislike the term ‘newbie’). I’m not going to write an introduction to it, but I am going to point at writelatex.com as somewhere that is worth a visit.

It’s LaTeX for the cloudage. Runs in your browser. You can set up a URL and distribute it to collaborators or create a login and use it like googledocs (or whatever it’s called). It’s under intensive development at the moment, so it’s not finished, but if you’ve ever wondered what LaTeX is all about, but don’t feel like installing the bloated monster that is TeXLive (my only real criticism — does a LaTeX install really need to occupy all those GB?) then you can just go there and start monkeying around. If you really have no idea what you want to do, I would point you at http://www.tex.ac.uk/tex-archive/info/latex4wp/latex4wp.pdf (LaTeX for word processor users) and http://tobi.oetiker.ch/lshort/lshort.pdf (The Not So Short Introduction to LATEX2ε).

And then you can get started. Or not.  Whatever.