I got a file 'month.tex' containing only an integer. I want to set a counter to this integer and tried


This isn't working as the compiler sais

<to be read again> 
l.42 \setcounter{billmonth}{\input{month.tex}}

Does anybode have an idea how to deal with this? Thanks!

Why do I have a file containing only this integer? I use a bash script for compiling where you can pass an argument. This argument needs to find its way inside of my latex document and it was the best way i could think of.


The readarray package can help, with its \readdef{<filename>}\macro syntax.

\usepackage{filecontents}% this is only to show that it works
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.