Installing achemso and siunitx

A question that comes up from time to time is how to install one or other of my packages, usually either achemso or siunitx. While both are essentially standard LaTeX packages (no weird files or binaries needed), there are still soem stumbling blocks that cause issues. So I thought a few notes by be useful here.

Installing as part of an up to date TeX system

By far the easiest way to install my LaTeX packages is to get them as part an up to date TeX system. Both MikTeX 2.9 and TeX Live 2010 include all of my general packages. MiKTeX is of course Windows-only, but TeX Live can be installed on Windows, Mac OS X and Linux. After installation, doing an on-line update should grab all of the latest packages from CTAN. Both MiKTeX and TeX Live include graphical update programs, so this is not such a difficult process nowadays.

Mac users may well prefer MacTeX over plain TeX Live, but MacTeX is built on top of TeX Live and so the same ideas apply. You can install either TeX Live or MacTeX and get the same basic functionality.

For Linux users, it’s worth noting that popular Linux distributions tend to include old versions of TeX Live (or even teTeX), rather than TeX Live 2010. So if you want an up-to-date TeX system you’ll be better off ignoring your Linux package manager and grabbing TeX Live directly.

One thing to do if you update your TeX system is to check any locally-installed files you might have (see the next section for more about local installation). These will be in ~/texmf on Linux, ~/Library/texmf on a Mac and (probably) %USERPROFILE%\texmf on Windows. One problem I see from time to time is that users of achemso have installed some of the BibTeX styles locally, then update the main package and all sorts of things go wrong. So do check carefully on any local files: they might be outdated by a new TeX system.

Installing using the TDS zip files

The method above is fine if you are happy installing an entirely new TeX system, but if all you need is access to one of my packages then it is probably over-kill. For these users, I provide ready-to-install zip files on CTAN. For achemso, you need achemso.tds.zip, while for siunitx users you probably need

The idea with these files is that I have set them up with documentation, ready to use LaTeX styles and all of the support files. All that needs to happen with them is to unzip them inside your local TeX directory and tell TeX about them.

Where the files should go depends a little on your operating system. The local directory (folder) is usually ~/texmf on Linux, ~/Library/texmf on a Mac and (probably) %USERPROFILE%\texmf on Windows. Here, ~ and %USERPROFILE% represent your home directory (folder). So on my Windows 7 PC, I have a folder

C:\Users\joseph\texmf

while on my Mac there is one at

/Users/joseph/Library/texmf

Whichever system you use, copy the appropriate zip files there and unzip. The result should be a structure which looks like

texmf/tex/latex/achemso/achemso.sty
...
texmf/tex/latex/siunitx/siunitx.sty

and so on. Of course, the exact structure will depend on which packages you install! What is important for installing siunitx is to also install expl3 and xpackages. If the versions do not match then trouble will not be far away.

To tell TeX about the new files, you need to run the program texhash. There is a graphical interface for this in both MiKTeX (Update File Name Database) and TeX Live. I find it easiest just to start a Command Prompt/Terminal and type

texhash

[For users with recent versions of TeX Live (2009 and 2010, I think), running texhash is actually not needed. However, it will not do any harm so you may as well run it.)

Installing from the dtx file

The traditional method to install a package is to unpack it from the dtx source. I’ve got to say that I only recommend this for experienced LaTeX users. While both achemso and siunitx are designed to be easy to unpack, life is more complex for expl3 and xpackages. So I’d strongly recommed using the TDS zip files unless you know a bit more about LaTeX!

achemso: Cross-referencing to floats

I’ve had a a few questions about the achemso bundle concerning creating references such as “Figures 1 to 3” automatically. The problem has been that I’ve been using the varioref package to turn \ref{some-fig} in “Figure 1” automatically, rather than having to put Figure~\ref{some-fig}. Unfortunately, varioref does not handle multiple references in an automated fashion.

For version 3.4 of achemso (which I’ve just sent to CTAN), I’ve switched to the cleveref package. This means that you can now write something like \ref{fig-1,fig-2,fig-3} and get “Figures 1 to 3” without further effort. I hope that this makes life much easier for users, although it does mean that there is another package required to use achemso. I think that this is the right balance: I’m sure users will let me know if I’ve got it wrong.

