[Tex/LaTex] Rename label and automatically update all references

cross-referencingeditorskiletexstudio

Suppose, we have a section with a label \label{content}. This label is referenced at multiple occasions via \ref{content}.

During the writing process the content of the section changes and we would like a label name that properly reflects the content (so we do not get confused ourselves). Therefore, we replace \label{content} by \label{newContent}. The problem is that we have to manually update all references to that label.

Almost every programming IDE has a built-in function that lets you rename variables and updates all references to that variable automatically. A simple search and replace might be sufficient in some cases, but will fail every time the label name is part of some other content in the document. Of course, we could make label names sufficiently complex and thus unique, but this does not seem practical either.

Hence, I am looking for an editor function that can automatically update all references when a LaTeX label has changed. Preferably, this feature exists in kile or texstudio, but I am open to other editors as well.

Best Answer

On any label ore ref argument: Context Menu -> Find Usages

enter image description here

There you can rename the label and it's usages.

Related Question