General ⇒ Variable naming
Variable naming
Maybe I'm worrying unnecessarily, but it concerns me that all latex variables names that I can define are global and have the potential to clash with the hundreds (or thousands) of other names found in the myriad of packages that can be used.
And, it annoys me somewhat that latex variables can only be defined using some combination of only upper or lowercase letters. Is there some convention or way that I can choose my names so that they are fairly unlikely to clash with all the other names? I wish so much that I could include an underscore or some other character just so that I can distinguish my names from every other name.
Any help or advice would be appreciated. Thanks.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Variable naming
Code: Select all
\newdimen\si@unt@powerdim
\newif\ifsi@unt@per
\newif\ifsi@unt@perseen
One thing the LaTeX3 Project is looking at is trying to make things a bit more formalised in this area. For example, we're currently looking at local variables, but the limitation is that TeX doesn't allow you to do something like:
Code: Select all
\def\macro{%
\localdimen\mylocaldimen % I've made up this function!
...
}