New release of the ucs LaTeX package

The ucs package provides advanced support for using UTF-8 as the input encoding of LaTeX files. It goes much beyond the standard UTF-8 support of LaTeX. In particular, it enables you to use non-ASCII characters in the LaTeX input of mathematical formulas. This feature is particularly important for Agda programmers that use lhs2TeX to typeset their code. The lhs2TeX preprocessor relies on ucs for typesetting all those mathematical symbols and greek letters that you typically find in Agda code.

The ucs package was originally developed by Dominique Unruh. Dominique had stopped working on ucs several years ago. In 2011, I took over the maintainer role. Now, I have made a new release – which is the first ucs release since 7.5 years. The current version is 2.0. At the time of writing, it is available on CTAN and in TeXLive.

Note that ucs has previously been called unicode on CTAN and is still called unicode in MiKTeX. However, the main style file has been called ucs.sty for a long time. Therefore, I propose to call this package ucs everywhere. On CTAN, this name change has already been performed.

These are the most important changes since the last release of ucs:

  • More mathematical symbols are supported, for example, ⟦, ⟧, ↦, ⅋, and several kinds of arrows.
  • Double-struck letters (𝔸, 𝔹, etc.) are now typeset using \mathbb instead of \mathbbm.
  • The handling of small greek letters in math mode has been improved.

The last point concerns the fact that some greek small letters have two different forms, a standard form and a variant form. For example, the letter phi has the standard form φ and the variant form ϕ. Different Unicode codepoints exist for the different forms. The previous version of ucs supported only the standard forms, except for the letter sigma, where it supported both forms. For some letters, ucs produced the variant form despite the fact that the codepoint of the standard form was used. These deficiencies are fixed now. All existing standard and variant forms are supported, and the correct glyph is produced in every case.

Note that the authors of Unicode and the author of TeX had different ideas about what is the standard and what is the variant form of a letter. For example, Unicode considers φ to be the standard form of the letter phi and ϕ to be the variant form, while TeX’s \phi macro produces ϕ, and \varphi produces φ. The ucs package conforms to Unicode now, so that it may realize a standard letter using a \varletter macro, and a variant letter using a \letter macro. The following table lists all greek small letters with two variants together with their Unicode codepoints and the TeX macros that produce them:

Standard form Variant form
Glyph Unicode TeX Glyph Unicode TeX
ε U+03B5 \varepsilon ϵ U+03F5 \epsilon
θ U+03B8 \theta ϑ U+03D1 \vartheta
κ U+03BA \kappa ϰ U+03F0 \varkappa
π U+03C0 \pi ϖ U+03D6 \varpi
ρ U+03C1 \rho ϱ U+03F1 \varrho
σ U+03C3 \sigma ς U+03C2 \varsigma
φ U+03C6 \varphi ϕ U+03D5 \phi

Note that \varkappa requires the import of amssymb, txfonts, or pxfonts.

I hope you enjoy this new release of ucs. If you have any ideas for improvements, please get in touch with me.

About these ads

5 comments on “New release of the ucs LaTeX package

  1. Paul Rivier says:

    Hi, I’m glad to see ucs is active. I’m not a LaTeX guru at all, however I decided a few years ago to use the XeTeX variant of the compiler. My main motivation back then was not agda but simply french documents. Since then I have not had a single Unicode headache :)

    • XeTeX is really an interesting alternative to pdfTeX, as is LuaTeX. Unfortunately, I didn’t find the time so far to have a closer look at them. Do they have compatibilty problems with certain LaTeX packages? If you have to use a certain document class (for example, when writing a paper for some conference), you’ll not be able to use XeTeX or LuaTeX I guess, as font selection is done very differently with them, and the sets of available fonts is different.

      I think (and hope) that LuaTeX will become the de-facto TeX engine in the long run. This will then make the ucs package obsolete. But until this happens, ucs will be useful, I think.

  2. The new version is now also available in MiKTeX, and the name change from unicode to ucs has also be done there. Thank you, Christian.

When replying to another comment, please press that comment’s “Reply” button first.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s