Q: how do I refactor LaTeX labels?

I have a long LaTeX document with lots of figures and tables. Each of them has a long and convoluted label. Each label is referenced in a number of places in the document.

Are there any facilities to refactor a given label in order to:

  • rename the label (e.g., lab:convoluted:name:1 to lab:simpler:1)
  • replace all uses of that label throughout the document
  • refill altered paragraphs (bonus, but not necessary)

I know I can do a global search and replace, but it's error prone because I'm error prone. It's also not ideal because it's hard to systematize the labels when working with each of them piecemeal.

  • 1
    If you're using RefTeX, have you tried reftex-change-label (It is bound to <menu-bar> <Ref> <Global Actions> <Change Label and Refs>) – Arash Esbati Jul 12 '18 at 15:03

Your Answer

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

Browse other questions tagged or ask your own question.