reporting: fix echo command in system searches for pdflatex
parent
6ff4d5cce7
commit
58a583c248
|
@ -46,18 +46,24 @@ if ~exist(o.filename, 'file')
|
||||||
o.write();
|
o.write();
|
||||||
end
|
end
|
||||||
|
|
||||||
|
middle = './';
|
||||||
|
if exist('OCTAVE_VERSION')
|
||||||
|
echo = 0;
|
||||||
|
else
|
||||||
|
echo = '-echo';
|
||||||
|
end
|
||||||
if isempty(compiler)
|
if isempty(compiler)
|
||||||
if strncmp(computer, 'MACI', 4) || ~isempty(regexpi(computer, '.*apple.*', 'once'))
|
if strncmp(computer, 'MACI', 4) || ~isempty(regexpi(computer, '.*apple.*', 'once'))
|
||||||
% Add most likely places for pdflatex to exist outside of default $PATH
|
% Add most likely places for pdflatex to exist outside of default $PATH
|
||||||
[status, compiler] = ...
|
[status, compiler] = ...
|
||||||
system(['PATH=$PATH:/usr/texbin:/usr/local/bin:/usr/local/sbin;' ...
|
system(['PATH=$PATH:/usr/texbin:/usr/local/bin:/usr/local/sbin;' ...
|
||||||
'which pdflatex'], '-echo');
|
'which pdflatex'], echo);
|
||||||
elseif strcmp(computer, 'PCWIN') || strcmp(computer, 'PCWIN64')
|
elseif strcmp(computer, 'PCWIN') || strcmp(computer, 'PCWIN64')
|
||||||
error(['@report.compile: On Windows machines, you must explicitly ' ...
|
error(['@report.compile: On Windows machines, you must explicitly ' ...
|
||||||
'provide the ''compiler'' option or set the compiler ' ...
|
'provide the ''compiler'' option or set the compiler ' ...
|
||||||
'variable in the Report class']);
|
'variable in the Report class']);
|
||||||
else % gnu/linux
|
else % gnu/linux
|
||||||
[status, compiler] = system('which pdflatex', '-echo');
|
[status, compiler] = system('which pdflatex', echo);
|
||||||
end
|
end
|
||||||
assert(status == 0, ...
|
assert(status == 0, ...
|
||||||
'@report.compile: Could not find a tex compiler on your system');
|
'@report.compile: Could not find a tex compiler on your system');
|
||||||
|
@ -65,11 +71,7 @@ if isempty(compiler)
|
||||||
o.compiler = compiler;
|
o.compiler = compiler;
|
||||||
end
|
end
|
||||||
|
|
||||||
if exist('OCTAVE_VERSION')
|
status = system([compiler middle o.filename], echo);
|
||||||
status = system([compiler ' ./' o.filename], 0);
|
|
||||||
else
|
|
||||||
status = system([compiler ' ./' o.filename], '-echo');
|
|
||||||
end
|
|
||||||
[junk, rfn, junk] = fileparts(o.filename);
|
[junk, rfn, junk] = fileparts(o.filename);
|
||||||
|
|
||||||
if status ~= 0
|
if status ~= 0
|
||||||
|
|
Loading…
Reference in New Issue