Fixed pdf (latex) compilation.

time-shift
Stéphane Adjemia (Scylla) 2019-02-04 17:30:28 +01:00
parent d849b447ec
commit 458c0417a5
Signed by untrusted user who does not match committer: stepan
GPG Key ID: A6D44CB9C64CE77B
3 changed files with 86 additions and 81 deletions

View File

@ -10,16 +10,17 @@
Reporting Reporting
######### #########
Dynare provides a simple interface for creating LaTeX reports, Dynare provides a simple interface for creating :math:`\text{\LaTeX}`
comprised of LaTeX tables and ``PGFPLOTS/TikZ graphs``. You can use reports, comprised of :math:`\text{\LaTeX}` tables and ``PGFPLOTS/TikZ
the report as created through Dynare or pick out the pieces (tables graphs``. You can use the report as created through Dynare or pick out
and graphs) you want for inclusion in your own paper. Though Dynare the pieces (tables and graphs) you want for inclusion in your own
provides a subset of options available through ``PGFPLOTS/TikZ``, you paper. Though Dynare provides a subset of options available through
can easily modify the graphs created by Dynare using the options ``PGFPLOTS/TikZ``, you can easily modify the graphs created by Dynare
available in the ``PGFPLOTS/TikZ`` manual. You can either do this using the options available in the ``PGFPLOTS/TikZ`` manual. You can
manually or by passing the options to :opt:`miscTikzAxisOptions either do this manually or by passing the options to
<miscTikzAxisOptions, STRING>` or :opt:`graphMiscTikzAddPlotOptions :opt:`miscTikzAxisOptions <miscTikzAxisOptions, STRING>` or
<graphMiscTikzAddPlotOptions, STRING>`. :opt:`graphMiscTikzAddPlotOptions <graphMiscTikzAddPlotOptions,
STRING>`.
Reports are created and modified by calling methods on class Reports are created and modified by calling methods on class
objects. The objects are hierarchical, with the following order (from objects. The objects are hierarchical, with the following order (from
@ -60,10 +61,10 @@ and a clarifying example.
.. option:: compiler, FILENAME .. option:: compiler, FILENAME
The full path to the LaTeX compiler on your system. If this The full path to the :math:`\text{\LaTeX}` compiler on your
option is not provided, Dynare will try to find the system. If this option is not provided, Dynare will try to
appropriate program to compile LaTeX on your system. Default find the appropriate program to compile :math:`\text{\LaTeX}` on your
is system dependent: system. Default is system dependent:
* Windows: the result of findtexmf ``--file-type=exe pdflatex``. * Windows: the result of findtexmf ``--file-type=exe pdflatex``.
* macOS and Linux: the result of ``which pdflatex``. * macOS and Linux: the result of ``which pdflatex``.
@ -79,7 +80,7 @@ and a clarifying example.
.. option:: header, STRING .. option:: header, STRING
The valid LaTeX code to be included in the report before The valid :math:`\text{\LaTeX}` code to be included in the report before
``\begin{document}``. Default: ``empty``. ``\begin{document}``. Default: ``empty``.
.. option:: margin, DOUBLE .. option:: margin, DOUBLE
@ -122,12 +123,12 @@ and a clarifying example.
.. option:: latex, STRING .. option:: latex, STRING
The valid LaTeX code to be used for this page. Alows the user The valid :math:`\text{\LaTeX}` code to be used for this
to create a page to be included in the report by passing LaTeX page. Alows the user to create a page to be included in the
code directly. If this option is passed, the page itself will report by passing :math:`\text{\LaTeX}` code directly. If this option is
be saved in the :opt:`pageDirName <pageDirName, STRING>` passed, the page itself will be saved in the :opt:`pageDirName
directory in the form ``page_X.tex`` where X refers to the <pageDirName, STRING>` directory in the form ``page_X.tex``
page number. Default: ``empty``. where X refers to the page number. Default: ``empty``.
.. option:: orientation, `landscape' | `portrait' .. option:: orientation, `landscape' | `portrait'
@ -147,12 +148,13 @@ and a clarifying example.
With one entry (a STRING), the title of the page. With more With one entry (a STRING), the title of the page. With more
than one entry (a CELL_ARRAY_STRINGS), the title and than one entry (a CELL_ARRAY_STRINGS), the title and
subtitle(s) of the page. Values passed must be valid LaTeX subtitle(s) of the page. Values passed must be valid
code (e.g., ``%`` must be ``\%``). Default: ``none``. :math:`\text{\LaTeX}` code (e.g., ``%`` must be
``\%``). Default: ``none``.
.. option:: titleFormat, STRING | CELL_ARRAY_STRINGS .. option:: titleFormat, STRING | CELL_ARRAY_STRINGS
A string representing the valid LaTeX markup to use on A string representing the valid :math:`\text{\LaTeX}` markup to use on
``title``. The number of cell array entries must be equal to ``title``. The number of cell array entries must be equal to
that of the ``title`` option if you do not want to use the that of the ``title`` option if you do not want to use the
default value for the title (and subtitles). Default: default value for the title (and subtitles). Default:
@ -178,7 +180,7 @@ and a clarifying example.
.. option:: height, STRING .. option:: height, STRING
A string to be used with the ``\sectionheight`` LaTeX A string to be used with the ``\sectionheight`` :math:`\text{\LaTeX}`
command. Default: ``'!'`` command. Default: ``'!'``
@ -577,7 +579,7 @@ and a clarifying example.
.. option:: graphLegendName, STRING .. option:: graphLegendName, STRING
The name to display in the legend for this series, passed as The name to display in the legend for this series, passed as
valid LaTeX (e.g., ``GDP_{US}, $\alpha$, valid :math:`\text{\LaTeX}` (e.g., ``GDP_{US}, $\alpha$,
\color{red}GDP\color{black}``). Will be displayed only if the \color{red}GDP\color{black}``). Will be displayed only if the
``data`` and :opt:`showLegend <showLegend, BOOLEAN>` options ``data`` and :opt:`showLegend <showLegend, BOOLEAN>` options
have been passed. Default: the tex name of the series. have been passed. Default: the tex name of the series.
@ -748,7 +750,7 @@ and a clarifying example.
.. option:: heading, STRING .. option:: heading, STRING
The heading for the ``Paragraph`` (like a section The heading for the ``Paragraph`` (like a section
heading). The string must be valid LaTeX code. Default: heading). The string must be valid :math:`\text{\LaTeX}` code. Default:
``empty``. ``empty``.
.. option:: indent, BOOLEAN .. option:: indent, BOOLEAN
@ -757,7 +759,7 @@ and a clarifying example.
.. option:: text, STRING .. option:: text, STRING
The paragraph itself. The string must be valid LaTeX The paragraph itself. The string must be valid :math:`\text{\LaTeX}`
code. Default: ``empty``. code. Default: ``empty``.
@ -778,8 +780,9 @@ and a clarifying example.
.. reportingmethod:: write .. reportingmethod:: write
|br| Writes the LaTeX representation of this ``Report``, saving it |br| Writes the :math:`\text{\LaTeX}` representation of this
to the file specified by :opt:`filename <fileName, FILENAME>`. ``Report``, saving it to the file specified by :opt:`filename
<fileName, FILENAME>`.
.. reportingmethod:: compile .. reportingmethod:: compile
@ -796,13 +799,13 @@ and a clarifying example.
Like :opt:`compiler <compiler, FILENAME>`, except will not Like :opt:`compiler <compiler, FILENAME>`, except will not
overwrite the value of ``compiler`` contained in the report overwrite the value of ``compiler`` contained in the report
object. Hence, passing the value here is useful for using object. Hence, passing the value here is useful for using
different LaTeX compilers or just for passing the value at the different :math:`\text{\LaTeX}` compilers or just for passing
last minute. the value at the last minute.
.. option:: showOutput, BOOLEAN .. option:: showOutput, BOOLEAN
Print the compiler output to the screen. Useful for debugging Print the compiler output to the screen. Useful for debugging
your code as the LaTeX compiler hangs if there is a your code as the :math:`\text{\LaTeX}` compiler hangs if there is a
problem. Default: the value of :opt:`showOutput <showOutput, problem. Default: the value of :opt:`showOutput <showOutput,
BOOLEAN>`. BOOLEAN>`.

View File

@ -51,8 +51,9 @@ observed:
* PARAMETER_NAME (sometimes PARAM_NAME) indicates a parameter name * PARAMETER_NAME (sometimes PARAM_NAME) indicates a parameter name
starting with an alphabetical character and cant contain: starting with an alphabetical character and cant contain:
()+-\*/^=!;:@#. or accentuated characters; ()+-\*/^=!;:@#. or accentuated characters;
* LATEX_NAME (sometimes TEX_NAME) indicates a valid :math:`\LaTeX` expression * LATEX_NAME (sometimes TEX_NAME) indicates a valid
in math mode (not including the dollar signs); :math:`\text{\LaTeX}` expression in math mode (not including the
dollar signs);
* FUNCTION_NAME indicates a valid MATLAB function name; * FUNCTION_NAME indicates a valid MATLAB function name;
* FILENAME indicates a filename valid in the underlying operating * FILENAME indicates a filename valid in the underlying operating
system; it is necessary to put it between quotes when specifying the system; it is necessary to put it between quotes when specifying the
@ -86,14 +87,15 @@ for declaring variables and parameters are described below.
var(deflator=MODEL_EXPR) VAR_NAME (... same options apply) var(deflator=MODEL_EXPR) VAR_NAME (... same options apply)
var(log_deflator=MODEL_EXPR) VAR_NAME (... same options apply) var(log_deflator=MODEL_EXPR) VAR_NAME (... same options apply)
|br| This required command declares the endogenous variables in the |br| This required command declares the endogenous variables in
model. See :ref:`conv` for the syntax of *VAR_NAME* and the model. See :ref:`conv` for the syntax of *VAR_NAME* and
*MODEL_EXPR*. Optionally it is possible to give a :math:`\LaTeX` name to the *MODEL_EXPR*. Optionally it is possible to give a
variable or, if it is nonstationary, provide information regarding :math:`\text{\LaTeX}` name to the variable or, if it is
its deflator. ``var`` commands can appear several times in the file nonstationary, provide information regarding its deflator. ``var``
and Dynare will concatenate them. Dynare stores the list of commands can appear several times in the file and Dynare will
declared parameters, in the order of declaration, in a column cell concatenate them. Dynare stores the list of declared parameters,
array ``M_.endo_names``. in the order of declaration, in a column cell array
``M_.endo_names``.
*Options* *Options*
@ -152,10 +154,10 @@ for declaring variables and parameters are described below.
|br| This optional command declares the exogenous variables in the |br| This optional command declares the exogenous variables in the
model. See :ref:`conv` for the syntax of ``VAR_NAME``. Optionally model. See :ref:`conv` for the syntax of ``VAR_NAME``. Optionally
it is possible to give a :math:`\LaTeX` name to the variable. Exogenous it is possible to give a :math:`\text{\LaTeX}` name to the
variables are required if the user wants to be able to apply variable. Exogenous variables are required if the user wants to be
shocks to her model. ``varexo`` commands can appear several times able to apply shocks to her model. ``varexo`` commands can appear
in the file and Dynare will concatenate them. several times in the file and Dynare will concatenate them.
*Options* *Options*
@ -196,7 +198,7 @@ for declaring variables and parameters are described below.
|br| This optional command declares exogenous deterministic |br| This optional command declares exogenous deterministic
variables in a stochastic model. See :ref:`conv` for the syntax of variables in a stochastic model. See :ref:`conv` for the syntax of
VARIABLE_NAME. Optionally it is possible to give a :math:`\LaTeX` VARIABLE_NAME. Optionally it is possible to give a :math:`\text{\LaTeX}`
name to the variable. ``varexo_det`` commands can appear several name to the variable. ``varexo_det`` commands can appear several
times in the file and Dynare will concatenate them. times in the file and Dynare will concatenate them.
@ -234,7 +236,7 @@ for declaring variables and parameters are described below.
|br| This command declares parameters used in the model, in variable |br| This command declares parameters used in the model, in variable
initialization or in shocks declarations. See :ref:`conv` for the initialization or in shocks declarations. See :ref:`conv` for the
syntax of ``PARAM_NAME``. Optionally it is possible to give a syntax of ``PARAM_NAME``. Optionally it is possible to give a
:math:`\LaTeX` name to the parameter. :math:`\text{\LaTeX}` name to the parameter.
The parameters must subsequently be assigned values (see :ref:`param-init`). The parameters must subsequently be assigned values (see :ref:`param-init`).
@ -351,7 +353,7 @@ for declaring variables and parameters are described below.
|br| This optional command declares the trend variables in the |br| This optional command declares the trend variables in the
model. See ref:`conv` for the syntax of MODEL_EXPR and model. See ref:`conv` for the syntax of MODEL_EXPR and
VAR_NAME. Optionally it is possible to give a VAR_NAME. Optionally it is possible to give a
:math:`\LaTeX` name to the variable. :math:`\text{\LaTeX}` name to the variable.
The variable is assumed to have a multiplicative growth trend. For The variable is assumed to have a multiplicative growth trend. For
an additive growth trend, use ``log_trend_var`` instead. an additive growth trend, use ``log_trend_var`` instead.
@ -944,37 +946,37 @@ The model is declared inside a ``model`` block:
Dynare has the ability to output the original list of model equations Dynare has the ability to output the original list of model equations
to a :math:`\LaTeX` file, using the ``write_latex_original_model`` to a :math:`\text{\LaTeX}` file, using the ``write_latex_original_model``
command, the list of transformed model equations using the command, the list of transformed model equations using the
``write_latex_dynamic_model command``, and the list of static model ``write_latex_dynamic_model command``, and the list of static model
equations using the ``write_latex_static_model`` command. equations using the ``write_latex_static_model`` command.
.. command:: write_latex_original_model ; .. command:: write_latex_original_model ;
|br| This command creates two :math:`\LaTeX` files: one containing the |br| This command creates two :math:`\text{\LaTeX}` files: one
model as defined in the model block and one containing the containing the model as defined in the model block and one
:math:`\LaTeX` document header information. containing the :math:`\text{\LaTeX}` document header information.
If your ``.mod`` file is ``FILENAME.mod``, then Dynare will create If your ``.mod`` file is ``FILENAME.mod``, then Dynare will create
a file called ``FILENAME_original.tex``, which includes a file a file called ``FILENAME_original.tex``, which includes a file
called ``FILENAME_original_content.tex`` (also created by Dynare) called ``FILENAME_original_content.tex`` (also created by Dynare)
containing the list of all the original model equations. containing the list of all the original model equations.
If :math:`\LaTeX` names were given for variables and parameters If :math:`\text{\LaTeX}` names were given for variables and parameters
(see :ref:`var-decl`), then those will be used; otherwise, the (see :ref:`var-decl`), then those will be used; otherwise, the
plain text names will be used. plain text names will be used.
Time subscripts (``t``, ``t+1``, ``t-1``, ...) will be appended to Time subscripts (``t``, ``t+1``, ``t-1``, ...) will be appended to
the variable names, as :math:`\LaTeX` subscripts. the variable names, as :math:`\text{\LaTeX}` subscripts.
Compiling the TeX file requires the following :math:`\LaTeX` Compiling the TeX file requires the following :math:`\text{\LaTeX}`
packages: ``geometry, fullpage, breqn``. packages: ``geometry, fullpage, breqn``.
.. command:: write_latex_dynamic_model ; .. command:: write_latex_dynamic_model ;
write_latex_dynamic_model (OPTIONS); write_latex_dynamic_model (OPTIONS);
|br| This command creates two :math:`\LaTeX` files: one containing |br| This command creates two :math:`\text{\LaTeX}` files: one containing
the dynamic model and one containing the :math:`\LaTeX` document the dynamic model and one containing the :math:`\text{\LaTeX}` document
header information. header information.
If your ``.mod`` file is ``FILENAME.mod``, then Dynare will create If your ``.mod`` file is ``FILENAME.mod``, then Dynare will create
@ -982,12 +984,12 @@ equations using the ``write_latex_static_model`` command.
called ``FILENAME_dynamic_content.tex`` (also created by Dynare) called ``FILENAME_dynamic_content.tex`` (also created by Dynare)
containing the list of all the dynamic model equations. containing the list of all the dynamic model equations.
If :math:`\LaTeX` names were given for variables and parameters If :math:`\text{\LaTeX}` names were given for variables and parameters
(see :ref:`var-decl`), then those will be used; otherwise, the (see :ref:`var-decl`), then those will be used; otherwise, the
plain text names will be used. plain text names will be used.
Time subscripts (``t``, ``t+1``, ``t-1``, ...) will be appended to Time subscripts (``t``, ``t+1``, ``t-1``, ...) will be appended to
the variable names, as :math:`\LaTeX` subscripts. the variable names, as :math:`\text{\LaTeX}` subscripts.
Note that the model written in the TeX file will differ from the Note that the model written in the TeX file will differ from the
model declared by the user in the following dimensions: model declared by the user in the following dimensions:
@ -1008,29 +1010,29 @@ equations using the ``write_latex_static_model`` command.
lags will also have been replaced by new auxiliary variables lags will also have been replaced by new auxiliary variables
and equations. and equations.
For the required :math:`\LaTeX` packages, see For the required :math:`\text{\LaTeX}` packages, see
:comm:`write_latex_original_model`. :comm:`write_latex_original_model`.
*Options* *Options*
.. option:: write_equation_tags .. option:: write_equation_tags
Write the equation tags in the :math:`\LaTeX` output. NB: the Write the equation tags in the :math:`\text{\LaTeX}` output. NB: the
equation tags will be interpreted with :math:`\LaTeX` markups. equation tags will be interpreted with :math:`\text{\LaTeX}` markups.
.. command:: write_latex_static_model ; .. command:: write_latex_static_model ;
|br| This command creates two :math:`\LaTeX` files: one containing the |br| This command creates two :math:`\text{\LaTeX}` files: one
static model and one containing the :math:`\LaTeX` document header containing the static model and one containing the :math:`\text{\LaTeX}`
information. document header information.
If your ``.mod`` file is ``FILENAME.mod``, then Dynare will create If your ``.mod`` file is ``FILENAME.mod``, then Dynare will create
a file called ``FILENAME_static.tex``, which includes a file a file called ``FILENAME_static.tex``, which includes a file
called ``FILENAME_static_content.tex`` (also created by Dynare) called ``FILENAME_static_content.tex`` (also created by Dynare)
containing the list of all the steady state model equations. containing the list of all the steady state model equations.
If :math:`\LaTeX` names were given for variables and parameters If :math:`\text{\LaTeX}` names were given for variables and parameters
(see :ref:`var-decl`), then those will be used; otherwise, the (see :ref:`var-decl`), then those will be used; otherwise, the
plain text names will be used. plain text names will be used.
@ -1044,7 +1046,7 @@ equations using the ``write_latex_static_model`` command.
(i.e. without leads and lags) of the dynamic ``model`` declared in (i.e. without leads and lags) of the dynamic ``model`` declared in
the model block. the model block.
For the required :math:`\LaTeX` packages, see For the required :math:`\text{\LaTeX}` packages, see
:comm:`write_latex_original_model`. :comm:`write_latex_original_model`.
.. _aux-variables: .. _aux-variables:
@ -3207,7 +3209,7 @@ Computing the stochastic solution
.. option:: tex .. option:: tex
Requests the printing of results and graphs in TeX tables and Requests the printing of results and graphs in TeX tables and
graphics that can be later directly included in :math:`\LaTeX` graphics that can be later directly included in :math:`\text{\LaTeX}`
files. files.
.. option:: dr_display_tol = DOUBLE .. option:: dr_display_tol = DOUBLE
@ -10250,7 +10252,7 @@ The labor share in GDP is defined as:
.. math:: .. math::
\textrm{lab_rat} = (w \ell)/(p y) \textrm{lab\_rat} = (w \ell)/(p y)
In the model, :math:`\alpha` is a (share) parameter, and ``lab_rat`` In the model, :math:`\alpha` is a (share) parameter, and ``lab_rat``
is an endogenous variable. is an endogenous variable.
@ -10471,27 +10473,27 @@ Misc commands
.. matcomm:: write_latex_definitions ; .. matcomm:: write_latex_definitions ;
|br| Writes the names, :math:`\LaTeX` names and long names of |br| Writes the names, :math:`\text{\LaTeX}` names and long names of
model variables to tables in a file named model variables to tables in a file named
``<<M_.fname>>_latex_definitions.tex``. Requires the following ``<<M_.fname>>_latex_definitions.tex``. Requires the following
:math:`\LaTeX` packages: ``longtable``. :math:`\text{\LaTeX}` packages: ``longtable``.
.. matcomm:: write_latex_parameter_table ; .. matcomm:: write_latex_parameter_table ;
|br| Writes the :math:`\LaTeX` names, parameter names, and long |br| Writes the :math:`\text{\LaTeX}` names, parameter names, and long
names of model parameters to a table in a file named names of model parameters to a table in a file named
``<<M_.fname>>_latex_parameters.tex.`` The command writes the ``<<M_.fname>>_latex_parameters.tex.`` The command writes the
values of the parameters currently stored. Thus, if parameters are values of the parameters currently stored. Thus, if parameters are
set or changed in the steady state computation, the command should set or changed in the steady state computation, the command should
be called after a steady-command to make sure the parameters were be called after a steady-command to make sure the parameters were
correctly updated. The long names can be used to add parameter correctly updated. The long names can be used to add parameter
descriptions. Requires the following :math:`\LaTeX` packages: descriptions. Requires the following :math:`\text{\LaTeX}` packages:
``longtable, booktabs``. ``longtable, booktabs``.
.. matcomm:: write_latex_prior_table ; .. matcomm:: write_latex_prior_table ;
|br| Writes descriptive statistics about the prior distribution to |br| Writes descriptive statistics about the prior distribution to
a :math:`\LaTeX` table in a file named a :math:`\text{\LaTeX}` table in a file named
``<<M_.fname>>_latex_priors_table.tex``. The command writes the ``<<M_.fname>>_latex_priors_table.tex``. The command writes the
prior definitions currently stored. Thus, this command must be prior definitions currently stored. Thus, this command must be
invoked after the ``estimated_params`` block. If priors are invoked after the ``estimated_params`` block. If priors are
@ -10499,16 +10501,16 @@ Misc commands
preceeded by the declaration of the observed variables (with preceeded by the declaration of the observed variables (with
``varobs``). The command displays a warning if no prior densities ``varobs``). The command displays a warning if no prior densities
are defined (ML estimation) or if the declaration of the observed are defined (ML estimation) or if the declaration of the observed
variables is missing. Requires the following :math:`\LaTeX` variables is missing. Requires the following :math:`\text{\LaTeX}`
packages: ``longtable, booktabs``. packages: ``longtable, booktabs``.
.. matcomm:: collect_latex_files ; .. matcomm:: collect_latex_files ;
|br| Writes a :math:`\LaTeX` file named |br| Writes a :math:`\text{\LaTeX}` file named
``<<M_.fname>>_TeX_binder.tex`` that collects all TeX output ``<<M_.fname>>_TeX_binder.tex`` that collects all TeX output
generated by Dynare into a file. This file can be compiled using generated by Dynare into a file. This file can be compiled using
``pdflatex`` and automatically tries to load all required ``pdflatex`` and automatically tries to load all required
packages. Requires the following :math:`\LaTeX` packages: packages. Requires the following :math:`\text{\LaTeX}` packages:
``breqn``, ``psfrag``, ``graphicx``, ``epstopdf``, ``longtable``, ``breqn``, ``psfrag``, ``graphicx``, ``epstopdf``, ``longtable``,
``booktabs``, ``caption``, ``float,`` ``amsmath``, ``amsfonts``, ``booktabs``, ``caption``, ``float,`` ``amsmath``, ``amsfonts``,
and ``morefloats``. and ``morefloats``.

View File

@ -838,8 +838,8 @@ The dseries class
of strings with one entry for each variable name. The default of strings with one entry for each variable name. The default
name associated with column ``i`` of *DATA_MATRIX* is name associated with column ``i`` of *DATA_MATRIX* is
``Variable_i``. The final argument, *TEX_NAMES*, is a :math:`N ``Variable_i``. The final argument, *TEX_NAMES*, is a :math:`N
\times 1` cell of strings composed of the LaTeX names \times 1` cell of strings composed of the :math:`\text{\LaTeX}` names
associated with the variables. The default LaTeX name associated with the variables. The default :math:`\text{\LaTeX}` name
associated with column ``i`` of *DATA_MATRIX* is associated with column ``i`` of *DATA_MATRIX* is
``Variable\_i``. If the optional second input argument is a ``Variable\_i``. If the optional second input argument is a
range of dates, ``dates`` object *RANGE_OF_DATES*, the number range of dates, ``dates`` object *RANGE_OF_DATES*, the number