Commit 1a836479 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

reporting: @report: add compiler option to compile() as alternative method to...

reporting: @report: add compiler option to compile() as alternative method to pass compiler information
parent fe68b693
......@@ -7700,6 +7700,7 @@ a clarifying example.
Instantiates a @code{Report} object.
@optionshead
@table @code
@anchor{compiler}
@item compiler, @var{FILENAME}
The full path to the @LaTeX{} compiler on your system. If this option
is not provided, Dynare will try to find the appropriate program to
......@@ -7955,10 +7956,18 @@ Writes the @LaTeX{} representation of this @code{Report}, saving it to
the file specified by @ref{filename}.
@end defmethod
@defmethod Report compile
@defmethod Report compile compiler
Compiles the report written by @ref{write} into a @code{pdf} file. If
the report has not already been written (determined by the existence
of the file specified by @ref{filename}, @ref{write} is called.
optionshead
@table @code
@item compiler, @code{FILENAME}
Like @ref{compiler}, except will not overwrite the value of
@code{compiler} contained in the report object. Hence, passing the
value here is useful for using different @LaTeX{} compilers or just
for passing the value at the last minute.
@end table
@end defmethod
@examplehead
......
function o = compile(o)
function o = compile(o, varargin)
%function o = compile(o)
% Compile Report Object
%
% INPUTS
% o [report] report object
% o [report] report object
% varargin [char] allows user to change report compiler for a
% given run of compile.
%
% OUTPUTS
% o [report] report object
......@@ -28,11 +30,22 @@ function o = compile(o)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
assert(length(varargin) == 0 || length(varargin) == 2, ...
'@report.compile: calling form: compiler, ''/path/to/compiler''.');
if length(varargin) == 2
assert(ischar(varargin{1}) && strcmp(lower(varargin{1}), 'compiler'), ...
'@report.compile: ''compiler'' is the only option.');
assert(ischar(varargin{2}), ...
'@report.compile: the argument to ''compiler'' must be a char');
compiler = varargin{2};
else
compiler = o.compiler;
end
if ~exist(o.filename, 'file')
o.write();
end
compiler = o.compiler;
if isempty(compiler)
if strcmp(computer, 'MACI') || strcmp(computer, 'MACI64')
% Add most likely places for pdflatex to
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment