Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
03693621
Commit
03693621
authored
Oct 09, 2011
by
MichelJuillard
Browse files
write Latex model: added automatic line breaks with breqn Latex package
parent
37b30403
Changes
2
Hide whitespace changes
Inline
Side-by-side
doc/dynare.texi
View file @
03693621
...
...
@@ -1602,6 +1602,7 @@ static model can also be written with the
@
code
{
write_latex_static_model
}
command
.
@
anchor
{
write_latex_dynamic_model
}
@
deffn
Command
write_latex_dynamic_model
;
@
descriptionhead
...
...
@@ -1644,6 +1645,9 @@ for a stochastic model, exogenous variables with leads or lags will
also
have
been
replaced
by
new
auxiliary
variables
and
equations
.
@
end
itemize
Compiling
the
TeX
file
requires
the
following
Latex
packages
:
@
code
{
geometry
},
@
code
{
fullpage
},
@
code
{
breqn
}.
@
end
deffn
@
deffn
Command
write_latex_static_model
;
...
...
@@ -1669,6 +1673,9 @@ optional @code{steady_state_model} block (@pxref{steady_state_model});
it
will
rather
output
a
static
version
(@
i
{
i
.
e
.}
without
leads
and
lags
)
of
the
dynamic
model
declared
in
the
@
code
{
model
}
block
.
Compiling
the
TeX
file
requires
the
following
Latex
packages
:
@
code
{
geometry
},
@
code
{
fullpage
},
@
code
{
breqn
}.
@
end
deffn
@
node
Auxiliary
variables
...
...
@@ -4364,6 +4371,10 @@ interval. Default: @code{0.90}
Don'
t
display
graphics
.
@
end
table
@
customhead
{
Initial
Values
}
@
code
{
forecast
}
computes
the
forecast
taking
as
initial
values
the
values
specified
in
@
code
{
histval
}
(@
pxref
{
Initial
and
terminal
conditions
,
histval
}).
When
no
@
code
{
histval
}
block
is
present
,
the
initial
values
are
the
one
stated
in
@
code
{
initval
}.
When
@
code
{
initval
}
is
followed
by
command
@
code
{
steady
},
the
initial
values
are
the
steady
state
(@
pxref
{
Steady
state
,
steady
}).
@
outputhead
The
results
are
stored
in
@
code
{
oo_
.
forecast
},
which
is
described
below
.
...
...
preprocessor/ModelTree.cc
View file @
03693621
...
...
@@ -1327,6 +1327,7 @@ ModelTree::writeLatexModelFile(const string &filename, ExprNodeOutputType output
output
<<
"
\\
documentclass[10pt,a4paper]{article}"
<<
endl
<<
"
\\
usepackage[landscape]{geometry}"
<<
endl
<<
"
\\
usepackage{fullpage}"
<<
endl
<<
"
\\
usepackage{breqn}"
<<
endl
<<
"
\\
begin{document}"
<<
endl
<<
"
\\
footnotesize"
<<
endl
;
...
...
@@ -1337,20 +1338,20 @@ ModelTree::writeLatexModelFile(const string &filename, ExprNodeOutputType output
int
id
=
it
->
first
;
expr_t
value
=
it
->
second
;
output
<<
"
\\
begin{
equation
*}"
<<
endl
output
<<
"
\\
begin{
dmath
*}"
<<
endl
<<
symbol_table
.
getName
(
id
)
<<
" = "
;
// Use an empty set for the temporary terms
value
->
writeOutput
(
output
,
output_type
);
output
<<
endl
<<
"
\\
end{
equation
*}"
<<
endl
;
output
<<
endl
<<
"
\\
end{
dmath
*}"
<<
endl
;
}
for
(
int
eq
=
0
;
eq
<
(
int
)
equations
.
size
();
eq
++
)
{
output
<<
"
\\
begin{
equation
}"
<<
endl
output
<<
"
\\
begin{
dmath
}"
<<
endl
<<
"% Equation "
<<
eq
+
1
<<
endl
;
// Here it is necessary to cast to superclass ExprNode, otherwise the overloaded writeOutput() method is not found
dynamic_cast
<
ExprNode
*>
(
equations
[
eq
])
->
writeOutput
(
output
,
output_type
);
output
<<
endl
<<
"
\\
end{
equation
}"
<<
endl
;
output
<<
endl
<<
"
\\
end{
dmath
}"
<<
endl
;
}
output
<<
"
\\
end{document}"
<<
endl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment