1. 2012
    Dec
    05

    Absolute positioning in TikZ and Beamer

    I discovered this little trick recently while making a presentation in Beamer. Suppose I have a drawing, done in TikZ, which I want to place such that the origin of the TikZ coordinate system is at a specific absolute position on the page — in my case, 1.5cm below the center.

    \begin{tikzpicture}[remember picture,overlay]
      \tikzset{shift={(current page.center)},yshift=-1.5cm}
      % the picture
    \end{tikzpicture}
    

    TikZ defines this current page node which can be used for absolute positioning. While I can’t directly say “set the origin at (point)” (at least, not as far as I know), I can say “move the origin by (vector),” and fortunately, an anchor point or any point specification in TikZ can be used as a vector. The trick to this little code snippet is that (current page.center) gives the vector from wherever the current origin is to the center of the page. So regardless of where the picture is placed on the page, applying this shift gets you to the page center. Then you can apply any additional shift needed to get wherever you need to on the page.

    This trick gets around one of the few shortcomings of Beamer …

  2. 2011
    Jan
    12

    The physymb package

    Just a quick post to announce my first interesting news of 2011: the physymb package for LaTeX, currently available from CTAN. This is a collection of commands that I’ve been accumulating over the past 5 years or so. It includes things like derivatives, unit vectors, commutators, elementary particles, and a bunch of other assorted macros that might be useful when you’re trying to typeset a physics paper. Dirac notation, scientific notation, and units are in there as well, though I’ve already found out that those are obsoleted by the braket and siunitx packages, so I’ll be removing those things in the next version.

    Still, the macros in physymb have been quite useful to me, so if you do a lot of physics-related typing, have a look at them! Naturally, I will be happy to receive any feedback, including suggestions of useful things to add.