This function replaces elements of a given AST object with "ast_where" nodes.
It is useful for long expressions to improve readability of latex output and
network trees. The "ast_where" stores the original expression in a $content
slot, and ignored by the parsers to GAMS, Julia, and other languages.
Usage
remap_ast_elements(
obj,
ast_type = list(when = "condition"),
name_prefix = "m",
n = 0L,
latex_max = 10,
...
)