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

  • Context: LaTeX 
  • Thread starter Thread starter sineth
  • Start date Start date
  • Tags Tags
    Failing
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting an issue with generating a PDF file from LaTeX using Matlab and Dynare. Participants are exploring potential causes for the failure of the command 'pdflatex -halt-on-error -interaction=batchmode' and suggesting methods to diagnose and resolve the problem.

Discussion Character

  • Technical explanation, Debate/contested, Experimental/applied

Main Points Raised

  • One participant, Sineth, describes an issue where a previously successful PDF generation now fails, receiving a warning about manual compilation.
  • Another participant suggests backing up the existing PDF files, deleting them, and starting the process anew, hypothesizing that old data may be causing the error.
  • Sineth responds that deleting the PDF files did not resolve the issue.
  • A different participant recommends compiling the LaTeX file manually to view the specific error messages generated by pdftex, which could provide more insight into the problem.
  • Another suggestion involves modifying the command to capture the output and status of the system call, which could help diagnose the error without needing to compile manually.

Areas of Agreement / Disagreement

Participants express various approaches to troubleshooting the issue, but there is no consensus on a definitive solution. Multiple competing views on how to diagnose and resolve the problem remain present.

Contextual Notes

Participants have not resolved the underlying cause of the compilation failure, and there may be missing assumptions regarding the state of the files or the environment setup.

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.
 
  • Like
Likes   Reactions: sineth
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.
 
  • Like
Likes   Reactions: jedishrfu
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.
 
  • Like
Likes   Reactions: jedishrfu

Similar threads

  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
12K
  • · Replies 16 ·
Replies
16
Views
31K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K