Can we write LaTeX inside python turtle graphics?

by MuhammadKhaled   Last Updated March 13, 2018 07:23 AM

I am looking for a way to write latex inside a figure drawn with turtle graphics. It doesn't accept it in the turtle.write() command. Is there another way to do that?

Tags : python

Answers 1

Neither Python nor turtle have any knowledge of LaTeX. As workaround:

  1. Write a LaTeX file (e.g. with class standalone) from Python with the desired LaTeX text.

  2. Compile (subprocess) the LaTeX file to an image format that is supported by turtle (probably a bitmap format).

  3. Include the generated image in turtle.

Heiko Oberdiek
Heiko Oberdiek
March 13, 2018 07:09 AM

Related Questions

Pythontex workflow with LyX

Updated June 04, 2016 08:09 AM

Unable to convert ipython notebooks to pdf

Updated March 30, 2017 07:23 AM

Can we import Python file in latex?

Updated April 27, 2017 15:23 PM

Template Not showing in base template

Updated August 05, 2016 08:09 AM