Merge branch 'tex_subfolder' into 'master'

Move remaining LaTeX-file to subfolder

Closes #1655

See merge request Dynare/dynare!1667
time-shift
Sébastien Villemot 2019-11-21 14:15:54 +00:00
commit a327e2c9b8
8 changed files with 52 additions and 38 deletions

View File

@ -40,15 +40,6 @@ fprintf(fid,'%s \n','\usepackage{breqn}');
fprintf(fid,'%s \n','\usepackage{float,morefloats,caption}');
fprintf(fid,'%s \n','\begin{document}');
%% Include LaTeX files from root directory
TeX_Files=dir([M_.fname,'*.tex']);
for ii=1:length(TeX_Files)
[pathstr,f_name,ext] = fileparts(TeX_Files(ii).name);
if ~strcmp(TeX_Files(ii).name,f_name_binder)
fprintf(fid,'%s \n',['\include{',f_name,'}']);
end
end
%% Include LaTeX files from <fname>/latex/ directory, except the standalone ones
TeX_Files=dir([M_.dname filesep 'latex' filesep '*.tex']);
for ii=1:length(TeX_Files)

View File

@ -560,8 +560,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
if ~options_.nograph
[nbplt,nr,nc,lr,lc,nstar] = pltorg(M_.exo_nbr);
if ~exist([M_.fname '/graphs'],'dir')
mkdir(M_.fname,'graphs');
end
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fidTeX = fopen([M_.fname '_SmoothedShocks.tex'],'w');
fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_SmoothedShocks.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n');
@ -608,14 +611,14 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
end
title(name,'Interpreter','none')
end
dyn_saveas(fh,[M_.fname '_SmoothedShocks' int2str(plt)],options_.nodisplay,options_.graph_format);
dyn_saveas(fh,[M_.fname, '/graphs/' M_.fname '_SmoothedShocks' int2str(plt)],options_.nodisplay,options_.graph_format);
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:nstar0
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_SmoothedShocks%s}\n',options_.figures.textwidth*min(i/nc,1),M_.fname,int2str(plt));
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_SmoothedShocks%s}\n',options_.figures.textwidth*min(i/nc,1),[M_.fname, '/graphs/' M_.fname],int2str(plt));
fprintf(fidTeX,'\\caption{Smoothed shocks.}');
fprintf(fidTeX,'\\label{Fig:SmoothedShocks:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n');
@ -640,7 +643,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
if ~options_.nograph
[nbplt,nr,nc,lr,lc,nstar] = pltorg(number_of_plots_to_draw);
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fidTeX = fopen([M_.fname '_SmoothedObservationErrors.tex'],'w');
fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_SmoothedObservationErrors.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n');
@ -688,14 +691,14 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
end
title(name,'Interpreter','none')
end
dyn_saveas(fh,[M_.fname '_SmoothedObservationErrors' int2str(plt)],options_.nodisplay,options_.graph_format);
dyn_saveas(fh,[M_.fname, '/graphs/' M_.fname '_SmoothedObservationErrors' int2str(plt)],options_.nodisplay,options_.graph_format);
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:nstar0
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_SmoothedObservationErrors%s}\n',options_.figures.textwidth*min(i/nc,1),M_.fname,int2str(plt));
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_SmoothedObservationErrors%s}\n',options_.figures.textwidth*min(i/nc,1),[M_.fname, '/graphs/' M_.fname],int2str(plt));
fprintf(fidTeX,'\\caption{Smoothed observation errors.}');
fprintf(fidTeX,'\\label{Fig:SmoothedObservationErrors:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n');
@ -715,7 +718,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
if ~options_.nograph
[nbplt,nr,nc,lr,lc,nstar] = pltorg(n_varobs);
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fidTeX = fopen([M_.fname '_HistoricalAndSmoothedVariables.tex'],'w');
fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_HistoricalAndSmoothedVariables.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n');
@ -763,14 +766,14 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
end
title(name,'Interpreter','none')
end
dyn_saveas(fh,[M_.fname '_HistoricalAndSmoothedVariables' int2str(plt)],options_.nodisplay,options_.graph_format);
dyn_saveas(fh,[M_.fname, '/graphs/' M_.fname '_HistoricalAndSmoothedVariables' int2str(plt)],options_.nodisplay,options_.graph_format);
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:nstar0
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_HistoricalAndSmoothedVariables%s}\n',options_.figures.textwidth*min(i/nc,1),M_.fname,int2str(plt));
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_HistoricalAndSmoothedVariables%s}\n',options_.figures.textwidth*min(i/nc,1),[M_.fname, '/graphs/' M_.fname],int2str(plt));
fprintf(fidTeX,'\\caption{Historical and smoothed variables.}');
fprintf(fidTeX,'\\label{Fig:HistoricalAndSmoothedVariables:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n');

