# Some TeX Developments

Coding in the TeX world

## The LaTeX Companion as an eBook

with 2 comments

Many long-term LaTeX users have on their bookcase a copy of The LaTeX Companion, an excellent guide to ways to tackle a wide variety of problems in LaTeX. Having it available electronically has been something that many people have wanted, so I was very pleased when I heard from the lead author, Frank Mittelbach, that this was in the offing. The electronic version, as a PDF or in eBook format (ePub and Mobi), is now available from InformIT, the publisher’s online store.

The price is very reasonable: $23.99, with a discounted price ($14.99) available until the end of the year using code LATEXT2013. For that, you get all three formats in DRM-free form: the PDF is watermarked but otherwise identical to the current print version (the 2nd edition). It’s not a new edition: the (excellent) text is that written by Frank and the rest of the team in 2004. For many purposes, that makes very little difference as LaTeX is generally very stable, but if you are interested in biblatex, TikZ, LuaTeX or other ‘new’ developments in the LaTeX world then perhaps it’s not the book for you.

As the PDF is identical to the print version, it works best on bigger screens where you can give it the full width and size it needs. The eBook forms work better on dedicated readers, but at the cost that the code examples are inserted there as pictures. There’s a good reason for that: only in the PDF is the typography done by TeX, so to see the real results in the eBook forms means that pictures are the only way to go. You get all the internal links you’d expect in all of the formats: the table of contents to chapters, references to the bibliography and so on. Having all three formats for one price means you can both take advantage of the flexibility of eBooks and have a copy with high quality typography all available to you where ever you go. Being electronic, you can also search the text (only the PDF lets you search the examples as only there are they not pictures.)

There’s very little downside to the electronic copy: the cost is good, the restrictions are minimal and the text itself is of course excellent.

Written by Joseph Wright

October 25th, 2013 at 8:41 pm

Posted in LaTeX

## LaTeX Tutorial videos from ShareLaTeX

with 2 comments

Learning LaTeX without a ‘local guide’ can be a challenge: it’s one of the reasons I’m involved in running training courses for UK-TUG. The people behind ShareLaTeX have decided to make a series of videos aimed at newer LaTeX users, covering the basics of LaTeX use, writing a thesis and also some more advanced topics (TikZ and beamer, for example).

There are currently about 25 videos, and I’ve watched all of the ‘basic’ ones (the LaTeX beginners series and the thesis series). The quality and presentation is pretty good: as well as well produced videos there are also transcripts for all of them, and of course the demos are available on ShareLaTeX. Of course, there are a few things I’d tackle differently, but the overall picture is pretty impressive. They’ve put a lot of work into the videos, and if you work through carefully (and take time to try the demos yourself) them I think you’ll get a good grounding in using LaTeX.

Written by Joseph Wright

September 15th, 2013 at 10:53 am

Posted in LaTeX

Tagged with , ,

## Beamer and \subsubsection

without comments

I’m hoping to address a few bugs in beamer over the next few days. One category that is always tricky is things linked to using \subsubsection. If you’ve read the beamer manual carefully, you’ll know that the original author of the class really didn’t want people to use \subsubsection in talks. However, he also didn’t ban it entirely, leaving me with a tricky situation. The problem is that while \subsubsection works, many of the things you might expect to happen from the relationship between \section and \subsection fail with \subsubsection, and from the code that may well be ‘by design’. Of course, I can change the ‘rules’, but beamer has been around a long time and it’s also somewhat complex code. As such, I’m always having to make judgements on how to deal with these bugs. My advice: don’t use \subsubection in beamer documents! Certainly don’t be surprised if when you ignore that advice odd things happen.

Written by Joseph Wright

September 7th, 2013 at 5:03 pm

Posted in beamer

## Customising TeXworks auto-completion

without comments

TeXworks is a very flexible editor, and one of the things you can customise, if you want, is the set of auto-completion values it knows. For those of you who are not familiar with it, TeXworks uses a simple list of simple completion options, so when I type

\doc


I can press the Tab key and be offered

\documentclass{}


and if I press Tab again,

\documentclass[]{}


That’s very useful, but some of the auto-complete options are not ones I use a lot. There are also a few inconsistencies in how the results are formatted: while TeXworks inherited a basic set from TeXShop, it also comes with some additions and they don’t always quite agree on how things should work! So I’ve been looking a bit at sorting out my own custom set, adding things I use, removing ones I don’t and so on.

