diff --git a/matlab/CheckPath.m b/matlab/CheckPath.m index f32f8fa22998e8f54b6c910beaa3195defcf0814..6f27753c48d393420f7e443809d1ea78007ab12e 100644 --- a/matlab/CheckPath.m +++ b/matlab/CheckPath.m @@ -31,7 +31,7 @@ function [DirectoryName, info] = CheckPath(type,dname) info = 0; -DirectoryName = [ dname filesep type ]; +DirectoryName = [ dname '/' type ]; % don't use filesep as it will create issues with LaTeX on Windows if ~isdir(dname) % Make sure there isn't a file with the same name, see trac ticket #47 diff --git a/matlab/dynare_identification.m b/matlab/dynare_identification.m index edfc8534ce703762e019f99014552f97028944fd..06c643fb7aad0d08482dcc15eb0bcd4993d6cccc 100644 --- a/matlab/dynare_identification.m +++ b/matlab/dynare_identification.m @@ -362,7 +362,7 @@ if prior_exist % use estimated_params block for jj=1:totparam_nbr if options_.TeX [param_name_temp, param_name_tex_temp]= get_the_name(jj,options_.TeX,M_,estim_params_,options_); - name_tex{jj,1} = strrep(param_name_tex_temp,'$',''); %ordering corresponds to estimated_params + name_tex{jj,1} =param_name_tex_temp; name{jj,1} = param_name_temp; %ordering corresponds to estimated_params else param_name_temp = get_the_name(jj,options_.TeX,M_,estim_params_,options_); @@ -379,8 +379,8 @@ else % no estimated_params block, choose all model parameters and all stderr par totparam_nbr = modparam_nbr+stderrparam_nbr; name = cellfun(@(x) horzcat('SE_', x), M_.exo_names, 'UniformOutput', false); %names for stderr parameters name = vertcat(name, M_.param_names); - name_tex = cellfun(@(x) horzcat('$ SE_{', x, '} $'), M_.exo_names, 'UniformOutput', false); - name_tex = vertcat(name_tex, M_.param_names_tex); + name_tex = cellfun(@(x) horzcat('$ SE_{', x, '} $'), M_.exo_names_tex, 'UniformOutput', false); + name_tex = vertcat(name_tex, cellfun(@(x) horzcat('$ ', x, ' $'), M_.param_names_tex, 'UniformOutput', false)); if ~isequal(M_.H,0) fprintf('\ndynare_identification:: Identification does not support measurement errors (yet) and will ignore them in the following. To test their identifiability, instead define them explicitly as varexo and provide measurement equations in the model definition.\n') end diff --git a/matlab/ident_bruteforce.m b/matlab/ident_bruteforce.m index a09be8cf5bf47df430bf2b5434f664852df1114d..34f311fb050967ee9fdd3803ab30f77ed57f0862 100644 --- a/matlab/ident_bruteforce.m +++ b/matlab/ident_bruteforce.m @@ -114,12 +114,12 @@ for ll = 1:max_dim_cova_group plist=''; for ii=1:ll if ~isnan(pars{i,ll}(ii)) - plist = [plist ' $' name_tex{pars{i,ll}(ii)} '\;\; $ ']; + plist = [plist ' ' name_tex{pars{i,ll}(ii)} '\;\; ']; else plist = [plist ' ---- ']; end end - fprintf(fidTeX,'$%s$ & [%s] & %7.3f \\\\ \n',... + fprintf(fidTeX,'%s & [%s] & %7.3f \\\\ \n',... name_tex{i},... plist,... cosnJ(i,ll)); diff --git a/matlab/mode_check.m b/matlab/mode_check.m index a7db27a108796e428e4a0812b49cba991b43f305..b6443ad450db70eabf885f7a0ca13cec6dff04d5 100644 --- a/matlab/mode_check.m +++ b/matlab/mode_check.m @@ -216,7 +216,7 @@ for plt = 1:nbplt % TeX eps loader file fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\centering \n'); - fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_CheckPlots%s}\n',options_.figures.textwidth*min(k/nc,1),[graphsFolder filesep M_.fname],int2str(plt)); + fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_CheckPlots%s}\n',options_.figures.textwidth*min(k/nc,1),[graphsFolder '/' M_.fname],int2str(plt)); % don't use filesep as it will create issues with LaTeX on Windows fprintf(fidTeX,'\\caption{Check plots.}'); fprintf(fidTeX,'\\label{Fig:CheckPlots:%s}\n',int2str(plt)); fprintf(fidTeX,'\\end{figure}\n'); diff --git a/matlab/plot_identification.m b/matlab/plot_identification.m index 688f177a9833b539d7ef098ab226b00605df4377..8a6d832e8167338d4fa74f2090fa8c730d48710b 100644 --- a/matlab/plot_identification.m +++ b/matlab/plot_identification.m @@ -43,7 +43,7 @@ if nargin <10 || isempty(tit_TeX) end if nargin <11 - name_TeX=name; + name_tex=name; end [SampleSize, nparam]=size(params); @@ -92,7 +92,11 @@ if SampleSize == 1 set(gca,'xticklabel','') dy = get(gca,'ylim'); for ip=1:nparam - text(ip,dy(1),name{is(ip)},'rotation',90,'HorizontalAlignment','right','interpreter','none') + if options_.TeX + text(ip,dy(1),name_tex{is(ip)},'rotation',90,'HorizontalAlignment','right','interpreter','latex') + else + text(ip,dy(1),name{is(ip)},'rotation',90,'HorizontalAlignment','right','interpreter','none') + end end if ~all(isnan(idehess.ide_strength_dMOMENTS_prior)) legend('relative to param value','relative to prior std','Location','Best') @@ -131,7 +135,11 @@ if SampleSize == 1 set(gca,'xticklabel','') dy = get(gca,'ylim'); for ip=1:nparam - text(ip,dy(1),name{is(ip)},'rotation',90,'HorizontalAlignment','right','interpreter','none') + if options_.TeX + text(ip,dy(1),name_tex{is(ip)},'rotation',90,'HorizontalAlignment','right','interpreter','latex') + else + text(ip,dy(1),name{is(ip)},'rotation',90,'HorizontalAlignment','right','interpreter','none') + end end if ~all(isnan(idehess.deltaM_prior)) legend('relative to param value','relative to prior std','Location','Best') @@ -181,7 +189,11 @@ if SampleSize == 1 set(gca,'xticklabel','') dy = get(gca,'ylim'); for ip=1:nparam - text(ip,dy(1),name{is(ip)},'rotation',90,'HorizontalAlignment','right','interpreter','none') + if options_.TeX + text(ip,dy(1),name_tex{is(ip)},'rotation',90,'HorizontalAlignment','right','interpreter','latex') + else + text(ip,dy(1),name{is(ip)},'rotation',90,'HorizontalAlignment','right','interpreter','none') + end end legend('Moments','Model','LRE model','Location','Best') title('Sensitivity bars using derivatives (log-scale)') @@ -213,7 +225,11 @@ if SampleSize == 1 if isnan(dumpindx) namx=[namx ' ' sprintf('%-15s','--')]; else - namx=[namx ' ' sprintf('%-15s',name{dumpindx})]; + if options_.TeX + namx=[namx ' ' sprintf('%-15s',name_tex{dumpindx})]; + else + namx=[namx ' ' sprintf('%-15s',name{dumpindx})]; + end pax(i,dumpindx)=idemoments.cosndMOMENTS(i,j); end end @@ -224,8 +240,13 @@ if SampleSize == 1 set(gca,'xticklabel','') set(gca,'yticklabel','') for ip=1:nparam - text(ip,(0.5),name{ip},'rotation',90,'HorizontalAlignment','left','interpreter','none') - text(0.5,ip,name{ip},'rotation',0,'HorizontalAlignment','right','interpreter','none') + if options_.TeX + text(ip,(0.5),name_tex{ip},'rotation',90,'HorizontalAlignment','left','interpreter','latex') + text(0.5,ip,name_tex{ip},'rotation',0,'HorizontalAlignment','right','interpreter','latex') + else + text(ip,(0.5),name{ip},'rotation',90,'HorizontalAlignment','left','interpreter','none') + text(0.5,ip,name{ip},'rotation',0,'HorizontalAlignment','right','interpreter','none') + end end colorbar; colormap('jet'); @@ -299,7 +320,11 @@ if SampleSize == 1 set(gca,'xticklabel','') if j==4 || j==nparam || j==8 for ip=1:nparam - text(ip,-0.02,name{ip},'rotation',90,'HorizontalAlignment','right','interpreter','none') + if options_.TeX + text(ip,-0.02,name_tex{ip},'rotation',90,'HorizontalAlignment','right','interpreter','latex') + else + text(ip,-0.02,name{ip},'rotation',90,'HorizontalAlignment','right','interpreter','none') + end end end title(['Singular value ',num2str(Stit)]) @@ -357,7 +382,11 @@ else set(gca,'xticklabel','') dy = get(gca,'ylim'); for ip=1:nparam - text(ip,dy(1),name{is(ip)},'rotation',90,'HorizontalAlignment','right','interpreter','none') + if options_.TeX + text(ip,dy(1),name_tex{is(ip)},'rotation',90,'HorizontalAlignment','right','interpreter','latex') + else + text(ip,dy(1),name{is(ip)},'rotation',90,'HorizontalAlignment','right','interpreter','none') + end end if advanced legend('Moments','Model','LRE model','Location','Best') @@ -469,7 +498,11 @@ else set(gca,'xticklabel','') if j==4 || j==nparam || j==8 for ip=1:nparam - text(ip,-0.02,name{ip},'rotation',90,'HorizontalAlignment','right','interpreter','none') + if options_.TeX + text(ip,-0.02,name_tex{ip},'rotation',90,'HorizontalAlignment','right','interpreter','latex') + else + text(ip,-0.02,name{ip},'rotation',90,'HorizontalAlignment','right','interpreter','none') + end end end title(['MEAN Singular value ',num2str(Stit)]) diff --git a/matlab/plot_priors.m b/matlab/plot_priors.m index 9cfa5385ee37dfa25f4774665023c599e3c5933c..97c7914dc1365865d5fd1d3018401f29fdbbc62a 100644 --- a/matlab/plot_priors.m +++ b/matlab/plot_priors.m @@ -76,7 +76,7 @@ for plt = 1:nbplt if TeX && any(strcmp('eps',cellstr(options_.graph_format))) fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\centering\n'); - fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_Priors%s}\n',options_.figures.textwidth*min(index/nc,1),[graphDirectoryName filesep M_.fname],int2str(plt)); + fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_Priors%s}\n',options_.figures.textwidth*min(index/nc,1),[graphDirectoryName '/' M_.fname],int2str(plt));% don't use filesep as it will create issues with LaTeX on Windows fprintf(fidTeX,'\\caption{Priors.}'); fprintf(fidTeX,'\\label{Fig:Priors:%s}\n',int2str(plt)); fprintf(fidTeX,'\\end{figure}\n');