I'm making an animated GIF using layers in GIMP. I have an image of an equation that I want to put on the same place in each frame. I tried opening the equation in GIMP, and then copy and pasting it into my layers, moving it to the location I want using the mouse, and then anchoring it. However, it only appears on one layer and hence on one frame. I can manually repeat for each frame but then I can't get it to the exact same place in every frame. Is there a better way to do this, i.e. anchor a floating selection to all layers at once?
No - a Floating Selection is internally attached to the layer it was pasted into. I suggest you try one of the following workarounds:
1) Promote the Floating Selection to a New Layer (just press the new layer button); Position this layer; Duplicate it as many times as you want; For each duplicate, manipulate the layer stack to place it above one of your destination layers; Select "Merge down" on the layer context menus. it is possible to create a single script that would automate the steps after you position the pasted layer, or even simply automate the task from either the script-fu or python-fu consoles. But I prefer the method described bellow:
2) My personal favorite for creating animations in GIMP: work with two images - one in which you have your elements in separate layers (including your equation), which you position as you want; a second image where you will compose the animation, in which each layer will be a frame; Make use of
edit->copy visible on the first image, and
edit->paste; layer->New layer in the second image. That way, for each frame you rearrange your elements freely on the first image, and put "snapshots" of your composition as frames - more or less like producing a stop-motion animation.