View File

@ -77,8 +77,11 @@ end
[nbplt,nr,nc,lr,lc,nstar] = pltorg(length(x));
if ~exist([Model.fname filesep 'graphs'],'dir')
mkdir(Model.fname,'graphs');
end
if TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format)))
fidTeX = fopen([Model.fname '_CheckPlots.tex'],'w');
fidTeX = fopen([Model.fname, '/graphs/', Model.fname '_CheckPlots.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by mode_check.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n');
@ -202,7 +205,7 @@ for plt = 1:nbplt
text(0.25,0.5,'log-post')
text(0.69,0.5,'log-lik kernel')
end
dyn_saveas(hh,[ Model.fname '_CheckPlots' int2str(plt) ],DynareOptions.nodisplay,DynareOptions.graph_format);
dyn_saveas(hh,[Model.fname, '/graphs/', Model.fname '_CheckPlots' int2str(plt) ],DynareOptions.nodisplay,DynareOptions.graph_format);
if TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format)))
% TeX eps loader file
fprintf(fidTeX,'\\begin{figure}[H]\n');
@ -210,7 +213,7 @@ for plt = 1:nbplt
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_CheckPlots%s}\n',DynareOptions.figures.textwidth*min(k/nc,1),Model.fname,int2str(plt));
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_CheckPlots%s}\n',DynareOptions.figures.textwidth*min(k/nc,1),[Model.fname, '/graphs/',Model.fname],int2str(plt));
fprintf(fidTeX,'\\caption{Check plots.}');
fprintf(fidTeX,'\\label{Fig:CheckPlots:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n');

View File

@ -36,8 +36,11 @@ figurename = 'Priors';
npar = length(bayestopt_.p1);
[nbplt,nr,nc,lr,lc,nstar] = pltorg(npar);
if ~exist([M_.fname '/graphs'],'dir')
mkdir(M_.fname,'graphs');
end
if TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fidTeX = fopen([M_.fname '_Priors.tex'],'w');
fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_Priors.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by plot_priors.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n');
@ -70,14 +73,14 @@ for plt = 1:nbplt
title(nam,'Interpreter','none')
drawnow
end
dyn_saveas(hplt,[M_.fname '_Priors' int2str(plt)],options_.nodisplay,options_.graph_format);
dyn_saveas(hplt,[M_.fname, '/graphs/' M_.fname '_Priors' int2str(plt)],options_.nodisplay,options_.graph_format);
if TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:nstar0
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end
fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_Priors%s}\n',options_.figures.textwidth*min(index/nc,1),M_.fname,int2str(plt));
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_Priors%s}\n',options_.figures.textwidth*min(index/nc,1),[M_.fname, '/graphs/' M_.fname],int2str(plt));
fprintf(fidTeX,'\\caption{Priors.}');
fprintf(fidTeX,'\\label{Fig:Priors:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n');

View File

