Skip to main content
replaced http://tex.stackexchange.com/ with https://tex.stackexchange.com/
Source Link

I'm currently writing some lecture notes for "Geometry and Topology" (in German). With that project I've learned why namespaces for labels make sense.

Avoid double labels: I have had problems without prefixes like fig: and sec: or bsp: (for examples) or thm:, because of double labels. Quite often, I have had a figure I want to reference and a theorem. Namespaces solve that problem nicely.

Make code easier to read

Avoid mix-ups: Sometimes, I wanted to reference sections. So I was sure the section had a label, e.g. \label{lifting}. But in fact, that label was chosen for a figure. This would not have happened when I had prefixes. With prefixes, LaTeX would produce some ?? and make it obvious that I made an error.

After I have seen the screenshot from above, I think there is another advantage for you:

Autocompletion: I guess most of the time you know if you want to reference a figure, a section, a table or whatever. This way, you reduce the number of elements you actually need to think about quite a lot. (By the way, what editor do you use? I still type my LaTeX with gEdit / pluma mot of the time ... maybe you have a better alternative?)

Cleveref and Fancref: There are some reasons why you should use \usepackage{cleveref} (see long answerlong answer). With that, you can do something like

\usepackage[nameinlink]{cleveref}
 ...
 As you can see in \cref{sec:abc} ...

which might translate to

 As you can see in section 7

where "section 7" is linked. Additionally, you can pass language options to cleveref which might make translation easier.

So there are some important reasons for using your own convention for label-namespaces.

Collaboration is the only reason for using a "well known namespace scheme" like fig: for figures and sec: for sections.

However, LaTeX doesn't care about label namespaces. They are just a part of the name of the label.

I'm currently writing some lecture notes for "Geometry and Topology" (in German). With that project I've learned why namespaces for labels make sense.

Avoid double labels: I have had problems without prefixes like fig: and sec: or bsp: (for examples) or thm:, because of double labels. Quite often, I have had a figure I want to reference and a theorem. Namespaces solve that problem nicely.

Make code easier to read

Avoid mix-ups: Sometimes, I wanted to reference sections. So I was sure the section had a label, e.g. \label{lifting}. But in fact, that label was chosen for a figure. This would not have happened when I had prefixes. With prefixes, LaTeX would produce some ?? and make it obvious that I made an error.

After I have seen the screenshot from above, I think there is another advantage for you:

Autocompletion: I guess most of the time you know if you want to reference a figure, a section, a table or whatever. This way, you reduce the number of elements you actually need to think about quite a lot. (By the way, what editor do you use? I still type my LaTeX with gEdit / pluma mot of the time ... maybe you have a better alternative?)

Cleveref and Fancref: There are some reasons why you should use \usepackage{cleveref} (see long answer). With that, you can do something like

\usepackage[nameinlink]{cleveref}
 ...
 As you can see in \cref{sec:abc} ...

which might translate to

 As you can see in section 7

where "section 7" is linked. Additionally, you can pass language options to cleveref which might make translation easier.

So there are some important reasons for using your own convention for label-namespaces.

Collaboration is the only reason for using a "well known namespace scheme" like fig: for figures and sec: for sections.

However, LaTeX doesn't care about label namespaces. They are just a part of the name of the label.

I'm currently writing some lecture notes for "Geometry and Topology" (in German). With that project I've learned why namespaces for labels make sense.

Avoid double labels: I have had problems without prefixes like fig: and sec: or bsp: (for examples) or thm:, because of double labels. Quite often, I have had a figure I want to reference and a theorem. Namespaces solve that problem nicely.

Make code easier to read

Avoid mix-ups: Sometimes, I wanted to reference sections. So I was sure the section had a label, e.g. \label{lifting}. But in fact, that label was chosen for a figure. This would not have happened when I had prefixes. With prefixes, LaTeX would produce some ?? and make it obvious that I made an error.

After I have seen the screenshot from above, I think there is another advantage for you:

Autocompletion: I guess most of the time you know if you want to reference a figure, a section, a table or whatever. This way, you reduce the number of elements you actually need to think about quite a lot. (By the way, what editor do you use? I still type my LaTeX with gEdit / pluma mot of the time ... maybe you have a better alternative?)

