Some TeX Developments

Coding in the TeX world

Archive for the ‘siunitx’ tag

siunitx: Getting the micro symbol right

with 2 comments

I get a few e-mails about siunitx and the micro symbol. People tend to be surprised that the symbol ‘sticks’ to a look very much like Computer Modern. The reason is that picking a proper upright (not italic) μ is not so easy in TeX. You don’t get one in Computer Modern, so siunitx takes one from the TS1 (text support) set in the absence of a better plan. I’ve set up some auto-detection for a few obvious alternatives (such as the upgreek package), but that doesn’t really work for XeTeX users.

XeTeX users are likely to load system fonts, and I’d hope be using UTF-8 input. That makes it hard to auto-detect what they are doing, but should make life easier for them to get things right. A lot of more comprehensive fonts include Greek letters in the main font, so getting the μ right is simple:

\sisetup{
  mathsmu = \text{μ},
  textmu  = μ
}

or for people testing version 2 of siunitx:

\sisetup{
  maths-micro = \text{μ},
  text-micro  = μ
}

There may be a bit of testing required: this will not work if, for example, you are using the Latin Modern font.

Written by Joseph Wright

December 22nd, 2009 at 9:12 pm

Posted in LaTeX,siunitx

Tagged with , ,

siunitx version 2: snapshot four

with 2 comments

I’m continuing to work on version 2 of siunitx, and the code has now reached the point where the basic macros (\num, \SI, \si, \numrange and \SIrange) work at least as well as the version one code. There are probably still some bugs, but I’m using the new code for my own work and at the moment all seems good. The internal improvements mean that while there are still things to add this should not be too hard.

If you want to try things out, as before you can grab things here:

What is on the list next is tackling the tables issues. That is going to be hard work, as there are some complicated things to sort out. So I will probably add a few bits and pieces to the rest of the code at the same time.

As always, feedback by e-mail or to the BerliOS site is very welcome.

Written by Joseph Wright

December 11th, 2009 at 7:03 am

Posted in siunitx

Tagged with ,

siunitx version 2: snapshot 3

without comments

It’s been a while since I gave an update on progress with siunitx version 2. I’ve had other things on the go, but am trying to make some progress with the code as I have lots of bugs which are fixed in the new version. Since the last snapshot, I’ve gone back over everything and moved internally to expl3 syntax. That makes my life a lot easier, as there are lots of tools available without needing to write them all for myself. It does mean that users/testers will need to have expl3 installed: you will need the most recent release, which should appear in TeX Live and MiKTeX soon for online installation, or can be downloaded from CTAN (look for expl3.tds.zip).

There are some notes and outstanding questions with the current snapshot: it is still some way from being finished. Things to be aware of or to think about:

  • Places where units should be repeated are not working properly at the moment. That is the next thing I need to sort out: I’d hope it will be done soon (perhaps another snapshot in a couple of weeks)
  • I’d set the defaults to use text mode for units and maths mode for numbers. This may not stay that way, see for example the results for \SI{1.23}{J.mol^{-1}.K^{-1}}. This is because printing units literally has to do the powers in the same font as the units.
  • The options system is now using the LaTeX3 l3keys module. Following the pattern that looks likely for LaTeX3 work, I’ve given the options names divided into words using hyphens. I hope that they make sense.
  • At present, complex numbers are always printed with the complex root (i) after the number. I need an option to reverse this, but can’t think of a good name.
  • I’ve tried to simplify the various ‘trapambig…’ options into a single one (use-brackets). I’m not sure if this will work for everyone: do people need the ability to turn bracketing on and off in a more granulated way?

For those who want to test things out, you can get:

Written by Joseph Wright

November 23rd, 2009 at 8:35 am

Posted in LaTeX,siunitx

Tagged with ,

PCTeX: Helpful people

without comments

I had a bug report for siunitx recently, concerning handling of the ohm symbol when the MathTime Pro package has made \Omega slanted. As many of you will know, MathTime Pro is commercial, and so I was not totally sure I’d be able to sort the issue out. I dropped the suppliers, PCTeX, a quick e-mail to see if they’d let me see the code for bug-fixing purposes, more in hope than expectation. I was pleasantly surprised to get an e-mail back the next morning, saying that this was no problem and even letting me download the fonts themselves for testing. A ‘pat on the back’ to PCTeX: very good service indeed.

Written by Joseph Wright

October 24th, 2009 at 3:48 pm

Posted in LaTeX,siunitx

Tagged with , ,

siunitx v1.3

without comments

I’ve just released version 1.3 of siunitx to CTAN. Although the changes are not large in number, they are important. First, I’ve altered the default code for \micro (μ), as the previous version did not look great: an important change, hence the bump of version number. Second, the packaging has been altered to make life easier all round. You can now extract the package and typeset in one go from the .dtx file using LaTeX, or just extract it using TeX. Overall, the effect is much cleaner than the old version. Of course, there are some bug fixes too.

Written by Joseph Wright

September 21st, 2009 at 7:09 pm

Posted in LaTeX,siunitx

Tagged with

siunitx update

with 5 comments

I’ve just sent a minor update of the release version of siunitx to CTAN. There was a clash with the fourier package, to do with maths fonts. This is all due to the lack of an upright μ in Computers Modern: a continued pain. For the moment, all is sorted again! One note: I’ve done the release here using TeX Live 2009, rather than my more usual MiKTeX 2.7. Everything seems to have worked, but any feedback is of course welcome!

Written by Joseph Wright

August 11th, 2009 at 8:05 am

Posted in LaTeX,siunitx

Tagged with , ,