Pluto Reactivity and eval

I recently discovered Latexify.jl and really like it. I am trying to combine it with Pluto but am failing. I’d appreciate any hints.

I have a pluto notebook with a cell that contains the following.

	fex = :(f(x)=sin(2π*x)+sin(5π*x));

In the next cell I want to use the function f with CairoMakie to plot it.

	n = 2^8
	x = LinRange(0, 1, n)
	lines(x, f.(x))

I find though that I have to re-evaluate the above cell (shift and enter) to get it to update, which is not the reactivity I was expecting. I was expecting I could change the expression to :(f(x)=sin(2π*x)+sin(10π*x)) and it would update the plot accordingly.

Any thoughts on what I am missing here?

It seems that defining a function f = eval(fex) works. Maybe it isn’t the most elegant way to do it.

Yes - thank you. That fixes it. Still don’t know why…but at least it is fixed.

I think that Pluto is very smart updating cells affected by a change, but not in this case eval(fex). Creating this new function f = eval(fex) makes Pluto to update the cell.