The basic format for the auto-complete files is to have a first line for the encoding

%% !TEX encoding = UTF-8 Unicode


then one or more lines for each completion. Each line can either just have a completion vale

\alpha


or have a ‘shortcut’ text version

xa:=\alpha


There are then a few bits of ‘helper’ syntax. You can use #INS# to show where the cursor should end up, #RET for a return and • as a marker you can jump to using Ctrl-Tab (Option-Tab on the Mac). So for example the \documentclass lines read

\documentclass{#INS#}#RET#
\documentclass[#INS#]{•}#RET#


I’m told that TeXShop has extended the syntax a bit, but at least at the moment in TeXworks that all there is to know.

So what have I done to customise the files? TeXworks comes with four auto-complete files, but the values offered simply come from them all together (you can’t currently select only some files). (You might wonder where these files live: they are ‘hidden away’: TeXworks will tell you how to find them from Help -> Settings and resources.) So my first move was to create one new file, after first backing up the originals of course! I then did a few experiments, thinking about what I use a lot, what I’m used to, etc. I did wonder about some of the choices in the standard files, but a bit of experimentation suggests they are not so bad! So I’ve currently ended up mainly just adding a few things, for example

{tikzpicture}[#INS#]#RET#•#RET#\end{tikzpicture}•


for TikZ pictures and

cs:=\cs{#INS#}
pkg:=\pkg{#INS#}
\cs{#INS#}
\pkg{#INS#}


for package development work. I’m also not too keen on having too many of the ‘shortcut’ values, which don’t start \, so I’ve removed most of them and have just a core set (things like bf and em). If you want to see my current full set, you can of course download it.

So is there anything I’d like to see added to the way auto-complete works? I have a few ideas! From my questions on the TeXworks mailing list, I’ve picked up that TeXShop maintains indentation when doing auto-complete: TeXworks doesn’t, and I think it would be a good addition. TeXShop also allows an extended syntax

\documentclass[#INS#•#INS#]{•}#RET#
\rule[#INS#•‹lift›#INS#]{•‹width›}{•‹height›}


where you can always have a • for ‘fill in’ and have ‘reminders’ about what the values are. That looks useful too.

Written by Joseph Wright

September 1st, 2013 at 9:45 am

Posted in TeXworks

## TeX Live 2013 released

with one comment

Browsing the TeX Live site today, I see that TeX Live 2013 has been released. There are as usual a few changes to note. My highlights:

• XeTeX now uses the HarfBuzz shaper rather than the older ICU engine (which is no longer being developed): see my earlier post about this change
• LuaTeX is updated to Lua 5.2 (the latest Lua release)
• Microtype now supports protrusion in XeTeX and LuaTeX

I’ve been using the pretest version of TeX Live for a while, and am very happy that all seems to be working just fine. Of course, many people will want the DVD version, which will be a while, but for the downloaders you can grab it now.

Written by Joseph Wright

June 18th, 2013 at 8:27 pm

Posted in General

Tagged with

## A talk in Paris

with 3 comments

Yesterday I was in Paris, giving a talk to GUTenberg about LaTeX3 as part of their user meeting. The event was very well attended, and ‘official’ video recording will be available of all of the presentations. People seem very keen to hear talk I was giving, so I recorded the audio and have put it together with the slides as a video (thanks to UK-TUG for use of their Vimeo account!). I do hope it all makes sense!

Written by Joseph Wright

June 2nd, 2013 at 5:04 pm

Posted in LaTeX3

## TeX Welt: A new (German) TeX blog

without comments

If you are involved in (La)TeX for any length of time, you notice that using TeX is very popular in German-speaking countries. DANTE, the German-speaking TeX user group, is big, and there are several German-language TeX websites out there. They’ve now been joined by a new German-language TeX blog, TeX Welt. This has popped-up following some discussion on the TeX-sx chat system, and is being hosted by Stefan Kottwitz (a man with a server farm in his house!). Of course, we don’t all speak fluent German, but I’ll certainly be keeping an eye on the new site: always more to learn!

Written by Joseph Wright

May 27th, 2013 at 7:27 pm

Posted in General

## Keeping track of changes

without comments

Moving my code from BitBucket to GitHub has shown me (once again) the need to keep my changes to my code very organised. There was quite a bit of work to do getting all of the issues migrated, and it wasn’t helped by the fact that I’ve been less than perfect in keeping each commit I make focussed on one thing. A timely reminder that it’s important to be careful if you write a lot of code.

Written by Joseph Wright

May 25th, 2013 at 10:27 pm

Posted in General

## Moving from Mercurial to Git

with 7 comments

Over the years of working with LaTeX, I’ve picked up a bit about version control systems for code: this post is more about general programming than TeX.

I started out with Subversion, then moved to Mercurial when I got involved in beamer maintenance. The idea is the same whatever system you are using: by keeping a track of changes in the code you help yourself in the long term, and make it easier for other people to help too. Mercurial is one of several ‘distributed’ version control systems (DCVS) that have been developed over the last few years. The idea is that each ‘repository’ (copy of the code) has the history with it, and so is independent of any server. You can still send your changes to a server, and that is very popular, but you don’t have to. Sending code to a public server makes it easy to let other people get involved, report issues and so on, and there are lots of sites that will help you do this.

I picked Mercurial over the other leader, Git, mainly because the other guy involved in looking after beamer went this way and put the code on BitBucket. At the time, BitBucket did Mercurial while GitHub did Git. BitBucket changed hands a little while ago now, and they brought in Git support. They’ve now moved to make Git the ‘standard’ repository type. That tells me that Git is likely to ‘win’ as the most popular DCVS (it’s looked that way for a while), and so it’s time to reconsider my use of Mercurial.

It turns out that moving from Mercurial to Git is pretty easy: there is a script called fast-export that does the job. Converting the code itself is therefore easy: run the script (you need a Unix system, so on Windows I’m using a virtual Ubuntu machine with VirtualBox). Life gets a bit more interesting, though, if you want to keep your issues database. BitBucket does offer issue import and export, but no easy way to convert from Mercurial to Git. At the same time, the way that the two systems refer to individual commits means that if you don’t edit your issues, any links to the commits will be messed up. That means that its as easy to move to GitHub as it is to stay on BitBucket. So that’s what I’ve decided to do (GitHub is pretty popular with other LaTeX developers). I’m working through my repositories, converting to Git and uploading to GitHub, then copying the issue information by hand and doing minor edits. That includes making sure that I keep the links which show how I fixed things. Apart from siunitx, my packages don’t have a lot of issues (no more than a dozen each), so I can do that by hand without too much work. I’d a bit surprised no-one has written a script to do this, but at least it will not take too long. I’d expect everything except siunitx to be moved by the weekend, and even this ‘big job’ to be done within a couple of weeks.

Written by Joseph Wright

April 25th, 2013 at 9:08 am

## XeTeX 0.9999: Moving to HarfBuzz (and lots of other goodies)

with 3 comments

Khaled Hosny has announced on the XeTeX mailing list that XeTeX 0.9999 has just been released. The list of changes is pretty long, as XeTeX has had quite a backlog of issues. Probably the biggest single change is

Port OpenType layout from ICU LayoutEngine to HarfBuzz. HarfBuzz is actively maintained and generally have much wider support for
OpenType spec, the switch fixes a number of OpenType bugs:

• Support version 2 OpenType Indic specs.
• Many other Indic OpenType bugs, and support for the latest additions to OpenType spec.
• Incorrect application of contextual features.
• Incorrect kerning in fonts that has both old “kern” table and new GPOS “kern” feature.
• Allow suppressing Latin ligatures with ZWNJ.
• Support for variation selectors.
• Support for user-specified features with complex scripts.

If you are familiar with layout engines, you’ll know that while ICU has worked very well for XeTeX from day one, it’s no longer being developed while HarfBuzz is being developed. More importantly, HarfBuzz is supported by the open source community well beyond the TeX world, so by moving in this direction XeTeX gets the benefits of the efforts of many other people: part of the point of open source software. I’m sure it’s been a big effort making this change: I’m looking forward to testing it out.

The other headline change, at least for Mac users, is moving to Core Text rather than ATS/ATSUI. Apple have dropped support for the latter, so there was a worry about building XeTeX on the Mac in the future. That’s now sorted, and means XeTeX should work as a 64-bit application on the Mac in future.

If you read the full announcement you’ll see there are lots of other changes and bug fixes. Congratulations to Khaled on this: it’s great to see that XeTeX continues to develop, and that several features have been added to make working with XeTeX and LuaTeX seamlessly are now there.

Written by Joseph Wright

March 12th, 2013 at 9:01 am

Posted in General

Tagged with ,