Andrew Stacey


About
Andrew Stacey
Information about my research, teaching, and other interests.

By: Andrew Stacey
Contact details


Andrew Stacey


blosxom icon


Fri, 27th Jun 2008 (HowDidIDoThat :: LaTeX)

LaTeX Hacks

Gathered here are the various hacks that I use or have used to make LaTeX (and occasionally TeX) do what I want it to do.

[Full link]
Last modified on:
Fri, 27th Jun 2008


Thu, 20th Dec 2007 (HowDidIDoThat :: LaTeX)

Document Revision System

I've decided to start using a document revision system for my papers. My current ad hoc method is getting seriously strained; exchanging copies with collaborators, merging their comments with my revisions, preparing different versions for different places (archives, journals, home pages); it was all getting too confusing.

So I had a look around on the web and found a paper (also available as a wikibook) promoting the use of subversion. This is actually a software revision system. However, the general principle is the same: a typical LaTeX paper consists of several text files and this is exactly what a typical piece of software consists of and thus what software revision systems are designed to track.

There are several different systems around and it's not clear which is the "right" one. Subversion certainly seems better than CVS, but there's also GNU Arch and its variants. I had a quick play with subversion, but am going to give bazaar a serious go.

See more ...

[Full link]
Last modified on:
Thu, 20th Dec 2007


Mon, 26th Feb 2007 (HowDidIDoThat :: LaTeX)

MathGrep - Search and Replace in Mathematics

This is a Perl script which does either a search (known in the Unix world as a grep) or a search-and-replace on a LaTeX document looking only in sections of mathematics.

See more ...

[Full link]
Last modified on:
Mon, 26th Feb 2007


Thu, 18th Jan 2007 (HowDidIDoThat :: LaTeX)

Importing XFig Files into LaTeX Documents

I find it useful to be able to switch the type of output LaTeX produces between PDF and postscript (once I get the hang of MathML then I might add that to this list). Most of the time this is purely a matter of using pdflatex instead of latex + dvips but with more complicated LaTeX documents then it is sometimes a little more involved. This is particularly the case where external graphics files are involved.

See more ...

[Full link]
Last modified on:
Thu, 18th Jan 2007


Thu, 17th Nov 2011 (HowDidIDoThat :: LaTeX)

Chalk, Calligraphy, and TeX

Following on from my screencast of how to do a fraktur "g" (see calligraphy), and inspired by a competition on TeX.SX, I've written a little article on calligraphy and chalk. It was initially intended as a submission for that competition, but in the end I think it breaks too many of the rules! You can:

You'll need the calligraphy package (the files calligraphy.dtx and spath.dtx, run tex X.dtx to generate the .sty files).

[Full link]
Last modified on:
Thu, 17th Nov 2011


Thu, 18th Aug 2011 (HowDidIDoThat :: LaTeX)

A Random Grid of Shapes

This is a short LaTeX package which greats a random grid of shapes. At the moment, the shapes are harded coded to be red triangles, black squares, and a red square. The package file can be downloaded here. A simple example is:

 \documentclass{article}
\usepackage{tikz}
\usepackage{randomgrid}

\begin{document}
\begin{tikzpicture}
 \matrix[matrix of shapes,row sep=1cm,column sep=1cm,odd one out] {\\};
 \end{tikzpicture}
 \end{document}

This produces the following:

random grid of shapes

A more detailed explanation of the ideas behind this package can be found on the TeX-SX blog.

[Full link]
Last modified on:
Thu, 18th Aug 2011


Fri, 29th Jul 2011 (HowDidIDoThat :: LaTeX)

The internet Class

This is a class designed for those that want to use LaTeX to publish material on the internet. As it becomes more common to publish material via some content-management system, so it becomes rarer to generate (X)HTML documents directly and content for the web is usually written in some limited markup language. This class is designed to make it possible to author material for such systems using the facility of LaTeX.

See more ...

[Full link]
Last modified on:
Fri, 29th Jul 2011


Mon, 11th Apr 2011 (HowDidIDoThat :: LaTeX)

LaTeX to Markdown+iTeX Conversion

