# Symbolics Build Function and Display of Code in Pluto

**URL:** <https://discourse.julialang.org/t/symbolics-build-function-and-display-of-code-in-pluto/102395>\
**Category:** General Usage\
**Tags:** question, pluto, symbolics\
**Created:** [August 2, 2023, 12:56pm UTC](https://discourse.julialang.org/t/symbolics-build-function-and-display-of-code-in-pluto/102395 "2023-08-02T12:56:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allan\_Baker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/allan_baker/32/42645_2.png) [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Post date:** [August 2, 2023, 12:56pm UTC](https://discourse.julialang.org/t/symbolics-build-function-and-display-of-code-in-pluto/102395/1 "2023-08-02T12:56:18Z")

</div>

I’m trying to make an example Pluto notebook, showing how some Julia functions can be manipulated by Symbolics and Converted to C. This all looks nice. But I don’t know the syntax once the function has generated C code to display it in markdown _as_ C-code.

For Example:

```julia
@variables start stop num u
qi=structure1(start,stop,num)
f=function1(qi,u)
fc=build_function(f,start,stop,num;target=Symbolics.CTarget(),fname="function1")

```

Gives me a nice C function, but I want to do something like this in the notebook.

````julia
md"""
Then we can symplify and convert the code to C, or MATLAB or Julia.
```C
$(fc)
`` ` # ignore space 
"""

````

Which I ultimately would love to look like this in the display with the newlines expanded, etc:

```plaintext
#include <math.h>
void function1(double* du, const double RHS1, const double RHS2, const double RHS3) {
  du[0] = ifelse(u <= RHS1, 1, ifelse(u >= RHS2, RHS3, 1 + ((-1 + RHS3) * (u + -1 * RHS1 * 1)) / (RHS2 + -1 * RHS1 * 1)));
}

```

I don’t know if it helps too much, but is there a C pretty print option for markdowns somewhere hiding? I can’t be the first person to think this would be cool.

Best Regards,  
Allan Baker

---

<div class="post-metadata">

**Author:** ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)\
**Post date:** [August 2, 2023, 1:16pm UTC](https://discourse.julialang.org/t/symbolics-build-function-and-display-of-code-in-pluto/102395/2 "2023-08-02T13:16:15Z")

</div>

EDIT: never mind - I didn’t understand your question.

The gist of it is, inside of your `md` block, you have a nested block of code delimited by backticks. It seems like that is what you were doing. I’m not sure why yours doesn’t have newlines? Mine does in Pluto.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/7/8/787b5b25c789bcde6b7ab23501c05d119c62282b.png)

---

<div class="post-metadata">

**Author:** ![Allan\_Baker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/allan_baker/32/42645_2.png) [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Post date:** [August 2, 2023, 1:27pm UTC](https://discourse.julialang.org/t/symbolics-build-function-and-display-of-code-in-pluto/102395/3 "2023-08-02T13:27:15Z")

</div>

I guess I wasn’t too clear, I want the expression inside “fc” which is C code to be magically expressed inside the markdown, but when I put it in the `C ... ` syntax, I can no longer reference fc as $(fc).

---

<div class="post-metadata">

**Author:** ![gricur](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@gricur](https://discourse.julialang.org/u/gricur)\
**Post date:** [June 14, 2026, 2:11pm UTC](https://discourse.julialang.org/t/symbolics-build-function-and-display-of-code-in-pluto/102395/4 "2026-06-14T14:11:19Z")

</div>

I was able to do it with an intermediate step

````julia-auto
begin
	intermediate_md = md(
		"""
		```math
		$(a + b^c)
		```
		"""
	)
	md"""
	The value of `x` is
		$(intermediate_md)
	"""
end

````

your $(fc), is not being evaluated inside
