3

I'm trying to put together a library of common exam and homework problems that I use throughout the year. I've gathered quite a collect over the years and was thinking it would be nice to have something like:

\loadhomeworkset{2.1.4.3}

I thought I would look at how \usetikzlibrary works. For the most part, I believe I understand the code. What I don't understand, though, is why the catcodes for @, |, $, are changed. Is this really something special to TikZ or is it something I should aware of in building a robust interface.

3

It does

  \catcode`\@=11
  \catcode`\|=12
  \catcode`\$=3

in

tex/generic/pgf/frontendlayer/tikz/tikz.code.tex

the first is just the usual equivalent of latex's \makeatletter so that you can use @ in command names

The second two are characters that are often made active for one reason or another and normalising the catcodes to other while the file is being read probably just simplifies some things, I note for example $ appears commonly in headers such as

\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/tikz.code.tex,v 1.142 2013/12/13 15:11:58 tantau Exp $

I'm not sure if the code it uses to split up that RCS/CVS header works if the delimiter $ were active.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.