Hi, I'm using django-tex package for my project where I try to compile a LaTex file in a web application and send it over email. I need help in solving a problem I face.
LaTex snippet

Result

Here, I need to get rid of this "??". I don't know the cause for this problem. It normally happens with in Tex compiling software and cmd/terminal also. When same LaTex file is compiled twice it gets fixed.
Expected Result

Now we can see "1" in place of "??". It is achieved when I compiled the same file twice.
Insights
After I look into some of the codes from django-tex repo. I think, repeating below mentioned code (from core.py) twice would help solve my problem.

I'm not sure if it is a right approach, I wanted to create a discussion on this and find help from some experts on this issue.
Also, kindly help me with inputs if it is possible to override this piece of code locally to achieve result I expect.
Hi, I'm using django-tex package for my project where I try to compile a LaTex file in a web application and send it over email. I need help in solving a problem I face.
LaTex snippet
Result
Here, I need to get rid of this "??". I don't know the cause for this problem. It normally happens with in Tex compiling software and cmd/terminal also. When same LaTex file is compiled twice it gets fixed.
Expected Result
Now we can see "1" in place of "??". It is achieved when I compiled the same file twice.
Insights
After I look into some of the codes from django-tex repo. I think, repeating below mentioned code (from

core.py) twice would help solve my problem.I'm not sure if it is a right approach, I wanted to create a discussion on this and find help from some experts on this issue.
Also, kindly help me with inputs if it is possible to override this piece of code locally to achieve result I expect.