Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
reporting
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Archives
reporting
Commits
061a46ef
Commit
061a46ef
authored
Jul 25, 2014
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
reporting: option to suppress reporting output. closes #688
parent
f869aa5a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
@report/addPage.m
+3
-1
3 additions, 1 deletion
@report/addPage.m
@report/compile.m
+24
-10
24 additions, 10 deletions
@report/compile.m
@report/report.m
+2
-0
2 additions, 0 deletions
@report/report.m
@report/write.m
+6
-2
6 additions, 2 deletions
@report/write.m
with
35 additions
and
13 deletions
@report/addPage.m
+
3
−
1
View file @
061a46ef
...
@@ -30,6 +30,8 @@ function o = addPage(o, varargin)
...
@@ -30,6 +30,8 @@ function o = addPage(o, varargin)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
np
=
length
(
o
.
pages
)
+
1
;
np
=
length
(
o
.
pages
)
+
1
;
if
o
.
showOutput
fprintf
(
1
,
'Adding Page: %d\n'
,
np
);
fprintf
(
1
,
'Adding Page: %d\n'
,
np
);
end
o
.
pages
{
np
}
=
page
(
'orientation'
,
o
.
orientation
,
'paper'
,
o
.
paper
,
varargin
{:});
o
.
pages
{
np
}
=
page
(
'orientation'
,
o
.
orientation
,
'paper'
,
o
.
paper
,
varargin
{:});
end
end
This diff is collapsed.
Click to expand it.
@report/compile.m
+
24
−
10
View file @
061a46ef
...
@@ -32,7 +32,7 @@ function o = compile(o, varargin)
...
@@ -32,7 +32,7 @@ function o = compile(o, varargin)
opts
.
compiler
=
o
.
compiler
;
opts
.
compiler
=
o
.
compiler
;
opts
.
showReport
=
true
;
opts
.
showReport
=
true
;
opts
.
showOutput
=
true
;
opts
.
showOutput
=
o
.
showOutput
;
if
nargin
>
1
if
nargin
>
1
if
round
((
nargin
-
1
)/
2
)
~=
(
nargin
-
1
)/
2
if
round
((
nargin
-
1
)/
2
)
~=
(
nargin
-
1
)/
2
...
@@ -71,15 +71,28 @@ end
...
@@ -71,15 +71,28 @@ end
if
isempty
(
opts
.
compiler
)
if
isempty
(
opts
.
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
if
opts
.
showOutput
[
status
,
opts
.
compiler
]
=
...
[
status
,
opts
.
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
);
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'
)
elseif
strcmp
(
computer
,
'PCWIN'
)
||
strcmp
(
computer
,
'PCWIN64'
)
if
opts
.
showOutput
[
status
,
opts
.
compiler
]
=
system
(
'findtexmf --file-type=exe pdflatex'
,
echo
);
[
status
,
opts
.
compiler
]
=
system
(
'findtexmf --file-type=exe pdflatex'
,
echo
);
else
[
status
,
opts
.
compiler
]
=
system
(
'findtexmf --file-type=exe pdflatex'
);
end
middle
=
' '
;
middle
=
' '
;
opts
.
compiler
=
[
'"'
strtrim
(
opts
.
compiler
)
'"'
];
opts
.
compiler
=
[
'"'
strtrim
(
opts
.
compiler
)
'"'
];
else
% gnu/linux
else
% gnu/linux
if
opts
.
showOutput
[
status
,
opts
.
compiler
]
=
system
(
'which pdflatex'
,
echo
);
[
status
,
opts
.
compiler
]
=
system
(
'which pdflatex'
,
echo
);
else
[
status
,
opts
.
compiler
]
=
system
(
'which pdflatex'
);
end
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'
);
...
@@ -98,10 +111,11 @@ if status ~= 0
...
@@ -98,10 +111,11 @@ if status ~= 0
error
([
'@report.compile: There was an error in compiling '
rfn
'.pdf.'
...
error
([
'@report.compile: There was an error in compiling '
rfn
'.pdf.'
...
' '
compiler
' returned the error code: '
num2str
(
status
)]);
' '
compiler
' returned the error code: '
num2str
(
status
)]);
end
end
fprintf
(
1
,
'\n\nDone.\n'
);
if
o
.
showOutput
||
opts
.
showOutput
fprintf
(
1
,
'Done.\n'
);
disp
(
'Your compiled report is located here:'
);
disp
(
'Your compiled report is located here:'
);
disp
([
' '
pwd
filesep
rfn
'.pdf'
]);
disp
([
' '
pwd
filesep
rfn
'.pdf'
]);
end
if
opts
.
showReport
&&
~
isoctave
if
opts
.
showReport
&&
~
isoctave
open
([
pwd
filesep
rfn
'.pdf'
]);
open
([
pwd
filesep
rfn
'.pdf'
]);
end
end
...
...
This diff is collapsed.
Click to expand it.
@report/report.m
+
2
−
0
View file @
061a46ef
...
@@ -41,6 +41,7 @@ o.pages = {};
...
@@ -41,6 +41,7 @@ o.pages = {};
o
.
fileName
=
'report.tex'
;
o
.
fileName
=
'report.tex'
;
o
.
showDate
=
true
;
o
.
showDate
=
true
;
o
.
compiler
=
''
;
o
.
compiler
=
''
;
o
.
showOutput
=
true
;
if
nargin
==
1
if
nargin
==
1
assert
(
isa
(
varargin
{
1
},
'report'
),
[
'@report.report: with one arg, '
...
assert
(
isa
(
varargin
{
1
},
'report'
),
[
'@report.report: with one arg, '
...
...
@@ -72,6 +73,7 @@ assert(ischar(o.title), '@report.report: title must be a string');
...
@@ -72,6 +73,7 @@ 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
.
fileName
),
'@report.report: fileName must be a string'
);
assert
(
ischar
(
o
.
compiler
),
'@report.report: compiler 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
(
islogical
(
o
.
showDate
),
'@report.report: showDate must be either true or false'
);
assert
(
islogical
(
o
.
showOutput
),
'@report.report: showOutput must be either true or false'
);
assert
(
isfloat
(
o
.
margin
)
&&
o
.
margin
>
0
,
'@report.report: margin must be a float > 0.'
);
assert
(
isfloat
(
o
.
margin
)
&&
o
.
margin
>
0
,
'@report.report: margin must be a float > 0.'
);
valid_margin_unit
=
{
'cm'
,
'in'
};
valid_margin_unit
=
{
'cm'
,
'in'
};
...
...
This diff is collapsed.
Click to expand it.
@report/write.m
+
6
−
2
View file @
061a46ef
...
@@ -80,7 +80,9 @@ fprintf(fid, '\\centering\n');
...
@@ -80,7 +80,9 @@ fprintf(fid, '\\centering\n');
nps
=
length
(
o
.
pages
);
nps
=
length
(
o
.
pages
);
for
i
=
1
:
nps
for
i
=
1
:
nps
if
o
.
showOutput
fprintf
(
1
,
'Writing Page: %d\n'
,
i
);
fprintf
(
1
,
'Writing Page: %d\n'
,
i
);
end
o
.
pages
{
i
}
.
write
(
fid
,
i
);
o
.
pages
{
i
}
.
write
(
fid
,
i
);
end
end
...
@@ -90,5 +92,7 @@ status = fclose(fid);
...
@@ -90,5 +92,7 @@ status = fclose(fid);
if
status
==
-
1
if
status
==
-
1
error
(
'@report.write: closing %s\n'
,
o
.
fileName
);
error
(
'@report.write: closing %s\n'
,
o
.
fileName
);
end
end
if
o
.
showOutput
disp
(
'Finished Writing Report!'
);
disp
(
'Finished Writing Report!'
);
end
end
end
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