I want to define a global variable whose name is dynamic and assigned by using a counter.
This is my code but it does not work. Moreover, I do not know how to ask latex to write the in the aux file the current value of the counter and not just \themycounter because the value of the counter changes through the document.
\documentclass{article} \usepackage{globalvals} \begin{document} \newcounter{mycounter} \setcounter{mycounter}{10} \useVal{key10} % somewhere else \defVal{key\themycounter}{test test \themycounter} \end{document}
Thank you for your time.