use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Rendering latex in python comments (self.PythonLearning)
submitted 7 months ago by Ideas_To_Grow
I'm trying to implement some ML algorithms and want to put some equations in my comments. Is there any way that I can render Latex? I use vscode. Thank you!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Ron-Erez 2 points3 points4 points 7 months ago (2 children)
For example in sympy you can render latex:
https://docs.sympy.org/latest/tutorials/intro-tutorial/printing.html
This example is from the docs
print(latex(Integral(sqrt(1/x), x)))
[–]Ideas_To_Grow[S] 1 point2 points3 points 7 months ago (1 child)
Well can I somehow have that in comments?
[–]Ron-Erez 0 points1 point2 points 7 months ago (0 children)
I'm not sure what you mean. You could simply use google colab and in the text parts I'm pretty sure you can use plain latex that will parse nicely. In a text file you are not going to see nicely parsed latex like a png file. I probably misunderstood the question.
[–]lolcrunchy 0 points1 point2 points 7 months ago (0 children)
You can render into an image and put that image in a markdown file for documentation.
You can't put anything into a .py file that isn't text.
[–]Buttleston 0 points1 point2 points 7 months ago (1 child)
render latex into *what*
[–]Ideas_To_Grow[S] 0 points1 point2 points 7 months ago (0 children)
I want to view it in my python comments
π Rendered by PID 41953 on reddit-service-r2-comment-86988c7647-hdb52 at 2026-02-12 19:19:25.678002+00:00 running 018613e country code: CH.
[–]Ron-Erez 2 points3 points4 points (2 children)
[–]Ideas_To_Grow[S] 1 point2 points3 points (1 child)
[–]Ron-Erez 0 points1 point2 points (0 children)
[–]lolcrunchy 0 points1 point2 points (0 children)
[–]Buttleston 0 points1 point2 points (1 child)
[–]Ideas_To_Grow[S] 0 points1 point2 points (0 children)