" pdfLatex已停止工作"从Matlab调用时提示

时间:2014-08-11 11:26:07

标签: matlab report latex tex pdflatex

我想在matlab中调用pdflatex。代码在

之下
clc;
% analysis
i = 10;
n = 'Ashwani Roy';
x = 1:0.5:100;
y = sin(x.^2);
plot(x,y);
saveas(gcf, 'output', 'png')
%% write to tex
fid = fopen('Report.tex','w');
fprintf(fid,'%s\n','\documentclass{article}');
fprintf(fid,'%s\n','\usepackage{graphicx}');
fprintf(fid,'%s\n','\begin{document}');
fprintf(fid,'%s\n',strcat(num2str(i),':',n));
fprintf(fid,'%s\n','Some other text blah blah ');
fprintf(fid,'%s\n','\includegraphics{output.png}');
fprintf(fid,'%s\n','\end{document}');
fclose(fid);
%% DOS Invoke 
[status,cmdout] =dos('"C:/Program Files (x86)/MiKTeX 2.9/...
                       miktex/bin/pdflatex.exe" -shell-escape ...
                      --src -interaction=nonstopmode Report.tex');

它起作用并创建一个Report.pdf,它包含我想要的数据,但它会抛出Windows错误提示,说明 psdlatex.exe已停止工作。请关闭或调试该程序。

我想知道如何抑制此提示或修复此根本原因。

1 个答案:

答案 0 :(得分:2)

找到修复程序。我刚刚重新安装了整个MikTex 2.9,它解决了这个问题。不确定是什么原因导致线程死亡,但可能是不完整的安装。