@ -201,9 +201,13 @@ end
if options_.irf
var_listTeX = M_.endo_names_tex(i_var);
if ~options_.nograph
if ~exist([M_.fname '/graphs'],'dir')
mkdir(M_.fname,'graphs');
end
end
if TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fidTeX = fopen([M_.fname '_IRF.tex'],'w');
fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_IRF.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by stoch_simul.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n');
@ -290,14 +294,14 @@ if options_.irf
remove_fractional_xticks;
title(deblank(mylist(j,:)),'Interpreter','none');
end
dyn_saveas(hh,[M_.fname '_IRF_' tit{i}],options_.nodisplay,options_.graph_format);
dyn_saveas(hh,[M_.fname, '/graphs/' M_.fname '_IRF_' tit{i}],options_.nodisplay,options_.graph_format);
if TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n');
for j = 1:number_of_plots_to_draw
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{$%s$}\n',deblank(mylist(j,:)),deblank(mylistTeX(j,:)));
end
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s}\n',options_.figures.textwidth*min(j/nc,1),M_.fname,tit{i});
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s}\n',options_.figures.textwidth*min(j/nc,1),[M_.fname, '/graphs/' M_.fname],tit{i});
fprintf(fidTeX,'\\caption{Impulse response functions (orthogonalized shock to $%s$).}\n',titTeX{i});
fprintf(fidTeX,'\\label{Fig:IRF:%s}\n', tit{i});
fprintf(fidTeX,'\\end{figure}\n');
@ -322,14 +326,14 @@ if options_.irf
remove_fractional_xticks
title(deblank(mylist((fig-1)*nstar+plt,:)),'Interpreter','none');
end
dyn_saveas(hh,[ M_.fname '_IRF_' tit{i} int2str(fig)],options_.nodisplay,options_.graph_format);
dyn_saveas(hh,[M_.fname, '/graphs/' M_.fname '_IRF_' tit{i} int2str(fig)],options_.nodisplay,options_.graph_format);
if TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n');
for j = 1:nstar
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{$%s$}\n',deblank(mylist((fig-1)*nstar+j,:)),deblank(mylistTeX((fig-1)*nstar+j,:)));
end
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s%s}\n',options_.figures.textwidth*min(plt/nc,1),M_.fname,tit{i},int2str(fig));
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s%s}\n',options_.figures.textwidth*min(plt/nc,1),[M_.fname, '/graphs/' M_.fname],tit{i},int2str(fig));
if options_.relative_irf
fprintf(fidTeX,'\\caption{Relative impulse response functions (orthogonalized shock to $%s$).}', titTeX{i});
else
@ -353,14 +357,14 @@ if options_.irf
remove_fractional_xticks
title(deblank(mylist((nbplt-1)*nstar+plt,:)),'Interpreter','none');
end
dyn_saveas(hh,[ M_.fname '_IRF_' tit{i} int2str(nbplt) ],options_.nodisplay,options_.graph_format);
dyn_saveas(hh,[M_.fname, '/graphs/' M_.fname '_IRF_' tit{i} int2str(nbplt) ],options_.nodisplay,options_.graph_format);
if TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n');
for j = 1:m
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{$%s$}\n',deblank(mylist((nbplt-1)*nstar+j,:)),deblank(mylistTeX((nbplt-1)*nstar+j,:)));
end
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s%s}\n',options_.figures.textwidth*min(m/lc,1),M_.fname,tit{i},int2str(nbplt));
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s%s}\n',options_.figures.textwidth*min(m/lc,1),[M_.fname, '/graphs/' M_.fname],tit{i},int2str(nbplt));
if options_.relative_irf
fprintf(fidTeX,'\\caption{Relative impulse response functions (orthogonalized shock to $%s$).}', titTeX{i});
else

View File

@ -12,7 +12,7 @@ function write_latex_definitions
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2013-2018 Dynare Team
% Copyright (C) 2013-2019 Dynare Team
%
% This file is part of Dynare.
%
@ -39,7 +39,10 @@ else
M_var_root = {'M_.endo', 'M_.exo', 'M_.exo_det', 'M_.param'};
end
fid = fopen([M_.fname '_latex_definitions.tex'], 'w');
if ~exist([M_.fname '/latex'],'dir')
mkdir(M_.fname,'latex');
end
fid = fopen([M_.fname, '/latex/' M_.fname '_latex_definitions.tex'], 'w');
for i=1:length(tables)
fprintf(fid, '\\begin{center}\n');
fprintf(fid, '\\begin{longtable}{ccc}\n');

View File

@ -12,7 +12,7 @@ function write_latex_parameter_table
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2015-2018 Dynare Team
% Copyright (C) 2015-2019 Dynare Team
%
% This file is part of Dynare.
%
@ -37,7 +37,11 @@ if ~isequal(M_.param_names, M_.param_names_long)
Long_names_present = true;
end
fid = fopen([M_.fname '_latex_parameters.tex'], 'w');
if ~exist([M_.fname '/latex'],'dir')
mkdir(M_.fname,'latex');
end
fid = fopen([M_.fname, '/latex/' M_.fname '_latex_parameters.tex'], 'w');
fprintf(fid, '\\begin{center}\n');
if Long_names_present==1
fprintf(fid, '\\begin{longtable}{ccc}\n');

View File

@ -11,7 +11,7 @@ function write_latex_prior_table
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2015-2017 Dynare Team
% Copyright (C) 2015-2019 Dynare Team
%
% This file is part of Dynare.
%
@ -54,7 +54,10 @@ ub=bounds.ub;
PriorNames = { 'Beta' , 'Gamma' , 'Gaussian' , 'Inv. Gamma' , 'Uniform' , 'Inv. Gamma -- 2', '', 'Weibull' };
fidTeX = fopen([Model.fname '_priors_table.tex'],'w+');
if ~exist([M_.fname '/latex'],'dir')
mkdir(M_.fname,'latex');
end
fidTeX = fopen([M_.fname, '/latex/' Model.fname '_priors_table.tex'],'w+');
fprintf(fidTeX,'%% TeX-table generated by Dynare write_latex_prior_table.m.\n');
fprintf(fidTeX,'%% Prior Information\n');
fprintf(fidTeX,['%% ' datestr(now,0)]);