Some TeX Developments

Coding in the TeX world

Extending biblatex to support multiple scripts

with 7 comments

As regular readers will know, I’ve taken an interest in biblatex since it was first developed. Since the original author disappeared, I’ve been at least formally involved in maintain the code. So far, that’s been limited to tackling a few tricky low-level TeX issues, but there are some bigger issues to think about.

Philip Kime, lead Biber and biblatex developer, is keen to extend the LaTeX end to supporting multiple scripts. The Biber end is already done (in the ‘burning edge’ version), and writes to the .bbl file in the format:

 \field{form=original,lang=default}{labeltitle}{Title}
 \list{form=original,lang=default}{location}{1}{%
   {Москва}%
 }
 \list{form=romanised,lang=default}{location}{1}{%
   {Moskva}%
 }

However, that presents a big issue: how to do that without breaking every existing style. Supporting scripts means we need an additional argument for a very large number of commands: some of them need to have two optional arguments, and some of them need to be expandable:

\iffieldundef[form=original,lang=default]{....}

Reading (two) optional arguments and working through keyval options expandably is tricky, which is where I come in. The natural way for me to solve the first problem is to use LaTeX3, and the xparse package. However, that’s a big change for biblatex, so before I (and the rest of the biblatex team) go for this I though it would be worth raising the issue and looking for opinions. The alternative is to write the code into biblatex directly, but it’s complicated and as I’ve already done the job once I’m reluctant to do this!

So, what I want to know is ‘What do users think?’ Is it reasonable to require xparse as part of `biblate

Written by Joseph Wright

February 10th, 2013 at 11:45 am

Posted in biblatex,LaTeX

Tagged with

Clipping support in XeTeX

without comments

Clipping boxes is something that TeX does not do: it simply places them on the page. That means that clipping graphics (a pretty common requirement) is actually done by the driver rather than by TeX. The LaTeX graphics package and the driver support that come with it cover quite a lot of cases, and over the years support for a number of other drivers have been written based on the same ideas. However, things are still not 100% identical over all back-ends. A particular gap at the moment is that that XeTeX support code does not offer clipping, because the XeTeX engine does not do this (pdfTeX and LuaTeX both do). Users of pgf might have noticed that it manages to do clipping perfectly happily with XeTeX (or rather they might have wondered why graphics doesn’t when pgf does). Martin Scharrer and I looked at this a while ago for his adjustbox package, and worked out what is actually needed: some PostScript specials in a xdvipdfmx wrapper. The same basic idea is now being integrated into xetex.def, the driver support code used by graphics. This will go to CTAN soon, but some testing would be good. The updated file is available now, so I’d encourage intrepid readers to download and test it!

Written by Joseph Wright

February 4th, 2013 at 9:04 am

Posted in General

Tagged with , ,

Testers needed for babel

without comments

Javier Bezos has just announced that he’s looking for people to beta-test the next version of babel. Javier has been working hard on getting the babel code organised, and working out what problems need addressing, after quite a long ‘drift’ period. I hope lots of interested users pop up!

Written by Joseph Wright

January 30th, 2013 at 8:23 pm

Posted in LaTeX

Tagged with

New CTAN, new toys

with one comment

Many readers will have been watching the updates to CTAN with interest. So far, we’ve seen a new layout to the site, with a promise of new ‘toys’. Some of these have now appeared at least in testing form, and can be accessed at http://www-new.ctan.org.

The biggest change is that you can now register an account, and use this to vote on packages. I’ve of course registered already, and taken a very quick look at the voting system. I notice that at the moment the system doesn’t spot that I’m the author of some packages, so can vote on them! Of course, I’m not going to do that, and if there are lots of people voting it won’t matter.

Written by Joseph Wright

January 19th, 2013 at 9:30 am

Posted in General

Tagged with

The joys of multi-directional typesetting

with 5 comments

Anyone who subscribes to the XeTeX or LuaTeX mailing lists will have seen a lot of posts from me over the past couple of weeks, pursuing various aspects of multi-directional typesetting. That might prompt some questions, not least what has raised this interest!

I got a bug report for siunitx a little while ago about interaction with the bidi package. That pushed me to look at something I’ve been wondering about for a while: what we need to do in the LaTeX3 codebase to allow for multiple directions (particularly right-to-left, which as bidi shows should be usable directly in LaTeX). It’s turned out that good documentation on the various primitives available is not so easy to come by, and that there is a lot to get your head around. Luckily, I’ve had some very useful feedback from a range of people, including John Plaice (one of the authors of Omega). It also turns out that not everything is quite settled in engine support for multiple directions, so asking questions is pretty important.

Written by Joseph Wright

December 16th, 2012 at 4:28 pm

Posted in General

Tagged with , , , ,

Keeping releases in sync

without comments

As a package developer, I regularly send material to CTAN. Once my code gets uploaded, there is not much I can do about it spreading around the world. There’s always a slight delay in the various CTAN mirrors picking up new material, while the code only changes TeX Live and MiKTeX once the maintainers of those systems spot the CTAN changes.

For a single package upload, that process simply means a little bit of a delay between me saying that something is fixed and everyone being able to use it. However, where there are linked changes in more than one package then life gets a bit more complicated. A classic situation is siunitx, which uses the LaTeX3 programming environment. I do the releases for LaTeX3 so if there is an issue which needs a change in both siunitx and the LaTeX3 code both get updated on CTAN at the same time. However, it’s not unknown for TeX Live or MiKTeX to pick up only one change initially, leading to issues for end users. That’s a pain, but there is little I can do about it as I don’t control that process.

Written by Joseph Wright

November 25th, 2012 at 10:15 am

Posted in General

Registering expl3 module

without comments

Namespace management in TeX is a co-operative affair: we all share one space, so conventions such as \my@clever@macro are important. For LaTeX2e work, this has always been done on a very informal basis: look around and find a space! For LaTeX3, it seems like a good idea to make things a little bit more ordered. We’ve therefore set up a simple flat-file prefix register, which will track all of the prefixes in use in expl3 code (provided people tell us, of course).

Written by Joseph Wright

November 4th, 2012 at 6:32 pm

Posted in LaTeX3

siunitx: Planning for v2.6

without comments

I try to keep my siunitx package ticking over, even though it’s now pretty feature-rich. There are a couple of issues currently on the list for v2.6, and I’m planning to tackle those over the Christmas holidays. So now is a good time to log any feature requests you have for siunitx.

Written by Joseph Wright

October 27th, 2012 at 6:37 pm

Posted in LaTeX,siunitx

LaTeX for Complete Novices

without comments

Getting started with LaTeX is more tricky than getting started with WYSIWYG software, as there is a definite learning curve to LaTeX, and the concepts are different from those in (perhaps more familiar) word processors. Good guides are therefore very important, and writing them is not easy. Nicola Talbot has maintained one of those guides for many years, along with a lot of other useful (La)TeX advice. She’s now branched out into the world of publishing, and has updated her guide for novice LaTeX users as part of that. Nicola’s making it available as a ‘proper’ book, but you can also get it for printing out at home, as an ‘online PDF’ or in HTML format. The source is there too, so if you really want you can typeset the entire thing!

Written by Joseph Wright

October 8th, 2012 at 9:16 am

Posted in LaTeX

Tagged with ,

Traditional BibTeX styles with biblatex

without comments

The biblatex package offers a lot of power in creating complex bibliographies. It also uses its own style files, separate from the ‘traditional’ ones used by BibTeX (plain, unsrt, etc.). In many ways that is a good thing, as the traditional styles are rather limited. However, lots of people rely on the traditional styles, so emulating them would be useful. There’s an open question on the TeX-sx site asking how to do this: it’s very much a ‘marker’, as the person who asked is one of the biblatex experts! Marco Daniel has now taken up the challenge, with a GitHub repo set up for development of a set of styles. They are still a work in progress, but it looks like the question will soon have an answer!

Written by Joseph Wright

September 2nd, 2012 at 2:53 pm

Posted in biblatex