LaTeX2iTeX is a perl script that converts LaTeX code to Markdown+iTeX (actually, the flavour of Markdown is maruku). It was written to facilitate the creation of nLab pages, but could be used for other circumstances, including being adapted to a full conversion from LaTeX code to XHTML.

The underlying engine is an implementation in perl of a subset of the TeX program. This is a perl module called Text::TeX. Not all of TeX is implemented, which has consequences for what documents can be converted.

See more ...

[Full link]
Last modified on:
Mon, 11th Apr 2011


Wed, 30th Mar 2011 (HowDidIDoThat :: LaTeX)

DeBuck - Remove Dollars from a LaTeX Document

This is a Perl script which replaces dollars in a LaTeX document by \( ... \) or \[ ... \]. Providing there are no sneaky macros and the file LaTeX's correctly it does a reasonable job.

See more ...

[Full link]
Last modified on:
Wed, 30th Mar 2011


Thu, 24th Mar 2011 (HowDidIDoThat :: LaTeX)

Adding Backgrounds to a TikZ Matrix

Sometimes a question just gets under my skin. This question on TeX-SX about setting backgrounds on a TikZ matrix was one of them.

See more ...

[Full link]
Last modified on:
Thu, 24th Mar 2011


Thu, 10th Mar 2011 (HowDidIDoThat :: LaTeX)

Knot and Link Diagrams


brunnian --- a style file for drawing link diagrams with TikZ/PGF
E-mail: stacey@math.ntnu.no
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt


This package defines some commands and styles useful for drawing knot and link diagrams with TikZ/PGF. Some are geared towards drawing very specific links (the iterated Hopf and Brunnian links) whilst others will be more generally useful for arbitrary knots and links.

  • The DTX file. This is the master file from which all else is generated. Run pdflatex on this to generate the README.txt, the style file brunnian.sty, and the documentation brunnian.pdf.
  • The STY file. This is the style file. Put this somewhere that TeX can find it, for example in the directory where your .tex document is located.
  • The PDF file. This is the documentation explaining how to use the various commands.

[Full link]
Last modified on:
Thu, 10th Mar 2011


Tue, 10th Aug 2010 (HowDidIDoThat :: LaTeX)

My Macros

As with all (La)TeX users, over time I've gathered a fair number of macros that I tend to use in most of my documents. Most are the of the standard \newcommand{\R}{\mathbb{R}} variety but a couple are a little more complicated. As one or two of these more complicated ones are relevant to the issues raised in MyClass, I'm putting them up here.

See more ...

[Full link]
Last modified on:
Tue, 10th Aug 2010


Tue, 10th Aug 2010 (HowDidIDoThat :: LaTeX)

My Class File

I use a single class file for all my LaTeX documents. This class file sets up some options before calling a real class file, depending on which options it was passed. This allows me to do the following:

  1. Swap class files without rewriting vast swathes of my documents (necessary when submitting articles to journals).
  2. Maintain different versions of the same document without changing the document (useful when doing beamer presentations).

See more ...

[Full link]
Last modified on:
Tue, 10th Aug 2010


Mon, 21st Sep 2009 (HowDidIDoThat :: LaTeX)

Beamer

Some little intricacies about beamer.

  1. The list of commands that work outside frames (when ignorenonframetext is set) is hard-coded. That's annoying as it means that wrapping one of these in another command, or modifying one, doesn't work. The new command has to be wrapped in \mode<all>{}, or added to the list (which is in beamer@treat set in beamerbasemodes.sty).

  2. The beamerpauses counter works a little differently inside and outside lists. Basically, the count is off by one in one of them. When using a list with automatic pausing ([<+->]), one can write \alert<.>{alert} to get something alerted as it is unveiled. However, outside a list, one has to use \alert<.(1)>{alert}. Also, putting a \pause straight after a list makes it pause twice. But not putting a \pause means that it doesn't pause at all. The solution is to subtract one from beamerpauses and then do a \pause (of course, one should put this into a separate command, say \itpause, in case this behaviour gets corrected later on; then simply putting \itpause equal to \pause will mean that the correct behaviour is always correct). Where it gets confusing is in adding additional pauses within a list environment. The first has to be an \itpause and the rest \pauses, but there has to be a last \pause before the next item.

[Full link]
Last modified on:
Mon, 21st Sep 2009