Import markup into LiveScript
Show older comments
If I have some text with LaTeX and other markup like the following,
For a given energy |E|, the *primary* signal is:
$P_E(u,v,\theta) = \exp\left[ -\mu_b(E) L_b(u,v,\theta) - \mu_w(E) L_w(u,v,\theta) \right]$
Is there any way that I can paste it into a LiveScript so that the markup will be interpreted and displayed as intended, in this case as,
For a given energy E, the primary signal is:
Accepted Answer
More Answers (2)
Cris LaPierre
on 12 Jun 2025
0 votes
My experience is that the LaTeX interpreter in MATLAB isn't called unless the closing/ending flag is physically typed. And not all LaTeX is supported in MATLAB. Still, given those caveats, there is a relatively simple way to get the markup you have shared to work.
- Paste it into a text section in a live script (like what is here in Answers)
- delete the closing '*' then retype it
- Delete the closing '$' and retype it.
Here is the result:
For a given energy |E|, the primary signal is:

2 Comments
Cris LaPierre
on 12 Jun 2025
Fair point. I just don't know of another way.
Michael Abboud
on 19 Jun 2025
0 votes
Hi Matt, I'm a developer on the MATLAB Editor team. While I don't have a perfect answer for you yet, I’d love to understand your workflow better to help guide future improvements to the Live Editor.
In particular, I'm curious to learn more about:
- Where is the source content coming from?
- Is the text already in MATLAB comments, or coming from another tool or format?
- What would the ideal workflow or behavior look like for you?
From your snippet, the text looks a bit like MATLAB’s Publishing Markup, with |E| for monospace and inline LaTeX. As you already mentioned, saving from script to live script -- or using “Open as Live Script” by right-clicking the Editor tab -- might be your best bets right now.
We’re currently exploring some related areas, and your input could really help inform our designs.
Thanks,
Michael
1 Comment
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!