Link latex equation to code

In the live editor, is there a possibility to link a latex equation to the code?
Here is an example of what I'm trying to acheive:
Reference chord length:
c = 0.525;
What I would like is that if I change the code to:
c = 0.5;
The latex equation changes automatically, or the other way around, if I change the latex equation it changes the code.
If it is not possible it would be an amazing feature.

Respuestas (1)

madhan ravi
madhan ravi el 7 de Jul. de 2020

0 votos

Use livescript

5 comentarios

Thomas Jacob
Thomas Jacob el 7 de Jul. de 2020
Yes, as I said "In the live editor, ..."
Can you be a bit more specific. How do you do so that the Latex equation changes automatically when the code is changed, or vice versa?
madhan ravi
madhan ravi el 7 de Jul. de 2020
I’m pretty sure you added that information after I answered. By the way by default livescript outputs the result in latex form not the code itself. But there’s an option to export the code and result into a latex file.
Thomas Jacob
Thomas Jacob el 7 de Jul. de 2020
I know about the possibility to export the file as latex. But this is not what I would like to do.
I'm using latex equation as comment for my scripts because they are easy to read (or so I find). But each time I change my code I also have to think about changing the latex equation, which I almost always forget and leads to discrepancies between code and comments. This is rather boring and I would like that my latex equations comment change automatically when I change the script.
madhan ravi
madhan ravi el 7 de Jul. de 2020
It can only be done manually.
Thomas Jacob
Thomas Jacob el 7 de Jul. de 2020
That is what I feared.

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 7 de Jul. de 2020

Comentada:

el 7 de Jul. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by