File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,11 @@ def expression(
119
119
`use_signature=False`.
120
120
"""
121
121
kwargs ["use_signature" ] = kwargs .get ("use_signature" , False )
122
+
122
123
if fn is not None :
123
- return function (fn , ** kwargs )
124
- else :
125
- return function (** kwargs )
124
+ return ipython_wrappers .LatexifiedFunction (fn , ** kwargs )
125
+
126
+ def wrapper (f ):
127
+ return ipython_wrappers .LatexifiedFunction (f , ** kwargs )
128
+
129
+ return wrapper
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ class Style(enum.Enum):
15
15
"""The style of the generated LaTeX."""
16
16
17
17
ALGORITHMIC = "algorithmic"
18
- EXPRESSION = "expression"
19
18
FUNCTION = "function"
20
19
IPYTHON_ALGORITHMIC = "ipython-algorithmic"
21
20
@@ -67,11 +66,11 @@ def get_latex(
67
66
elif style == Style .IPYTHON_ALGORITHMIC :
68
67
# TODO(ZibingZhang): implement algorithmic codegen for ipython
69
68
raise exceptions .LatexifyNotSupportedError
70
- else :
71
- if style == Style .EXPRESSION :
72
- kwargs ["use_signature" ] = kwargs .get ("use_signature" , False )
69
+ elif style == Style .FUNCTION :
73
70
return codegen .FunctionCodegen (
74
71
use_math_symbols = merged_config .use_math_symbols ,
75
72
use_signature = merged_config .use_signature ,
76
73
use_set_symbols = merged_config .use_set_symbols ,
77
74
).visit (tree )
75
+
76
+ raise ValueError (f"Unrecognized style: { style } " )
You can’t perform that action at this time.
0 commit comments