You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The image looks generated. If it is, would you mind including instructions/scripts for making it, for the benefit of future editors? Even if they're platform-/tool-specific and they'd only work as inspiration.
Then generated the pdf (pdflatex) and converted it to an svg (there are many ways to do this). There are other ways to generate it but that is just the one I am most familiar with.
If there are other similar text diagrams in the docs I am happy to replace them with images. They look much better, are clearer, and scale better.
@StanFromIreland would it be possible for you to upload also the PDF version and use asterisk in the image extension to let LaTeX builder grab the PDF version of the image? This would fix the regression, I think in a simplest way.
@StanFromIreland LaTeX does not support svg. This format has to be converted to another image format that LaTeX supports. Tools such as Inkscape are a big dependency. Besides for example on my macOS 15.6.1 with Inkscape v1.4, to let LaTeX use the svg package I need adding \svgsetup{inkscapeexe=/Applications/Inkscape.app/Contents/MacOS/inkscape} to the document preamble and I must execute pdflatex with the --shell-escape option, which means arbitrary commands such as rm -fr / can be executed from malicious obfuscated TeX code.
Activity
gh-133530: Replace binary tree textual digram with image (gh-133591)
encukou commentedon May 8, 2025
The image looks generated. If it is, would you mind including instructions/scripts for making it, for the benefit of future editors? Even if they're platform-/tool-specific and they'd only work as inspiration.
StanFromIreland commentedon May 8, 2025
That's because it is. :-)
I used tkiz, so it should work on any platform.
My code for the binary tree
Then generated the pdf (
pdflatex) and converted it to an svg (there are many ways to do this). There are other ways to generate it but that is just the one I am most familiar with.If there are other similar text diagrams in the docs I am happy to replace them with images. They look much better, are clearer, and scale better.
encukou commentedon May 12, 2025
Thanks! Hopefully people can find the source in this issue. It would be better still to put it, for example, as a comment in the SVG file :)
In dark mode, the connecting lines aren't very visible. Could you add
:class: invert-in-dark-mode?StanFromIreland commentedon May 12, 2025
I considered it, but to me it seemed fine. With it it looks like so:
Maybe I should rethink my color scheme. I've opened a pr adding invert to the current on for now.
gh-133530: Modify Heapq docs image settings (gh-133937)
pythongh-133530: Replace binary tree textual digram with image (pytho…
pythongh-133530: Modify Heapq docs image settings (pythongh-133937)
pythongh-133530: Modify Heapq docs image settings (pythongh-133937)
m-aciek commentedon Oct 29, 2025
@StanFromIreland would it be possible for you to upload also the PDF version and use asterisk in the image extension to let LaTeX builder grab the PDF version of the image? This would fix the regression, I think in a simplest way.
StanFromIreland commentedon Oct 29, 2025
Duplicating images does not seem like a nice solution to this issue IMO.
jfbu commentedon Oct 29, 2025
@StanFromIreland LaTeX does not support svg. This format has to be converted to another image format that LaTeX supports. Tools such as Inkscape are a big dependency. Besides for example on my macOS 15.6.1 with Inkscape v1.4, to let LaTeX use the
svgpackage I need adding\svgsetup{inkscapeexe=/Applications/Inkscape.app/Contents/MacOS/inkscape}to the document preamble and I must executepdflatexwith the--shell-escapeoption, which means arbitrary commands such asrm -fr /can be executed from malicious obfuscated TeX code.