Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
8947c52c
Commit
8947c52c
authored
12 years ago
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
reporting: @report: add compile method
parent
ef7bb4f0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/reporting/@report/compile.m
+63
-0
63 additions, 0 deletions
matlab/reporting/@report/compile.m
matlab/reporting/@report/report.m
+2
-0
2 additions, 0 deletions
matlab/reporting/@report/report.m
with
65 additions
and
0 deletions
matlab/reporting/@report/compile.m
0 → 100644
+
63
−
0
View file @
8947c52c
function
o
=
compile
(
o
)
%function o = compile(o)
% Compile Report Object
%
% INPUTS
% o [report] report object
%
% OUTPUTS
% o [report] report object
%
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2013 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
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
% exist outside of default $PATH
[
status
,
compiler
]
=
...
system
([
'PATH=$PATH:/usr/texbin:/usr/local/bin:/usr/local/sbin;'
...
'which pdflatex'
],
'-echo'
);
elseif
strcmp
(
computer
,
'PCWIN'
)
||
strcmp
(
computer
,
'PCWIN64'
)
% need to fill in for Windows
else
% gnu/linux
[
status
,
compiler
]
=
system
(
'which pdflatex'
,
'-echo'
);
end
assert
(
status
==
0
,
...
'@report.compile: Could not find a tex compiler on your system'
);
compiler
=
strtrim
(
compiler
);
o
.
compiler
=
compiler
;
end
[
status
output
]
=
system
([
compiler
' ./'
o
.
filename
],
'-echo'
);
[
junk
,
rfn
,
junk
]
=
fileparts
(
o
.
filename
);
if
status
~=
0
error
([
'@report.compile: There was an error in compiling '
rfn
'.pdf.'
...
' '
compiler
' returned the error code: '
num2str
(
status
)]);
end
fprintf
(
1
,
'\n\nDone.\n'
)
disp
(
'Your compiled report is located here:'
);
disp
([
' '
pwd
filesep
rfn
'.pdf'
]);
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
matlab/reporting/@report/report.m
+
2
−
0
View file @
8947c52c
...
...
@@ -41,6 +41,7 @@ o.pages = pages();
o
.
filename
=
'report.tex'
;
o
.
config
=
''
;
o
.
showdate
=
true
;
o
.
compiler
=
''
;
if
nargin
==
1
assert
(
isa
(
varargin
{
1
},
'report'
),
[
'@report.report: with one arg, '
...
...
...
@@ -71,6 +72,7 @@ end
assert
(
ischar
(
o
.
title
),
'@report.report: title must be a string'
);
assert
(
ischar
(
o
.
filename
),
'@report.report: filename must be a string'
);
assert
(
ischar
(
o
.
config
),
'@report.report: config file must be a string'
);
assert
(
ischar
(
o
.
compiler
),
'@report.report: compiler file must be a string'
);
assert
(
islogical
(
o
.
showdate
),
'@report.report: showdate must be either true or false'
);
assert
(
isfloat
(
o
.
margin
)
&&
o
.
margin
>
0
,
'@report.report: margin must be a float > 0.'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment