LaTeX Why is 'pdflatex -halt-on-error -interaction=batchmode' failing?

  • Thread starter Thread starter sineth
  • Start date Start date
  • Tags Tags
    Failing
AI Thread Summary
The discussion centers on troubleshooting a problem with generating a PDF file from a LaTeX document using Matlab and Dynare. The user, Sineth, encounters a warning indicating that the TeX file did not compile and needs manual compilation, despite previously generating the PDF successfully. Sineth has updated MiKTeX and is unsure if deleting history files is necessary to resolve the issue. Responses suggest backing up previously generated PDF files and deleting them to start fresh. It is noted that the error may stem from skipped steps in generating intermediary data, leading to mismatched data in later steps. A recommendation is made to compile the LaTeX file manually to identify specific error messages from pdftex, which could provide insight into the compilation failure. Additionally, an alternative code snippet is proposed to capture and display error messages directly in Matlab, streamlining the troubleshooting process.
sineth
Messages
3
Reaction score
0
Hi,
I am using Matlab, and Dynare to run a model.
I have the following codes to generate the Latex file. My codes were properly working and I generated the pdf file once. Now I cannot re-generate the same pdf file. I get the warning message ('TeX-File did not compile; you need to compile it manually'
Can someone please identify any issues here? I have updated MiKTeX and checked for updates. No issue is found.
My problem is as I have generated the pdf once, do I need to delete the history files or so. Otherwise how to resolve this iissue.
Thanks
Sineth

write_latex_definitions;
write_latex_parameter_table;
write_latex_original_model;
write_latex_dynamic_model;
write_latex_static_model;
write_latex_steady_state_model;
collect_latex_files;

if system(['pdflatex -halt-on-error -interaction=batchmode ' M_.fname '_TeX_binder.tex'])
warning('TeX-File did not compile; you need to compile it manually')
 
Physics news on Phys.org
First i would save the relevant pdf files that worked previously for backup, then delete them and start again.

It may be that some step skipped over generating some intermediary data and read in the old data that a later step determined didn't match up hence the error.

Beyond that there's not much we can do here since there's little to go on unless one of us at PF has encountered this error with a similar project and recall how we fixed it.
 
Thanks for the reply @jedishrfu. I have tried after deleting all pdf files generated. But get the same error.
 
To determine the cause, compile it manually and look at the actual error message(s) generated by pdftex.
 
Thanks
 
Rather than
Code:
if system(['pdflatex -halt-on-error -interaction=batchmode ' M_.fname '_TeX_binder.tex'])
    warning('TeX-File did not compile; you need to compile it manually')
why not try
Code:
[status,cmdout] = system(['pdflatex -halt-on-error -interaction=batchmode ' M_.fname '_TeX_binder.tex'])
if status
   disp(cmdout)
and if an error occurs MATLAB will print the actual console output of pdftex, removing the need to rerun it manually in order to diagnose the error.
 

Similar threads

Replies
23
Views
3K
Replies
2
Views
2K
Replies
1
Views
2K
Replies
7
Views
12K
Replies
2
Views
4K
Replies
4
Views
5K
Replies
1
Views
2K
Replies
8
Views
12K
Back
Top