Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dynare
reporting
Commits
0850ee43
Commit
0850ee43
authored
Jun 11, 2015
by
Houtan Bastani
Committed by
root
Jun 11, 2015
Browse files
simplify compile.m
parent
4971c306
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/@report/compile.m
View file @
0850ee43
...
...
@@ -62,44 +62,34 @@ if ~exist(o.fileName, 'file')
end
middle
=
' ./'
;
options
=
'-synctex=1 -halt-on-error'
;
if
isoctave
echo
=
1
;
else
echo
=
'-echo'
;
end
if
isempty
(
opts
.
compiler
)
if
strncmp
(
computer
,
'MACI'
,
4
)
||
~
isempty
(
regexpi
(
computer
,
'.*apple.*'
,
'once'
))
status
=
1
;
if
ismac
% Add most likely places for pdflatex to exist outside of default $PATH
if
opts
.
showOutput
[
status
,
opts
.
compiler
]
=
...
system
([
'PATH=$PATH:/usr/texbin:/usr/local/bin:/usr/local/sbin;'
...
'which pdflatex'
],
echo
);
else
[
status
,
opts
.
compiler
]
=
...
system
(
'PATH=$PATH:/usr/texbin:/usr/local/bin:/usr/local/sbin;which pdflatex'
);
end
elseif
strcmp
(
computer
,
'PCWIN'
)
||
strcmp
(
computer
,
'PCWIN64'
)
if
opts
.
showOutput
[
status
,
opts
.
compiler
]
=
system
(
'findtexmf --file-type=exe pdflatex'
,
echo
);
else
[
status
,
opts
.
compiler
]
=
system
(
'findtexmf --file-type=exe pdflatex'
);
end
[
status
,
opts
.
compiler
]
=
...
system
(
'PATH=$PATH:/usr/texbin:/usr/local/bin:/usr/local/sbin;which pdflatex'
);
elseif
ispc
[
status
,
opts
.
compiler
]
=
system
(
'findtexmf --file-type=exe pdflatex'
);
middle
=
' '
;
opts
.
compiler
=
[
'"'
strtrim
(
opts
.
compiler
)
'"'
];
else
% gnu/linux
if
opts
.
showOutput
[
status
,
opts
.
compiler
]
=
system
(
'which pdflatex'
,
echo
);
else
[
status
,
opts
.
compiler
]
=
system
(
'which pdflatex'
);
end
elseif
isunix
[
status
,
opts
.
compiler
]
=
system
(
'which pdflatex'
);
end
assert
(
status
==
0
,
...
'@report.compile: Could not find a tex compiler on your system'
);
opts
.
compiler
=
strtrim
(
opts
.
compiler
);
o
.
compiler
=
opts
.
compiler
;
if
opts
.
showOutput
disp
([
'Using compiler: '
o
.
compiler
]);
end
end
options
=
'-synctex=1 -halt-on-error'
;
if
isoctave
echo
=
1
;
else
echo
=
'-echo'
;
end
if
opts
.
showOutput
status
=
system
([
opts
.
compiler
' '
options
middle
o
.
fileName
],
echo
);
else
...
...
@@ -112,9 +102,7 @@ if status ~= 0
' '
compiler
' returned the error code: '
num2str
(
status
)]);
end
if
o
.
showOutput
||
opts
.
showOutput
fprintf
(
1
,
'Done.\n'
);
disp
(
'Your compiled report is located here:'
);
disp
([
' '
pwd
filesep
rfn
'.pdf'
]);
fprintf
(
1
,
[
'Done.\nYour compiled report is located here:\n '
pwd
filesep
rfn
'.pdf'
]);
end
if
opts
.
showReport
&&
~
isoctave
open
([
pwd
filesep
rfn
'.pdf'
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment