From 458c0417a5ede7f562007aa42bd95ca773d3a16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemia=20=28Scylla=29?= Date: Mon, 4 Feb 2019 17:30:28 +0100 Subject: [PATCH] Fixed pdf (latex) compilation. --- src/source/reporting.rst | 69 +++++++++++++------------ src/source/the-model-file.rst | 94 ++++++++++++++++++----------------- src/source/time-series.rst | 4 +- 3 files changed, 86 insertions(+), 81 deletions(-) diff --git a/src/source/reporting.rst b/src/source/reporting.rst index 8f1c1d00e..6a1d0c12d 100644 --- a/src/source/reporting.rst +++ b/src/source/reporting.rst @@ -10,16 +10,17 @@ Reporting ######### -Dynare provides a simple interface for creating LaTeX reports, -comprised of LaTeX tables and ``PGFPLOTS/TikZ graphs``. You can use -the report as created through Dynare or pick out the pieces (tables -and graphs) you want for inclusion in your own paper. Though Dynare -provides a subset of options available through ``PGFPLOTS/TikZ``, you -can easily modify the graphs created by Dynare using the options -available in the ``PGFPLOTS/TikZ`` manual. You can either do this -manually or by passing the options to :opt:`miscTikzAxisOptions -` or :opt:`graphMiscTikzAddPlotOptions -`. +Dynare provides a simple interface for creating :math:`\text{\LaTeX}` +reports, comprised of :math:`\text{\LaTeX}` tables and ``PGFPLOTS/TikZ +graphs``. You can use the report as created through Dynare or pick out +the pieces (tables and graphs) you want for inclusion in your own +paper. Though Dynare provides a subset of options available through +``PGFPLOTS/TikZ``, you can easily modify the graphs created by Dynare +using the options available in the ``PGFPLOTS/TikZ`` manual. You can +either do this manually or by passing the options to +:opt:`miscTikzAxisOptions ` or +:opt:`graphMiscTikzAddPlotOptions `. Reports are created and modified by calling methods on class objects. The objects are hierarchical, with the following order (from @@ -60,10 +61,10 @@ and a clarifying example. .. option:: compiler, FILENAME - The full path to the LaTeX compiler on your system. If this - option is not provided, Dynare will try to find the - appropriate program to compile LaTeX on your system. Default - is system dependent: + The full path to the :math:`\text{\LaTeX}` compiler on your + system. If this option is not provided, Dynare will try to + find the appropriate program to compile :math:`\text{\LaTeX}` on your + system. Default is system dependent: * Windows: the result of findtexmf ``--file-type=exe pdflatex``. * macOS and Linux: the result of ``which pdflatex``. @@ -79,7 +80,7 @@ and a clarifying example. .. 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``. .. option:: margin, DOUBLE @@ -122,12 +123,12 @@ and a clarifying example. .. option:: latex, STRING - The valid LaTeX code to be used for this page. Alows the user - to create a page to be included in the report by passing LaTeX - code directly. If this option is passed, the page itself will - be saved in the :opt:`pageDirName ` - directory in the form ``page_X.tex`` where X refers to the - page number. Default: ``empty``. + The valid :math:`\text{\LaTeX}` code to be used for this + page. Alows the user to create a page to be included in the + report by passing :math:`\text{\LaTeX}` code directly. If this option is + passed, the page itself will be saved in the :opt:`pageDirName + ` directory in the form ``page_X.tex`` + where X refers to the page number. Default: ``empty``. .. option:: orientation, `landscape' | `portrait' @@ -147,12 +148,13 @@ and a clarifying example. With one entry (a STRING), the title of the page. With more than one entry (a CELL_ARRAY_STRINGS), the title and - subtitle(s) of the page. Values passed must be valid LaTeX - code (e.g., ``%`` must be ``\%``). Default: ``none``. + subtitle(s) of the page. Values passed must be valid + :math:`\text{\LaTeX}` code (e.g., ``%`` must be + ``\%``). Default: ``none``. .. 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 that of the ``title`` option if you do not want to use the default value for the title (and subtitles). Default: @@ -178,7 +180,7 @@ and a clarifying example. .. 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: ``'!'`` @@ -577,7 +579,7 @@ and a clarifying example. .. option:: graphLegendName, STRING 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 ``data`` and :opt:`showLegend ` options have been passed. Default: the tex name of the series. @@ -748,7 +750,7 @@ and a clarifying example. .. option:: heading, STRING 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``. .. option:: indent, BOOLEAN @@ -757,7 +759,7 @@ and a clarifying example. .. 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``. @@ -778,8 +780,9 @@ and a clarifying example. .. reportingmethod:: write - |br| Writes the LaTeX representation of this ``Report``, saving it - to the file specified by :opt:`filename `. + |br| Writes the :math:`\text{\LaTeX}` representation of this + ``Report``, saving it to the file specified by :opt:`filename + `. .. reportingmethod:: compile @@ -796,13 +799,13 @@ and a clarifying example. Like :opt:`compiler `, except will not overwrite the value of ``compiler`` contained in the report object. Hence, passing the value here is useful for using - different LaTeX compilers or just for passing the value at the - last minute. + different :math:`\text{\LaTeX}` compilers or just for passing + the value at the last minute. .. option:: showOutput, BOOLEAN 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 `. diff --git a/src/source/the-model-file.rst b/src/source/the-model-file.rst index fa5ac1be9..47db6a051 100644 --- a/src/source/the-model-file.rst +++ b/src/source/the-model-file.rst @@ -51,8 +51,9 @@ observed: * PARAMETER_NAME (sometimes PARAM_NAME) indicates a parameter name starting with an alphabetical character and can’t contain: ‘()+-\*/^=!;:@#.’ or accentuated characters; -* LATEX_NAME (sometimes TEX_NAME) indicates a valid :math:`\LaTeX` expression - in math mode (not including the dollar signs); +* LATEX_NAME (sometimes TEX_NAME) indicates a valid + :math:`\text{\LaTeX}` expression in math mode (not including the + dollar signs); * FUNCTION_NAME indicates a valid MATLAB function name; * FILENAME indicates a filename valid in the underlying operating 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(log_deflator=MODEL_EXPR) VAR_NAME (... same options apply) - |br| This required command declares the endogenous variables in 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 - variable or, if it is nonstationary, provide information regarding - its deflator. ``var`` commands can appear several times in the file - and Dynare will concatenate them. Dynare stores the list of - declared parameters, in the order of declaration, in a column cell - array ``M_.endo_names``. + |br| This required command declares the endogenous variables in + the model. See :ref:`conv` for the syntax of *VAR_NAME* and + *MODEL_EXPR*. Optionally it is possible to give a + :math:`\text{\LaTeX}` name to the variable or, if it is + nonstationary, provide information regarding its deflator. ``var`` + commands can appear several times in the file and Dynare will + concatenate them. Dynare stores the list of declared parameters, + in the order of declaration, in a column cell array + ``M_.endo_names``. *Options* @@ -152,10 +154,10 @@ for declaring variables and parameters are described below. |br| This optional command declares the exogenous variables in the model. See :ref:`conv` for the syntax of ``VAR_NAME``. Optionally - it is possible to give a :math:`\LaTeX` name to the variable. Exogenous - variables are required if the user wants to be able to apply - shocks to her model. ``varexo`` commands can appear several times - in the file and Dynare will concatenate them. + it is possible to give a :math:`\text{\LaTeX}` name to the + variable. Exogenous variables are required if the user wants to be + able to apply shocks to her model. ``varexo`` commands can appear + several times in the file and Dynare will concatenate them. *Options* @@ -196,7 +198,7 @@ for declaring variables and parameters are described below. |br| This optional command declares exogenous deterministic 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 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 initialization or in shocks declarations. See :ref:`conv` for the 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`). @@ -351,7 +353,7 @@ for declaring variables and parameters are described below. |br| This optional command declares the trend variables in the model. See ref:`conv` for the syntax of MODEL_EXPR and 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 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 -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 ``write_latex_dynamic_model command``, and the list of static model equations using the ``write_latex_static_model`` command. .. command:: write_latex_original_model ; - |br| This command creates two :math:`\LaTeX` files: one containing the - model as defined in the model block and one containing the - :math:`\LaTeX` document header information. + |br| This command creates two :math:`\text{\LaTeX}` files: one + containing the model as defined in the model block and one + containing the :math:`\text{\LaTeX}` document header information. If your ``.mod`` file is ``FILENAME.mod``, then Dynare will create a file called ``FILENAME_original.tex``, which includes a file called ``FILENAME_original_content.tex`` (also created by Dynare) 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 plain text names will be used. 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``. .. command:: write_latex_dynamic_model ; write_latex_dynamic_model (OPTIONS); - |br| This command creates two :math:`\LaTeX` files: one containing - the dynamic model and one containing the :math:`\LaTeX` document + |br| This command creates two :math:`\text{\LaTeX}` files: one containing + the dynamic model and one containing the :math:`\text{\LaTeX}` document header information. 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) 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 plain text names will be used. 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 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 and equations. - For the required :math:`\LaTeX` packages, see + For the required :math:`\text{\LaTeX}` packages, see :comm:`write_latex_original_model`. *Options* .. option:: write_equation_tags - Write the equation tags in the :math:`\LaTeX` output. NB: the - equation tags will be interpreted with :math:`\LaTeX` markups. + Write the equation tags in the :math:`\text{\LaTeX}` output. NB: the + equation tags will be interpreted with :math:`\text{\LaTeX}` markups. .. command:: write_latex_static_model ; - |br| This command creates two :math:`\LaTeX` files: one containing the - static model and one containing the :math:`\LaTeX` document header - information. + |br| This command creates two :math:`\text{\LaTeX}` files: one + containing the static model and one containing the :math:`\text{\LaTeX}` + document header information. If your ``.mod`` file is ``FILENAME.mod``, then Dynare will create a file called ``FILENAME_static.tex``, which includes a file called ``FILENAME_static_content.tex`` (also created by Dynare) 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 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 the model block. - For the required :math:`\LaTeX` packages, see + For the required :math:`\text{\LaTeX}` packages, see :comm:`write_latex_original_model`. .. _aux-variables: @@ -3207,7 +3209,7 @@ Computing the stochastic solution .. option:: tex 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. .. option:: dr_display_tol = DOUBLE @@ -10250,7 +10252,7 @@ The labor share in GDP is defined as: .. 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`` is an endogenous variable. @@ -10471,27 +10473,27 @@ Misc commands .. 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 ``<>_latex_definitions.tex``. Requires the following - :math:`\LaTeX` packages: ``longtable``. + :math:`\text{\LaTeX}` packages: ``longtable``. .. 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 ``<>_latex_parameters.tex.`` The command writes the values of the parameters currently stored. Thus, if parameters are set or changed in the steady state computation, the command should be called after a steady-command to make sure the parameters were 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``. .. matcomm:: write_latex_prior_table ; |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 ``<>_latex_priors_table.tex``. The command writes the prior definitions currently stored. Thus, this command must be invoked after the ``estimated_params`` block. If priors are @@ -10499,16 +10501,16 @@ Misc commands preceeded by the declaration of the observed variables (with ``varobs``). The command displays a warning if no prior densities 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``. .. matcomm:: collect_latex_files ; - |br| Writes a :math:`\LaTeX` file named + |br| Writes a :math:`\text{\LaTeX}` file named ``<>_TeX_binder.tex`` that collects all TeX output generated by Dynare into a file. This file can be compiled using ``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``, ``booktabs``, ``caption``, ``float,`` ``amsmath``, ``amsfonts``, and ``morefloats``. diff --git a/src/source/time-series.rst b/src/source/time-series.rst index 0d367eb77..80f01e1de 100644 --- a/src/source/time-series.rst +++ b/src/source/time-series.rst @@ -838,8 +838,8 @@ The dseries class of strings with one entry for each variable name. The default name associated with column ``i`` of *DATA_MATRIX* is ``Variable_i``. The final argument, *TEX_NAMES*, is a :math:`N - \times 1` cell of strings composed of the LaTeX names - associated with the variables. The default LaTeX name + \times 1` cell of strings composed of the :math:`\text{\LaTeX}` names + associated with the variables. The default :math:`\text{\LaTeX}` name associated with column ``i`` of *DATA_MATRIX* is ``Variable\_i``. If the optional second input argument is a range of dates, ``dates`` object *RANGE_OF_DATES*, the number