Skip to content

add TerminalDisplay and associated display function #48

@johnnychen94

Description

@johnnychen94

#45 allows much clearer image visualization on some terminals(e.g., iTerm2 and mlterm), so with that done, we can start to supporting various image-like objects, e.g., plot, latex, graphics.

To support latex, if I understand it correctly, as long as we provide a TerminalDisplay instance (with displayable(d, MIME("image"png")) == true) to the global Base.Mualtimedia.displays, Latexify.jl would automatically calls it on render. (cc: @korsbo)

https://github.com/korsbo/Latexify.jl/blob/8b39f068874e158b18eac353fff41f9a94c803ef/src/utils.jl#L162-L164

It might be worth mentioning that the pipeline that Latexify.render uses is "luetex --> div2png --> ImageInTerminal", so a significant overhead (0.6s for the minimal example) will be observed even if it's supported.


I haven't yet tried to figure out what's needed to do to support packages like Plots and Compose, though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions