4

@DavidCarlisle argued in his answer that there is no need to use very long labels and it is actually a misuse! In my dissertation I find myself using very long labels all over the place. For the same reason I normally use long and descriptive file names, I tend to use long labels that are informative.

The only drawback of this approach that I could think of, so far, was the following. When referring to a label the \ref{very-long-label} macro pollutes the code and makes it harder to read. Otherwise, this usage makes it easier to find the labels you need while writing.

I learned the second drawback yesterday, when I got to know the showkeys and showlables packages. These packages become useless when long labels are used (see Tweak showlabels/showkeys - wrap the label).

One last piece of information. I use emacs+AUCTeX, so I can always get a nice list of labels that are defined in the document, and this list handles long labels fine.

So what is the best practice here? What is considered a good choice of labels?

closed as primarily opinion-based by yo', Mensch, user13907, egreg, Paul Gessler Feb 8 '15 at 0:15

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Shouldn't something like \let\lbl543{very-long-label} work for you? (Personally, I don't mind long label names, I just put them on a separate line if the length really bothers me.) – einpoklum Dec 6 '13 at 8:43
  • I don't see the advantage of this suggestion. In the code itself you'll end with cryptic fragments like \ref{\lbl314} so you could use this as the label in the first place. – Dror Dec 6 '13 at 8:48
  • 3
    the label is just an internal identifier for cross referencing so the only important thing really is that it is memorable to you. I suggest that the reason that you need showkeys is because your labels are too long to memorise and so you need to look them up. The label is internally used to generate a command name, and write to the aux file so there are some constraints on the characters used (and space only really works by accident) there was a time that long csnames would be a concern with using up TeX memory but that isn't an issue now (but probably affects my mental model of labels) – David Carlisle Dec 6 '13 at 9:29
  • Are you saying you memorize dozens (or maybe even hundreds) of labels (e.g., when writing a long document)? – Dror Dec 6 '13 at 10:12
  • I do also use quite long labels. But for me using emacs+AUCTeX+RefTeX and C-c ) is enough because the list contains enough information to find the correct label pretty fast. I have no need for showkeys or showlabels. – Christoph Dec 6 '13 at 10:31