0

I am currently writing my thesis and I am trying to properly structure the naming of labels. For instance, I use

\label{fig:abc:def:ghi}

for labeling a figure in my main chapter "abc", on some topic "def" with a certain name "ghi". I realize that this results in pretty long labels. On the other hand, I realize that I mostly reference figures only within a chapter.

Hence, I am wondering, how to simplify this.

Do you have suggestions on how I

  • could automate adding the first part of the label (here: "fig") to the actual label based on the environment?
  • could just use a reference to the type and the last part of the label (here: "fig:ghi") to reference things lying within my chapter and only have to use the long form ("fig:abc:def:ghi") if referencing outside the chapter
navige
  • 452
  • 1
    why do this at all? You only need to label figures that you reference, and you can just use \label{my-cat} if it's a picture of a cat. Why the complication of structured labels, given that the system does not use that structure and just uses it as a string? – David Carlisle May 08 '17 at 15:42
  • 2
    auctex/reftex under emacs can already add/suggest such prefixes automatically, see the variable reftex-label-alist-entries and reftex-insert-label-flags. Which editor are you using? – Andrew Swann May 08 '17 at 15:44
  • 2
    Don't use extreme structured labels. If you move figure fig:abc:def:ghi from def to xyz you will go into trouble. BTW: Isn't this a primary option-based questions? – Schweinebacke May 08 '17 at 15:47
  • @DavidCarlisle Well for large documents creating a structure seems to make sense to me. – navige May 08 '17 at 16:02
  • @Schweinebacke You are right, so I was looking for something to automate some parts of it for me. – navige May 08 '17 at 16:02
  • @navige it is adding complication for you (hence this question about how to control it) while making no difference at all to the system which does not treat : as special in any way inside a label string. – David Carlisle May 08 '17 at 16:05
  • In case you use texstudio, you can automate the label creation, see https://sourceforge.net/p/texstudio/wiki/Scripts/#automatic-label-creation-by-pressing-wzxhzdk39-after-a-structure-command – samcarter_is_at_topanswers.xyz May 09 '17 at 12:30

0 Answers0