achemso installation

One question that crops up from time to time is “How do I install achemso?” For most people, I tend to point out that the latest MiKTeX and TeX Live distributions include both achemso and everything it needs to work. So on a stand-alone system, installing an up-to-date distribution is the easiest way.

Manually installing achemso itself is not too hard, the main problem being that people miss out the BibTeX files (achemso.bst and biochem.bst), then get odd effects with bibliographies. On CTAN, the file achemso.tds.zip contains everything laid out ready for installation, and that includes the BibTeX files. So my advice for those who can’t or don’t want to do a full update is to use the TDS zip. For those who want to extract from the source and do everything themselves, as I say the main thing is not to forget the BibTeX styles.

One problem that comes up is the need for a reasonably recent copy of xkeyval. If I was writing the code again from scratch, I probably would not use xkeyval, but that is not the situation. I’ve worked quite hard to reduce the problems, and the latest version of achemso uses only the most basic functions in xkyeval. One of the reasons that life is a bit complex is because xkeyval requires installation of items in both tex/generic/xkeyval and tex/latex/xkeyval: not ideal. At the moment, there is no TDS zip on CTAN for xkeyval, but I’m always happy to send anyone who needs one a suitable zip by e-mail.

achemso and rsc: empty first entry in bibliography

I’ve had a few e-mails recently from users of my achemso and rsc packages, complaining that they get an empty first entry in the bibliography. Some of the users have noticed that it seems to be linked to the special control citation that both packages use. However, this is not a bug in either bundle, but is because the users have done a self-install of the packages.

In both cases, the LaTeX packages are designed to work with matching BibTeX styles. What tends to happen is people install the LaTeX stuff manually, but forget the BibTeX part. So the wrong .bst files get used by BibTeX, and odd results are seen. So my advice is, if you update anything by hand, make sure you install all of the update and not just some of it!

Supporting ACS submissions

My achemso package has evolved over time to work quite well for submitting papers to the American Chemical Society (ACS). However, I still get feedback about issues with the submission system. A lot of this comes from the fact that I write the package without any direct input from the ACS. So any issues tend to be brought up by users. The ACS publish around 30 journals, each with its own rules, and I have to work out what each one wants! Not an easy task: I’ve submitted to a couple, and never as the lead author. It’s a challenge, but I hope that I’m doing more good than harm.

achemso updated to version 3.2

I’ve just uploaded version 3.2 of achemso to CTAN, and also sent it off the the American Chemical Society. The development for v3.2 has mainly been about making using the package easier for end users. I’ve removed a lot of dependency on other support packages, so that it only uses very standard LaTeX packages (things like float and caption). I’ve also made the package cope better with older versions of xkeyval, by using only a subset of the functions provided there. There are a few bug fixes as well, plus a new environment for graphic TOC entries. Hopefully, this makes life easier for manuscript authors.

Section numbers in achemso

When I wrote the achemso class for submissions to American Chemical Society journals, I did my best to get the style of each journal correct. Of course, this is not easy as there are a lot of journals and they are not necessarily consistent in applying the style rules! One issue that comes up a lot is section numbering. Most of the journals do not number sections, most of the time. However, sometimes authors want to include section numbers. I need to look at this again for version 3.2, but in version 3.1 you need to do:

\makeatletter
\acs@restsecnums
\makeatother

somewhere in the preamble to restore numbering.

achemso v3.1

My achemso package (for submissions to the American Chemical Society) has been updated to v3.1. This brings two main developments. First, JACS Communications now automatically format in the journal style. This was asked for by the editorial office, and hopefully shows the approximate page requirement. Second, I’ve completely revised author affiliations. The original system was much too inflexible (just one main affiliation per author), and I’ve had a lot of questions about this. The new system gives you three macros:

  • \affiliation
  • \altaffiliation
  • \alsoaffiliation

The last one is new, and should enable pretty much any combination of different addresses.