Pdflatex error in Dynare (Windows 10)

Hi, all! I’m new here, but I need help with the Latex PDF tool. I created my DSGE model, now I’m moving on to its implementation in Dynare. I’m watching Willi Mutschler’s video (https://www.youtube.com/watch?v=ZfsKGzR84hQ&list=PLiN_C6lGtCc8bhPOuE781GTgeOqtMA5Bi) and I don’t understand why when I enter the command

if system(['/Library/TeX/texbin/pdflatex -halt-on-error -interaction=batchmode ’ M_.fname ‘_TeX_binder.tex’])
warning(‘TeX-File did not compile; you need to compile it manually’)
end

on my Windows 10 I have an error like “The system cannot find the specified path.” Moreover, in the left window “Current Folder” Willi Mutschler get more files than me after starting the code, although I enter the appropriate commands

write_latex_definitions;
write_latex_parameter_table;
write_latex_original_model;
write_latex_dynamic_model;
write_latex_static_model;
collect_latex_files;


If I remove this command, it is not clear where the PDF file is saved:

You most likely have to adjust your path from

On most Windows machines it should be just

if system(['pdflatex -halt-on-error -interaction=batchmode '  M_.fname ' _TeX_binder.tex'])```
1 Like

But in this case I get a new error ““pdflatex” is not an internal or external command, executable program or batch file” :frowning:

Do you have a \LaTeX distribution like MikTeX installed?

1 Like

Yes, MikTex

Then there is a problem with the path variable. Try opening the _binder.tex file in your \LaTeX editor and compiling it there.

1 Like

What does this error mean?

The only way to know that is to have the file or for yourself to check out the compilation error message when you run the file in your \LaTeX editor.

1 Like

I have this problem in MikTeX :frowning:

image

Could you please run my code (working on version 5.4) and see if the equations are written in latex or not?
first_variant.mod (15.3 KB)

You need to define valid \LaTeX names. For example \P is not a valid name as there is no such command. It must be simply P_{SS}.

Here I just tried to compile the _binder.tex file (generated by Dynare) in Miktex, and I got the following error. I didn’t write anything manually myself.

Yes, but in your mod-file you set

    PSS       ${\P_{SS}}$              (long_name='Steady-State level of price (DLOG price level)')

The name within the dollar signs is not a correct \LaTeX name as mentioned above. That applies to several others as well.

Like this? or without {}?

 PSS       {\P_{SS}}              (long_name='Steady-State level of price (DLOG price level)')

No:

PSS       ${P_{SS}}$              (long_name='Steady-State level of price (DLOG price level)')
1 Like

That’s it, I understand that the "" needed for Greek symbols, for example, for lambda, but not for ordinary letters (like P), right?

Finally everything worked, thank you!) The problem was in the way I wrote down the variables in Latex, and not in Dynare)

first_variant_TeX_binder.pdf (177.3 KB)