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
Dóra Kocsis
dynare
Commits
3539dc71
Commit
3539dc71
authored
Dec 09, 2013
by
Houtan Bastani
Browse files
write_latex_definitions: use longtable, #478
parent
54b3a18c
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/write_latex_definitions.m
View file @
3539dc71
...
...
@@ -39,18 +39,29 @@ else
M_var_root
=
{
'M_.endo'
,
'M_.exo'
,
'M_.exo_det'
,
'M_.param'
};
end
fid
=
fopen
([
M_
.
fname
'_latex_definitions.tex'
],
'w'
);
fprintf
(
fid
,
'\\documentclass[1
0
pt,a4paper]{article}\n'
);
fprintf
(
fid
,
'\\usepackage{
geometry
}\n'
);
fprintf
(
fid
,
'\\documentclass[1
2
pt,a4paper]{article}\n'
);
fprintf
(
fid
,
'\\usepackage{
longtable
}\n'
);
fprintf
(
fid
,
'\\begin{document}\n'
);
for
i
=
1
:
length
(
tables
)
fprintf
(
fid
,
'\\begin{table}[ht]\n'
);
fprintf
(
fid
,
[
'\\caption{'
tables
{
i
}
'}\n'
]);
fprintf
(
fid
,
'\\centering\n'
);
fprintf
(
fid
,
'\\begin{tabular}{c c c}\n'
);
fprintf
(
fid
,
'\\hline\\hline\n'
);
fprintf
(
fid
,
'Variable & LaTeX & Description\\\\\n'
);
fprintf
(
fid
,
'\\hline\n'
);
fprintf
(
fid
,
'\\begin{center}\n'
);
fprintf
(
fid
,
'\\begin{longtable}{ccc}\n'
);
fprintf
(
fid
,
[
'\\caption{'
tables
{
i
}
'}\\\\%%\n'
]);
fprintf
(
fid
,
'\\hline%%\n'
);
fprintf
(
fid
,
'\\multicolumn{1}{c}{\\textbf{Variable}} &\n'
);
fprintf
(
fid
,
'\\multicolumn{1}{c}{\\textbf{\\LaTeX}} &\n'
);
fprintf
(
fid
,
'\\multicolumn{1}{c}{\\textbf{Description}}\\\\%%\n'
);
fprintf
(
fid
,
'\\hline\\hline%%\n'
);
fprintf
(
fid
,
'\\endfirsthead\n'
);
fprintf
(
fid
,
'\\multicolumn{3}{c}{{\\tablename} \\thetable{} -- Continued}\\\\%%\n'
);
fprintf
(
fid
,
'\\hline%%\n'
);
fprintf
(
fid
,
'\\multicolumn{1}{c}{\\textbf{Variable}} &\n'
);
fprintf
(
fid
,
'\\multicolumn{1}{c}{\\textbf{\\LaTeX}} &\n'
);
fprintf
(
fid
,
'\\multicolumn{1}{c}{\\textbf{Description}}\\\\%%\n'
);
fprintf
(
fid
,
'\\hline\\hline%%\n'
);
fprintf
(
fid
,
'\\endhead\n'
);
names
=
eval
([
M_var_root
{
i
}
'_names'
]);
tex
=
eval
([
M_var_root
{
i
}
'_names_tex'
]);
...
...
@@ -61,11 +72,10 @@ for i=1:length(tables)
strtrim
(
tex
(
j
,:)),
...
regexprep
(
strtrim
(
long
(
j
,:)),
'_'
,
'\\_'
));
end
fprintf
(
fid
,
'\\hline\n'
);
fprintf
(
fid
,
'\\end{tabular}\n'
);
fprintf
(
fid
,
'\\end{table}\n'
);
fprintf
(
fid
,
'\\newpage\n'
);
fprintf
(
fid
,
'\\hline%%\n'
);
fprintf
(
fid
,
'\\end{longtable}\n'
);
fprintf
(
fid
,
'\\end{center}\n'
);
fprintf
(
fid
,
'\\newpage\n\n'
);
end
fprintf
(
fid
,
'\\end{document}\n'
);
...
...
Write
Preview
Supports
Markdown
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