Cleveref and Fancref: There are some reasons why you should use \usepackage{cleveref} (see long answer). With that, you can do something like

\usepackage[nameinlink]{cleveref}
 ...
 As you can see in \cref{sec:abc} ...

which might translate to

 As you can see in section 7

where "section 7" is linked. Additionally, you can pass language options to cleveref which might make translation easier.

So there are some important reasons for using your own convention for label-namespaces.

Collaboration is the only reason for using a "well known namespace scheme" like fig: for figures and sec: for sections.

However, LaTeX doesn't care about label namespaces. They are just a part of the name of the label.

added 493 characters in body
Source Link
Martin Thoma
  • 19.1k
  • 22
  • 108
  • 228

I'm currently writing some lecture notes for "Geometry and Topology" (in German). With that project I've learned why namespaces for labels make sense.

Avoid double labels: I have had problems without prefixes like fig: and sec: or bsp: (for examples) or thm:, because of double labels. Quite often, I have had a figure I want to reference and a theorem. Namespaces solve that problem nicely.

Make code easier to read

Avoid mix-ups: Sometimes, I wanted to reference sections. So I was sure the section had a label, e.g. \label{lifting}. But in fact, that label was chosen for a figure. This would not have happened when I had prefixes. With prefixes, LaTeX would produce some ?? and make it obvious that I made an error.

After I have seen the screenshot from above, I think there is another advantage for you:

Autocompletion: I guess most of the time you know if you want to reference a figure, a section, a table or whatever. This way, you reduce the number of elements you actually need to think about quite a lot. (By the way, what editor do you use? I still type my LaTeX with gEdit / pluma mot of the time ... maybe you have a better alternative?)

Cleveref and Fancref: There are some reasons why you should use \usepackage{cleveref} (see long answer). With that, you can do something like

\usepackage[nameinlink]{cleveref}
 ...
 As you can see in \cref{sec:abc} ...

which might translate to

 As you can see in section 7

where "section 7" is linked. Additionally, you can pass language options to cleveref which might make translation easier.

So there are some important reasons for using your own convention for label-namespaces.

Collaboration is the only reason for using a "well known namespace scheme" like fig: for figures and sec: for sections.

However, LaTeX doesn't care about label namespaces. They are just a part of the name of the label.

I'm currently writing some lecture notes for "Geometry and Topology" (in German). With that project I've learned why namespaces for labels make sense.

Avoid double labels: I have had problems without prefixes like fig: and sec: or bsp: (for examples) or thm:, because of double labels. Quite often, I have had a figure I want to reference and a theorem. Namespaces solve that problem nicely.

Make code easier to read

Avoid mix-ups: Sometimes, I wanted to reference sections. So I was sure the section had a label, e.g. \label{lifting}. But in fact, that label was chosen for a figure. This would not have happened when I had prefixes. With prefixes, LaTeX would produce some ?? and make it obvious that I made an error.

After I have seen the screenshot from above, I think there is another advantage for you:

Autocompletion: I guess most of the time you know if you want to reference a figure, a section, a table or whatever. This way, you reduce the number of elements you actually need to think about quite a lot. (By the way, what editor do you use? I still type my LaTeX with gEdit / pluma mot of the time ... maybe you have a better alternative?)

So there are some important reasons for using your own convention for label-namespaces.

Collaboration is the only reason for using a "well known namespace scheme" like fig: for figures and sec: for sections.

However, LaTeX doesn't care about label namespaces. They are just a part of the name of the label.

I'm currently writing some lecture notes for "Geometry and Topology" (in German). With that project I've learned why namespaces for labels make sense.

Avoid double labels: I have had problems without prefixes like fig: and sec: or bsp: (for examples) or thm:, because of double labels. Quite often, I have had a figure I want to reference and a theorem. Namespaces solve that problem nicely.

Make code easier to read

Avoid mix-ups: Sometimes, I wanted to reference sections. So I was sure the section had a label, e.g. \label{lifting}. But in fact, that label was chosen for a figure. This would not have happened when I had prefixes. With prefixes, LaTeX would produce some ?? and make it obvious that I made an error.

After I have seen the screenshot from above, I think there is another advantage for you:

