Archive for the ‘biblatex’ Category
biblatex-chem updates
Recent changes to biblatex (in v1.6) mean that the biblatex-chem bundle is currently broken. I’ve not released a quick-fix as there are some long-standing issues to address in biblatex-chem. When I initially wrote the code, I started from scratch and defined only what I wanted. That works, but means that any changes in biblatex are not automatically picked up. From biblatex-ieee, I took the alternative approach and worked from the standard biblatex styles to what was needed. That’s a better long-term approach, so it’s the one I’m now bringing to biblatex-chem. It will take a little while, so user might want to keep an eye on the development code.
Physical science styles for biblatex: improvements underway
As regular readers will know, I’m a big fan of the biblatex approach to producing bibliographies, particularly now that we have Biber ‘on tap’. There was a question on the {TeX} site a while ago about an IEEE style, and so I wrote the biblatex-ieee style as a partial answer. Doing that, I realised that my other biblatex styles need a bit of work. I’ve now revised both biblatex-nature and biblatex-science to make them more flexible, and also to improve their documentation. Next on the list is the biblatex-chem bundle: there are four styles in it, so it will take a little while. Once all of that is done, then I will take a look at the requirements for physics, which I’m going to call biblatex-phys.
Biber now in TeX Live 2010
Many readers will be familiar with the Biber program, a replacement for BibTeX which works with the biblatex package. Binaries for common platforms have been available from TLcontrib for a while, but have now been added to the main TeX Live 2010 system. So you can install Biber on the ‘common’ platforms using the TeX Live Manager (or tlmgr from the command line). Yet another reason to move on from BibTeX and switch to biblatex, if you’ve not already!
biblatex v1.1: dynamic reference sets
The latest version of biblatex, v1.1, appeared on CTAN yesterday. This is a feature release, not just bug fixes, and so there are lots of new things there. At the same time, Biber has been updated to v0.7. If you use TeX Live 2010, you’ll be able to get the new biblatex using tlmgr in a day or so, and can get the Biber update via TLcontrib already.
Many of the new features rely on Biber, and will not work with BibTeX. As Biber has lots of advantages anyway, including UTF-8 support and active development, this is no real hindrance.
I want to focus here on one new feature, as it’s one I requested. In chemistry and physics we tend numerical reference styles and to have lots of references. Often, several of these will be related, and so can be ‘compacted’ into a single number. With traditional BibTeX styles, this can be done using the mciteplus package and a suitable .bst file. biblatex has supported this using ‘reference sets’ for some time, but up to now this has required modification of the database entries. In v1.1, you can define a reference set in the preamble:
\defbibentryset{set1}{key1,key2,key3}
and then cite the set in the document. There is also support for mciteplus-like syntax, but I think it’s probably best to use the native biblatex approach here.
Compressing multiple citations in a dynamic way was really the only problem I had with using biblatex for all of my citations. Now that this is sorted, I’ll be sticking to biblatex all of the time, and I’d urge other physical scientists to do the same: biblatex is a much more flexible approach than the traditional BibTeX citation system.
biblatex reaches version 1.0
Reading through some TeX-related material today, I spotted that the very popular biblatex package has finally reached version 1. Accompanying this release is a version step for the biber BibTeX-replacement program, which reaches version 0.6. Both are now considered non-beta, and the biblatex release in particular is a big story to me. I’ll be checking on my own biblatex-related packages over the weekend and making sure that they are working with the new release, and if all goes well will move them to v1.0 as well.
A quick look through the documentation for both biblatex and biber shows that the new versions are mainly about stability. There are not a lot of changes listed from the previous testing releases: they’ve proved to be pretty stable and so the time for an official move to release status has obviously arrived.
biber without building from TLContrib
I’ve written in the past about the biber program, a replacement for BibTeX when using the biblatex system for citations in LaTeX. The biggest stumbling block to using biber to date has been the need to build it from the source. On Windows, that also means getting a working Perl installation, which is a non-standard item on that operating system. However, there is now an alternative approach, at least for people using TeX Live 2010. The new TLContrib system for additions to TeX Live now includes a biber package for Windows, Mac OS X (64 bit) and Linux.
To get biber installed, you’ll need to use the Command Prompt or Terminal. On Windows, you probably need to run the Command Prompt as the Administrator, while on the Mac or Linux you will probably want to sudo the following. To get biber installed, all you need to type is
tlmgr --repository http://tlcontrib.metatex.org/2010 install biber
The system will then get on with installing biber, which you can then use as a replacement for BibTeX. I’d then add biber to my graphical editor’s list of programs to make it easy to use: the detail of course depends on which editor you use.
What is particularly interesting here is that it has been possible to build a stand-alone biber. This should mean that at some stage both TeX Live and MiKTeX can integer ate it directly. This will really make biber a viable choice for most people using biblatex: building from the source is not most people’s idea of ‘easy to use’!
biblatex: numbered citations as footnotes
Most chemistry journals use numbered citation styles, with all of the references appearing at the end of the article in a References section. However, there are some that place the references at the bottom of the page they occur on, as footnotes. This is a bit more awkward to achieve than a simple section, but as biblatex has all of the citation data available from the start of a document I thought it should be easy to do.
It turns out that biblatex has the very handy \footfullcite macro, which nearly does what is needed. This macro will print the reference as a footnote, but uses LaTeX’s footnote numbering system to do this. The result is that repeating citations, compressing several citations into a range and so on is not so easy. In the end, I decided to drop Philipp Lehman (the author of biblatex) an e-mail for some guidance. He came back with two approaches, one for citations in the text and one for superscript citations:
\documentclass{article}
\usepackage[style=numeric-comp]{biblatex}
\bibliography{biblatex-examples}
\makeatletter
\ExecuteBibliographyOptions{citetracker,sorting=none}
\DeclareCiteCommand{\notefullcite}[\mkbibbrackets]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{notefullcite}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}%
\usebibmacro{postnote}}
\newbibmacro*{notefullcite}{%
\ifciteseen
{}
{\footnotetext[\thefield{labelnumber}]{%
\usedriver{}{\thefield{entrytype}}.}}}
\DeclareCiteCommand{\superfullcite}[\cbx@superscript]%
{\usebibmacro{cite:init}%
\let\multicitedelim=\supercitedelim
\iffieldundef{prenote}
{}
{\BibliographyWarning{Ignoring prenote argument}}%
\iffieldundef{postnote}
{}
{\BibliographyWarning{Ignoring postnote argument}}}
{\usebibmacro{citeindex}%
\usebibmacro{superfullcite}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}}
\newbibmacro*{superfullcite}{%
\ifciteseen
{}
{\xappto\cbx@citehook{%
\noexpand\footnotetext[\thefield{labelnumber}]{%
\fullcite{\thefield{entrykey}}.}}}}
\newrobustcmd{\cbx@superscript}[1]{%
\mkbibsuperscript{#1}%
\cbx@citehook
\global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty
\makeatother
\begin{document}
Some filler text \notefullcite{cotton}, then some more text
\notefullcite{hammond}. Perhaps some more text and the same
citation again \notefullcite{hammond}. Yet another one
\notefullcite{knuth:ct:a}. Now all again
\notefullcite{cotton,hammond,knuth:ct:a}.
Some filler text,\superfullcite{augustine} then some more
text.\superfullcite{companion} Perhaps some more text and the
same citation again.\superfullcite{companion} Yet another
one.\superfullcite{kastenholz} Now all
again.\superfullcite{augustine,companion,kastenholz}
\end{document}
I might add this to my biblatex styles, but I’ll wait to see if Philipp puts the code or some notes into the biblatex core before I do. I should also point out that if you want footnote citations and other footnotes then you’ll need something like the bigfoot package to do the job. But this is a pretty good place to start from.
Building biblatex-biber (again)
I recently posted some information on building biblatex-biber. Since then, v0.5 of biblatex-biber has appeared and there are some positive changes. The code now creates its own file to grab the required Perl modules. So on Mac OS X (Snow Leopard) and Ubuntu (9.10) all I needed to do after downloading the source was
perl Build.PL sudo ./Build installdeps ./Build ./Build test sudo ./Build install
at the Terminal. The second step grabbed all of the modules needed and everything worked fine.
On Windows, life is still a bit complicated but I now can get things to work. A bit of a trawl on the Internet led to a blog post about Text::BibTeX. At the moment, the solution is still in beta and so there is a bit of work to do. With Strawberry Perl installed I went to the Command Prompt (as Administrator) and started the cpan program. At its prompt I did
install Config::AutoConf Capture::Tiny IPC::Run install A/AM/AMBS/Text/Text-BibTeX-0.40_3.tar.gz
which all seemed to work. After downloading and unzipping the source for biblatex-biber (which is in .gz format, so use something like 7-Zip to open it), still as Administrator at the Command Prompt I did
perl build.pl build installdeps build build test build install
and everything worked. So I’ve finally got it working across all platforms. Hopefully the Text::BibTeX install will become easier when it moves from beta status.
biblatex reaches v0.9
A couple of days ago biblatex v0.9 appeared on CTAN. As usual, there is a long list of changes, bug fixes and so on. The restrictions on inclusion in TeX distributions have been lifted, and so it’s already available in TeX Live. At the same time, biblatex-biber has been uploaded to CTAN, so hopefully ready to use versions will be added to the distributions at some point (MikTeX is likely to be first, I suspect).
I’ve just uploaded an updated version of biblatex-chem to CTAN, to keep in sync with the changes in biblatex. I’ll try to get biblatex-nature and biblatex-science done in soon (today) so that everything is working.
Building biblatex-biber
The biblatex-biber project provides probably the best way for biblatex users to switch to pure UTF-8 bibliography information. However, getting it to build can cause problems: biblatex-biber is a Perl programme, and needs various downloads from CPAN. I thought it would therefore be useful to put some simple recipes here, explaining what I’ve done to get a working biblatex-biber on Windows, Ubuntu and Mac OS X. I’m assuming that the latest biblatex-biber release has been downloaded and unzipped somewhere, and that the Command Prompt/Terminal/Shell is open in that directory (folder).
Mac OS X 10.6 (Snow Leopard)
Mac OS X comes with Perl installed, so life is relatively easy. At the Terminal, you need to run the cpan script as root:
sudo cpan
The cpan script has its own prompt, but this is very similar to the Terminal one. First, I updated cpan itself and installed a helper module with
install CPAN reload cpan install YAML
That done, the various requirements for biblatex-biber can be installed, using the single call
install Data::Dump List::AllUtils Readonly Text::BibTeX Readonly::XS
For the more cautious person (such as me), each install instruction can be given on a separate line: this keeps things a bit more controlled. I accepted the standard settings, except when asked about installing items that were only needed for testing, where I said no.
Once cpan has done all of the installing, you can leave it by typing
exit
So now back at the Terminal prompt, a few simple instructions
perl Build.PL ./Build sudo ./Build install
That put biblatex-biber onto the path for all users: everything then worked correctly.
Ubuntu 9.10
Once again, Perl is installed as standard in Linux distributions: I’m using Ubuntu as a representative system. Before starting cpan, there is an additional step, which is to install an extra Ubuntu package. So at the Terminal, you need to do
sudo apt-get install libxml2-dev
This is needed as otherwise you get some very odd errors in a bit. Now, essentially the same recipe works as for the Mac. First run cpan running and update and install YAML. Then there is a long list of items to install
install Data::Dump List::AllUtils Readonly Text::BibTeX Readonly::XS XML::Writer XML::LibXML File::Slurp
which can again be done one at a time, for the more cautious.
After exiting cpan, the same three lines at the Terminal should work as in the Mac section.
perl Build.PL ./Build sudo ./Build install
Windows (XP, Vista and 7)
To date, my attempts to build biblatex-biber on Windows (using Strawberry Perl) have failed as I can’t get the Perl module Text::BibTeX to install. This is supposed to be optional, but without it biblatex-biber does not seem to work, although I do get it to build. Luckily, there is a self-contained binary for Windows available from the project site. This includes its own Perl system, so there is no need to get Perl set up before trying it. Everything seems to work for me with this version. Any ideas on what is necessary would be helpful!