quiver icon indicating copy to clipboard operation
quiver copied to clipboard

Export to ASCII

Open stschaef opened this issue 1 year ago • 2 comments

It's lovely to output actual tikz drawings from the editor, but I was wondering if it would be easy/possible to export to ASCII (or possibly Unicode)

My lab does a lot of category theory proofs in agda, and being able to include well-formatted commutative diagrams as comments is often very helpful. However, these are drawn by hand by us and often look messy. A principled method to generate ASCII diagrams would be used by at least 5 of us (and hopefully other people in the community!)

This is a very low priority issue and I've thought of homebaking something myself but have never found the time. I'd love to hear any thoughts on how you think this could leverage existing code

Thanks

stschaef avatar Feb 20 '24 04:02 stschaef

If there is an algorithm to convert commutative diagrams to ASCII, I would be willing to integrate it in quiver. That is, integration of new export methods is easy. However, an algorithm that produces accurate ASCII seems difficult in all but the simplest cases. It's certainly not something I have time to investigate myself, but if someone else came up with a solution, I would be willing to review it.

varkor avatar Feb 20 '24 11:02 varkor

Currently there is tex2mail, but...

  1. It's implemented in Perl.

  2. It in my opinion goes a bit too far in the conversion. E.g.

    [~]$ tex2mail <<< 'x^2'
     2
    x 
    
    [~]$ tex2mail <<< '\sqrt{x^2}'
     +--+
     | 2
    \|x 
    

    I don't think it's necessary to move the 2 to the line above.

Looking at https://tex.stackexchange.com/questions/6431/options-for-converting-latex-to-plain-text there doesn't seem to be too many options.

Depends on your editor a saner option (*) might be to install preview-latex or something and somehow make it preview commutative diagram too. (Theoretically possible as long as the editor isn't terminal-only)

(*): More setup cost in the beginning (edit everything in order to support embedding image in code), but seems to me like the "morally correct" solution to the problem.

user202729 avatar May 03 '24 06:05 user202729