Autocompletion: I guess most of the time you know if you want to reference a figure, a section, a table or whatever. This way, you reduce the number of elements you actually need to think about quite a lot. (By the way, what editor do you use? I still type my LaTeX with gEdit / pluma mot of the time ... maybe you have a better alternative?)

Cleveref and Fancref: There are some reasons why you should use \usepackage{cleveref} (see long answer). With that, you can do something like

\usepackage[nameinlink]{cleveref}
 ...
 As you can see in \cref{sec:abc} ...

which might translate to

 As you can see in section 7

where "section 7" is linked. Additionally, you can pass language options to cleveref which might make translation easier.

So there are some important reasons for using your own convention for label-namespaces.

Collaboration is the only reason for using a "well known namespace scheme" like fig: for figures and sec: for sections.

However, LaTeX doesn't care about label namespaces. They are just a part of the name of the label.

added autocompletion
Source Link
Martin Thoma
  • 19.1k
  • 22
  • 108
  • 228

I'm currently writing some lecture notes for "Geometry and Topology" (in German). With that project I've learned why namespaces for labels make sense.

Avoid double labels: I have had problems without prefixes like fig: and sec: or bsp: (for examples) or thm:, because of double labels. Quite often, I have had a figure I want to reference and a theorem. Namespaces solve that problem nicely.

Make code easier to read

Avoid mix-ups: Sometimes, I wanted to reference sections. So I was sure the section had a label, e.g. \label{lifting}. But in fact, that label was chosen for a figure. This would not have happened when I had prefixes. With prefixes, LaTeX would produce some ?? and make it obvious that I made an error.

After I have seen the screenshot from above, I think there is another advantage for you:

Autocompletion: I guess most of the time you know if you want to reference a figure, a section, a table or whatever. This way, you reduce the number of elements you actually need to think about quite a lot. (By the way, what editor do you use? I still type my LaTeX with gEdit / pluma mot of the time ... maybe you have a better alternative?)

So there are some important reasons for using your own convention for label-namespaces.

Collaboration is the only reason for using a "well known namespace scheme" like fig: for figures and sec: for sections.

However, LaTeX doesn't care about label namespaces. They are just a part of the name of the label.

I'm currently writing some lecture notes for "Geometry and Topology" (in German). With that project I've learned why namespaces for labels make sense.

Avoid double labels: I have had problems without prefixes like fig: and sec: or bsp: (for examples) or thm:, because of double labels. Quite often, I have had a figure I want to reference and a theorem. Namespaces solve that problem nicely.

Make code easier to read

Avoid mix-ups: Sometimes, I wanted to reference sections. So I was sure the section had a label, e.g. \label{lifting}. But in fact, that label was chosen for a figure. This would not have happened when I had prefixes. With prefixes, LaTeX would produce some ?? and make it obvious that I made an error.

So there are some important reasons for using your own convention for label-namespaces.

Collaboration is the only reason for using a "well known namespace scheme" like fig: for figures and sec: for sections.

However, LaTeX doesn't care about label namespaces. They are just a part of the name of the label.

I'm currently writing some lecture notes for "Geometry and Topology" (in German). With that project I've learned why namespaces for labels make sense.

Avoid double labels: I have had problems without prefixes like fig: and sec: or bsp: (for examples) or thm:, because of double labels. Quite often, I have had a figure I want to reference and a theorem. Namespaces solve that problem nicely.

Make code easier to read

Avoid mix-ups: Sometimes, I wanted to reference sections. So I was sure the section had a label, e.g. \label{lifting}. But in fact, that label was chosen for a figure. This would not have happened when I had prefixes. With prefixes, LaTeX would produce some ?? and make it obvious that I made an error.

After I have seen the screenshot from above, I think there is another advantage for you:

Autocompletion: I guess most of the time you know if you want to reference a figure, a section, a table or whatever. This way, you reduce the number of elements you actually need to think about quite a lot. (By the way, what editor do you use? I still type my LaTeX with gEdit / pluma mot of the time ... maybe you have a better alternative?)

So there are some important reasons for using your own convention for label-namespaces.

Collaboration is the only reason for using a "well known namespace scheme" like fig: for figures and sec: for sections.

However, LaTeX doesn't care about label namespaces. They are just a part of the name of the label.

Source Link
Martin Thoma
  • 19.1k
  • 22
  • 108
  • 228
Loading