[Tex/LaTex] Define numeric variable in terms of another variable


So, I have a variable called number which I define like so:


I'd like to automatically define a number which will give me 1-number (in this case, which would give me 0.75). I tried doing this:


However, this didn't seem to work. It seems like the engine doesn't realize that I want to subtract \number from 1. Could anyone help me fix this syntax? Thanks 🙂

Best Answer

You can use pgf package for this. Instead TeX primitive \def one need use \pgfmathsetmacro



The value of \verb|\first| is \first

The value of \verb|\second| is \second

enter image description here

Related Question