Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing tikzcd code #40

Closed
ralphS16 opened this issue Nov 25, 2020 · 5 comments · Fixed by #180
Closed

Parsing tikzcd code #40

ralphS16 opened this issue Nov 25, 2020 · 5 comments · Fixed by #180
Assignees
Labels
feature-request new feature

Comments

@ralphS16
Copy link

It would be great if we could copy & paste some existing tikzcd code (for which we do not have the quiver hashcode) on quiver in order to make some adjustments.

@varkor varkor added the feature-request new feature label Nov 25, 2020
@dzackgarza
Copy link

Just wanted to +1, and add that even just re-parsing existing exports might be useful. Sometimes it's easier to export to a text editor to label objects (e.g a long exact sequence or double complex with many similar rows), but then the tikzcd code diverges from the included URL. Being able to re-import back into the GUI somehow to add arrows, save all of the code, and generate a new URL would be fantastic!

@varkor
Copy link
Owner

varkor commented Oct 21, 2023

This feature will be available in the next version of quiver. You can test it out at https://q.uiver.app/dev. I would appreciate any feedback, since this feature is complex and there are likely to be edge cases I haven't considered.

@ralphS16
Copy link
Author

I have tried a few diagrams. Here are my notes:

  • I don't see why it is necessary to include the tikzcd environment delimiters.
  • I cannot properly edit the code in the import text box because, pressing enter tries to import the diagram and does not create a new line and ctrl-z does not work after an import attempt.
  • Some label/arrow options that quiver did not recognize (I guess this is another issue): near start, near end, rotate, crossing over. Quiver warned me the diagram would look bad, but it was not clear that it actually displayed the diagram and I could look at it by pressing "import tikz-cd" again (because the error message and import text box was still displayed over it).
  • There is some weird error when there are dashed arrows. The parser puts a space between "dash" and "ed" in the arrow option, and then tells me there should be commas separating options. But then, when I start editing the code (inside quiver), it automatically erases the space it added, and puts it back when I try to import. Here is the code for the diagram and a picture of the what happens:
\begin{tikzcd}
            O \\
            E & A & A
            \arrow["f"', shift right=1, from=2-2, to=2-3]
            \arrow["s"', from=2-1, to=2-2]
            \arrow["o", from=1-1, to=2-2]
            \arrow["{!}"', dashed, from=1-1, to=2-1]
            \arrow["{\id_A}", shift left=1, from=2-2, to=2-3]
\end{tikzcd}

image

@varkor
Copy link
Owner

varkor commented Oct 21, 2023

@ralphS16: thanks for the feedback!

  • I suppose it is not really necessary to require the tikzcd environment block. My intention with this was to make it clear to people trying to paste in pure TikZ code, for instance, that this was not supported. This restriction could be relaxed. However, it also doesn't seem overly restrictive to ask for it: presumably the source the user is pasting from has the tikzcd environment?
  • Previously, the controls where Shift + Enter to create a newline, and Enter to trigger the import. I thought it would be more likely that people wanted to import than create a newline, but since this seems unintuitive, I have changed the behaviour so that Enter will create a newline, and Command/Control + Enter will trigger the import.
  • I've added support for near start (and its relatives). Since rotated labels and crossing over (Crossing over arrows #19) are not yet supported by quiver, it makes sense to me to warn for them even though they are valid tikz-cd styles. However, your point that it is not clear the diagram has been partially loaded is good. I will think how to make this clearer.
  • There was a bug with dashed. It has now been fixed.

@varkor
Copy link
Owner

varkor commented Oct 22, 2023

I've now added a tip when you import a diagram and there are warnings, telling the user that they may press Escape to view the diagram. (If there are no warnings, the overlay disappears immediately.) Hopefully this makes what has happened clearer to the user.
image

@varkor varkor mentioned this issue Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants