Skip to content

Improve heapq documentation #133530

Description

@StanFromIreland

With the implementation of max-heaps, the docs should be revised with examples and descriptions for both.

The docs should also be made more formal (#62480)

I will be working on this.

Linked PRs

Activity

  1. added a commit that references this issue on May 8, 2025
  2. encukou commented on May 8, 2025

    @encukou
    Member

    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.

  3. StanFromIreland commented on May 8, 2025

    @StanFromIreland
    MemberAuthor

    The image looks generated.

    That's because it is. :-)

    instructions/scripts for making it

    I used tkiz, so it should work on any platform.

    My code for the binary tree
    \documentclass[tikz]{standalone}
    \usepackage{tikz}
    \usetikzlibrary{trees}
    
    \begin{document}
    \begin{tikzpicture}[
      level 1/.style={sibling distance=80mm},
      level 2/.style={sibling distance=40mm},
      level 3/.style={sibling distance=20mm},
      level 4/.style={sibling distance=10mm},
      every node/.style={
        circle,
        draw=blue,
        fill=blue!20,
        minimum size=6mm
      }
    ]
    \node {0}
      child {node {1}
        child {node {3}
          child {node {7}
            child {node {15}}
            child {node {16}}
          }
          child {node {8}
            child {node {17}}
            child {node {18}}
          }
        }
        child {node {4}
          child {node {9}
            child {node {19}}
            child {node {20}}
          }
          child {node {10}
            child {node {21}}
            child {node {22}}
          }
        }
      }
      child {node {2}
        child {node {5}
          child {node {11}
            child {node {23}}
            child {node {24}}
          }
          child {node {12}
            child {node {25}}
            child {node {26}}
          }
        }
        child {node {6}
          child {node {13}
            child {node {27}}
            child {node {28}}
          }
          child {node {14}
            child {node {29}}
            child {node {30}}
          }
        }
      };
    \end{tikzpicture}
    \end{document}

    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.

  4. encukou commented on May 12, 2025

    @encukou
    Member

    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?

  5. StanFromIreland commented on May 12, 2025

    @StanFromIreland
    MemberAuthor

    In dark mode, the connecting lines aren't very visible.

    I considered it, but to me it seemed fine. With it it looks like so:

    Image

    Maybe I should rethink my color scheme. I've opened a pr adding invert to the current on for now.

  6. added a commit that references this issue on May 12, 2025
  7. added 2 commits that reference this issue on Jul 12, 2025
  8. added a commit that references this issue on Aug 4, 2025
  9. m-aciek commented on Oct 29, 2025

    @m-aciek
    Contributor

    @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.

  10. StanFromIreland commented on Oct 29, 2025

    @StanFromIreland
    MemberAuthor

    Duplicating images does not seem like a nice solution to this issue IMO.

  11. jfbu commented on Oct 29, 2025

    @jfbu
    Contributor

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions