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
18de5a2b
Commit
18de5a2b
authored
Jul 03, 2015
by
Houtan Bastani
Browse files
reporting: add latex option to page class
parent
12d9ea21
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/@page/page.m
View file @
18de5a2b
...
...
@@ -38,6 +38,7 @@ o.titleTruncate = '';
o
.
orientation
=
''
;
o
.
footnote
=
{};
o
.
sections
=
{};
o
.
latex
=
''
;
if
nargin
==
1
assert
(
isa
(
varargin
{
1
},
'page'
),
[
'@page.page: with one arg to Page '
...
...
...
@@ -80,8 +81,9 @@ assert(iscellstr(o.titleFormat), ...
'@page.page: titleFormat must be a cell array of strings'
);
assert
((
ischar
(
o
.
titleTruncate
)
&&
isempty
(
o
.
titleTruncate
))
||
...
isint
(
o
.
titleTruncate
),
...
'@page.page: titleTruncate must be empty or an integer.'
);
'@page.page: titleTruncate must be empty or an integer.'
);
assert
(
ischar
(
o
.
latex
),
...
'@page.page: latex must be a string'
);
valid_paper
=
{
'a4'
,
'letter'
};
assert
(
any
(
strcmp
(
o
.
paper
,
valid_paper
)),
...
[
'@page.page: paper must be one of '
strjoin
(
valid_paper
,
' '
)]);
...
...
src/@page/write.m
View file @
18de5a2b
...
...
@@ -42,22 +42,26 @@ for i=1:length(o.footnote)
end
fprintf
(
fid
,
'\n'
);
fprintf
(
fid
,
'\\begin{tabular}[t]{c}\n'
);
for
i
=
1
:
length
(
o
.
title
)
if
isint
(
o
.
titleTruncate
)
if
length
(
o
.
title
{
i
})
>
o
.
titleTruncate
o
.
title
{
i
}
=
o
.
title
{
i
}(
1
:
o
.
titleTruncate
);
if
~
isempty
(
o
.
latex
)
fprintf
(
fid
,
'%s'
,
o
.
latex
);
else
fprintf
(
fid
,
'\\begin{tabular}[t]{c}\n'
);
for
i
=
1
:
length
(
o
.
title
)
if
isint
(
o
.
titleTruncate
)
if
length
(
o
.
title
{
i
})
>
o
.
titleTruncate
o
.
title
{
i
}
=
o
.
title
{
i
}(
1
:
o
.
titleTruncate
);
end
end
fprintf
(
fid
,
'\\multicolumn{1}{c}{%s %s}\\\\\n'
,
o
.
titleFormat
{
i
},
o
.
title
{
i
});
end
fprintf
(
fid
,
'\\multicolumn{1}{c}{%s %s}\\\\\n'
,
o
.
titleFormat
{
i
},
o
.
title
{
i
});
end
nps
=
length
(
o
.
sections
);
for
i
=
1
:
nps
o
.
sections
{
i
}
.
write
(
fid
,
pg
,
i
);
nps
=
length
(
o
.
sections
);
for
i
=
1
:
nps
o
.
sections
{
i
}
.
write
(
fid
,
pg
,
i
);
end
fprintf
(
fid
,
'\\end{tabular}\n'
);
end
fprintf
(
fid
,
'\\end{tabular}\n'
);
if
strcmpi
(
o
.
orientation
,
'landscape'
)
fprintf
(
fid
,
'\\end{landscape}\n'
);
end
...
...
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