Mathmode
’I had an e-mail recently pointing out that I don’t say much about TeX’s mathmode in my blog. I guess that this is mainly because as a chemist I don’t do anything particularly advanced. So things like
\begin{document}
\usepackage{fixltx2e} % \( and \) are not robust otherwise
\begin{document}
\( y = mx + c \)
\end{document}
are really as complex as I ever need to go!
Of course, occasionally I need to look something more complex up. I think like most people I tend to reach for the excellent Math Mode by Herbert Voß. The basic advice I tend to remember is to load the amsmath package, as it does ‘lots of clever stuff’!
Places for questions (again)
I posted recently about a new site being set up for TeX questions: tex.stackexchange.com. This is developing nicely, I think, and there is already a good set of questions and answers. The aim of the site is to be something that mixes the best of forums, wikis and so on, with the key idea being that the quality and relevance of both questions and answers is rated by the community. This is a bit different to more traditional support routes, such as comp.text.tex, but does have its advantages. For example, if you’re a new user you get a sense of which answers are worth reading and hopefully why. I should add that I’ve volunteered as a moderator, at least for the beta phase of the site!
Of course, this is not the only place to go for support. For LaTeX users, forums such as The LaTeX Community or GoLaTeX (in German) are an increasingly popular destinations. In my inbox recently I had an e-mail from another potential support site, Equalis. This is a maths-focused community, with a set of forums including one for LaTeX. I’m all for there being a variety of places to look for help, and I’m very excited that there is the interest in these new TeX-related sites. Will Equalis get the following it needs to be a success? I’m not sure, but the only way for it to have a chance is for people to take a look!
A new place for TeX questions
Some readers will have come across the popular Stack Overflow, a site for asking programmers questions. For those who haven’t, it’s based on the idea that users can give feedback on answers to questions, and that this leads to ‘reputation’ for contributors. So the idea is that good questions are easy to find, hopefully with reasons why they are good answers.
TeX and LaTeX questions pop up there from time to time, some of which are programming-related and others which don’t fit quite so well. The Stack Overflow people are keen to expand, and so there has been a move to set up a TeX-related spin-off. This has been in ‘private beta’ for a week, which means that people who were interested have been setting up some questions and answers to get the site working. It’s now moved to ‘public beta’, so anyone can register and ask (or answer) questions: tex.stackexchange.com.
What happens next depends on take-up from the wider world. If the site proves to be popular then the Stack Overflow people will look to set up a ‘production’ version, which will need a domain name of its own, design and the like. So if you like the idea, get involved during the beta phase and help make things a success. As you might guess, I’m answering the questions that I can. Don’t worry, though, as I’m not going to abandon any other outlets. I’m very much in favour of there being a variety of places to go for help.
Update
There seems to be a slight delay in getting the public beta going: the information says ‘soon’! I guess it may be a day or so while the Stack Overflow people make decisions on moving to public beta status.
Update 2
I’ve just received an e-mail saying that things should now be open to the public.
An example student report
Not exactly a TeX topic directly, but done in LaTeX so I think it counts. At work recently we’ve been discussing providing our final year students with a model report. The problem is where to get one: if you take a real report, then this may help other students for the same group. So I’ve taken some work from a few years ago (in the group of Andreas Danopoulos) and used some of it to write a model report. As the general structure might be useful to other people, you can take a look at the PDF or download the sources here. As the report is quite short I’ve used the article class with some modifications: for a longer one I’d have gone with the report class. There are a few chemistry-specific things going on in the file, but most of it is quite simple LaTeX stuff.
Tracking chemical compounds with chemcompounds
As a chemist, one of the things I want to do is track compound numbers (which are normally given as bold numbers, 1, 2, etc.). The traditional way to do that is by hand, which works but does require some concentration. Recent versions of ChemDraw have included an add-in for Word to do things automatically, and of course there is LaTeX support for the same idea.
In LaTeX there is a choice between two packages for tracking what is what. First, there is the bpchem package. It provides for the idea of subdivisions, so you can have 1a, 1b, 1c and so forth. However, I find the interface in bpchem is a bit awkward. The alternative is the chemcompounds package. It has a very easy to use approach to tracking, but does not have built-in support for subdivisions. So I’ve been working on how to achieve this easily in some stuff I’m writing at the moment. It turns out to be quite easy when you think about it.
The first stage is of course to load the package.
\usepackage[noimplicit]{chemcompounds}
I’ve decided to go with the option to turn off automatically creating new compound references, which means I have to declare each one separately. This requires a block of declarations in the preamble, but I actually find this easier than doing things ad hoc. The subdivisions I want are all about R groups (chemists will understand!). So I’ve started by setting up some simple R group letters (I have a family of compounds, and so it makes sense to use the same letter for the same R group in each case):
\declarecompound[a]{Mes}
\declarecompound[b]{iPr}
Hopefully you can see how this works: the optional argument sets up the label that will print, and the mandatory one is the label I’ll use to refer to the compound.
Then I need to set up the general compounds (the ones that will be 1, 2 and so on). I can let chemcompounds do the numbering, so this is easy:
\declarecompound{imidazole}
\declarecompound{pincer:salt}
\declarecompound{pincer:carbene}
The last stage in the preamble is to create the subdivided compounds. Rather than have to track the numbers and letter myself, I’ve found that I can simply refer back to the existing labels:
\declarecompound[\compound{imidazole}\compound{Mes}]
{imidazole:Mes}
\declarecompound[\compound{imidazole}\compound{iPr}]
{imidazole:iPr}
\declarecompound[\compound{pincer:salt}\compound{Mes}]
{pincer:salt:Mes}
\declarecompound[\compound{pincer:salt}\compound{iPr}]
{pincer:salt:iPr}
\declarecompound[\compound{pincer:carbene}\compound{Mes}]
{pincer:carbene:Mes}
\declarecompound[\compound{pincer:carbene}\compound{iPr}]
{pincer:carbene:iPr}
In the document body, things are now very easy. I just use the \compound macro. So for the general case I’ll have
\compound{imidazole}
(printing say 4) whereas for a single case I might have
\compound{imidazole:Mes}
(printing say 4a). This keeps my source easy to follow (I don’t have to remember numbers and letters, only labels), and avoids mistakes on my part.
Finding inspiration
Writing this blog requires a surprising amount of effort. I’m lucky that as I focus on development quite a bit things turn up for me to write about. Even so, finding new topics and actually writing about them is not a trivial process. It’s amazing how long even a short note can take to get down into a form that makes sense.
Reading the latest issue of The PracTeX Journal I was reminded of this by the column by Dave Walden. He’d written a column there, Travels in TeX Land, since the journal came into being five years ago. Dave has found many different things to say, looking at different things that he’s done using TeX. Each entry is different, and I think all of them are enlightening. The latest Travel in TeX Land is also the last
This will be my final TeX Land column in this journal. I am pleased to have provided a column for every previous issue, but it is now time for me to focus on other things.
However, it looks like inspiration is not the issue, as we are also assured that there will be continued TeX-related writings available from http://www.walden-family.com/public/texland/. I do hope that new insights continue to appear there.
Speaking of inspiration, if there is anything you think I should talk about here I’m always happy to get feedback. I do look round for potentially-interesting things to include, but the odd one does slip past.
TeX Live 2010 freeze
Karl Berry has announced on the TeX Live mailing list that TeX Live 2010 is now frozen, to allow a move to release status. So what has made it into the development version to date will be more or less what gets released onto DVD. Once things are done for release then the package updates will resume, allowing on-line updating. The timetable seems to be that DVDs will appear in September, but of course this will depend on the people actually making them.
Demand for LaTeX training
As part of my activities with the UK TeX Users’ Group, I’m helping to set up and run a LaTeX training course at the end of the month. Unlike other courses I’ve seen in the UK, we are running this one as ‘open to all’ for a pretty nominal fee. What’s surprised me is that it has proved to be very popular indeed. We had 25 places, and they were all used up some time ago. My list of people who are interested in another similar course has now reached 29 names, which probably means that we can fill a second course without any more effort at all! I hope that we’ll be able to do a second course at some stage in the autumn: as you might imagine the problem is availability of time for people to actually do it. Of course, I’m happy to hear about anyone else interested in registering, as I’ll add them to the list for the second course and any others that end up being run. New LaTeX users are a good thing, and so I’m keen to train as many people as show an interest.
Typesetting for portable devices
One of the talks at TUG 2010 was about typesetting for the iPad. Anyone following the general area of working with portable devices (iPad, Kindle, iPhone, etc.) will have picked up why this is interesting. The new book-like electronic devices are posing a lot of questions for those of us interested in typography. The problem is that the screens that these systems have aren’t really suited for the fixed approach that PDF provides. The current solutions go with something more flexible, but as a result miss out on the layout quality that TeX-based solutions can provide.
In the talk, the approach shown off was going very much for a device-dependent approach, and creating pre-defined bitmaps for both landscape and portrait viewing on the iPad screen. There is some good discussion after the presentation about alternative approaches, such as doing the typesetting on the device, reflowable PDFs and intermediate methods.
While I don’t have any of these devices, I can see that thinking about supporting them is going to be important. It’s clear that the overall market is very big, and that there are unique challenges in supporting small screens with a different form of interaction to the ‘traditional’ PDF. So I’m pleased to see that a variety of people are exploring all of the possible TeX-based solutions.
TUG 2010: Videos appearing online
Following the TUG 2010 conference, those of us who did not manage to go do not need to feel too left out. River Valley Technologies are putting them on-line. At the moment, there are only a couple of videos available, but more will follow. I’ll report on anything I think is of particular note as the page fills up.