model_latex module

Created on Sun Dec 3 19:07:03 2017

@author: hanseni

Mostly to eat latex models and translate to business logic

The routines are specific to a style of latex and should be inspected before use

model_latex.rebank(model)[source]

All variable names are decorated by a {bank} The {bank} is injected as the first dimension

model_latex.txttolatex(model)[source]
model_latex.defrack(streng)[source]

rac{xxx}{yyy} = ((xxx)/(yyy))

model_latex.debrace(streng)[source]

Eliminates underbrace{xxx}_{yyy} in a string underbrace{xxx}_{yyy} => (xxx) As there can be nested {} we need to match the braces

model_latex.defunk(funk, subs, streng, startp='{', slutp='}')[source]

unk{xxx} => subs(xxx)

in a string

model_latex.findindex(ind)[source]

find the index variables on the left hand side. meaning variables braced by {}

model_latex.doable(ind, show=False)[source]

find all dimensions in the left hand side of = and and decorate with the nessecary do .. enddo

model_latex.findlists(input)[source]

extracte liste from latex

model_latex.findlistsnew(input)[source]

extracte list with sublist from latex

model_latex.findlistsx(input)[source]

extracte list with sublist from latex

model_latex.latextotxt(input, dynare=False, bankadd=False)[source]

Translates a latex input to a BL output

model_latex.latextotxtnew(input)[source]

Translates a latex input to a BL output

model_latex.dynlatextotxt(input, show=False)[source]

Translates a latex input to a BL output The latex input is the latex output of Dynare