# How to get TeX output from Dynare?

Hi all,

With Dynare v3 the making of the tex output is a little tricky. Mainly because the user has to define the tex names of the variables and parameters by hand. In the archive cepremap.cnrs.fr/~adjemian/Dynare/TeXOutputv3.zip you will find an example showing how to proceed. The last version of Dynare must be used. You can obtain the current version on svn or by downloading the following archive cepremap.cnrs.fr/~adjemian/Dynare/DynMatlaBv3.zip.

Step 1: Run your mod file.

Step 2: Print on matlab’s command window the variables: lgx_ (names of the exogenous variables), lgy_ (names of the endogenous variables), estim_params_.names (names of the estimated parameters) and options_.varobs (names of the observed variables).

Step 3: After the estimated_params block, in the mod file, define the variables lgx_TeX_, lgy_TeX estimated_params_.tex and options_.varobs_TeX as described in the attached example (SimulatedData3.mod).

Step 4: Run again the mod file adding option tex in the estimation command.

Dynare will generate a lot of *.tex files containing tables and figures. You just have to call these files in your main tex document using the \input{} LaTeX command, as shown in the file essai.tex. You can then compile your document (MikTeX is fine, I didn’t try with SWP) as follows (from dos) to generate a nice pdf file:

``````**latex essai**
**latex essai**
**dvips essai**
**ps2pdf essai.ps**
``````

Note that the two last commands are only necessary if you include graphics in your document (these commands allows to replace ugly names by tex names in the pdf or ps version of your document). Note also that the compilation of the tex files may be done from matlab with the following commands:

dos(‘latex essai’); dos(‘latex essai’); dos(‘dvips essai’);
dos(‘ps2pdf essai.ps’);

As soon as possible I will post a message to show that it is much simpler to produce tex output with dynare v4…

Best, St

Hi St