[OS X TeX] Inserting text based on length of its input?

Charilaos Skiadas cskiadas at gmail.com
Tue May 6 20:51:49 EDT 2008


Sorry, couldn't come up with a better title. It's also not mac  
specific. The situation is the following: I want to create links in  
my text to the pages in a website that have corresponding figures. So  
for instance I want a command that on \fig{2}[3} will produce the  
text "Figure 2.3", and have it be a hyperlink to the following address:

http://lmdvr.r-forge.r-project.org/figures/figures.html? 
chapter=02;figure=02_03;theme=stdColor;code=right

So I was planning to use \href for the linking, but the problem is:  
how to add that extra 0, when the chapter number or section number  
are single digits. I am guessing some kind of \newif could do the  
trick, but my if-knowledge is, shall we say, very iffy. Any help much  
appreciated. I guess to generalize the question: How do we create  
conditionals that actually check something in the text, rather than  
them relaying on us directly setting them true or false as flags.

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College







More information about the MacOSX-TeX mailing list