There is a package I'm trying to modify that essentially displays a grid. It uses counters to increment the distance. I want to change the distance each step instead of adding a constant value. In fact, I simply want to multiply the current distance by a constant.
Anyways, I'm confused about how to use counters in TeX, compute things, and mixing LaTeX. When I try to use
\newcounter in the package I get errors about redefinitions.
I've tried to use the
calc package but cannot get it to mingle with the text.
\advance\pos by 1
which instead of advancing it by 1 I want to advance it by 1, then 0.5, 0.25, etc... (it is in a loop)
I've even tried to advance it by a constant 0.5 and it gives an error. (as if one can only advance by integer amounts)
What I really want is some tutorial or guidance on what a package is and how to go about writing one. Is it TeX only and nothing special (I don't know much about TeX but have used LaTeX for typesetting for a several years)? Is there some special thing about packages? Can one mix TeX and LaTeX in a package? (doesn't seem so)
What I really need to know is how to do simple programmatical things like loops, variables, calculations, etc...
In the package I'm trying to modify I see things like
\divide, etc. Which seem to correspond to the things I'm interested in but I can't find any references on the syntax or simple examples. Typing those into Google just returns a bunch of random packages that use them.
What I need to accomplish now is two things. I need to "advance" a counter by a geometrical progression instead of arithmetical (multiply instead of add) and I need to linearly interpolate between two points instead of using a constant.
In fact, in case anyone is interested, the package I'm trying to modify is
What I want to do is have the fret lines drawn like a real fretboard (or approximately). Make the width of the fretboard start lower and gradually increase (it should be independent of the number of frets). Allow one to color the dots and add fret markers (3, 5, 7, 9, 12,.... frets).
I'd rather learn to write my own. Would be a piece of cake in something like C/C++ but I have no idea about TeX.