varkor / quiver

A modern commutative diagram editor for the web.
https://q.uiver.app
MIT License
2.37k stars 78 forks source link

Double squiggly arrow renders as trapezoid #94

Open jliptrap opened 3 years ago

jliptrap commented 3 years ago

Double squiggly arrows look fine in quiver, and the generated TikZ code looks reasonable to me, but pdflatex renders the double arrow as a trapezoid with squiggly top and bottom.

BTW thank you for making quiver, it's a huge timesaver!

varkor commented 3 years ago

I guess you're seeing something like the following? image Strangely, for some arrows this doesn't seem to be an issue: image This will require some experimentation to determine when/why the problem occurs, and whether there's a simple fix. If you figure out a way to adjust the TikZ output to address this, let me know!

ralphS16 commented 3 years ago

A similar problem appears when shortening squiggly arrows. On quiver it displays fine but it renders as below on my machine. image

jliptrap commented 3 years ago

Yup, I can repro both squiggly bugs exactly as above.

BTW I think quiver should be featured on the nLab.

varkor commented 3 years ago

I've opened a TeX.SE issue about the second issue (which I imagine is related, and is slightly simpler to describe), to see whether anyone has advice on a workaround (in which case, it might be possible to adjust the quiver accordingly). I may open one for the first issue afterwards, though my experience is that often arrow decorations do not work well in combination with double arrows, and it's quite hard to fix this without a lot of TikZ experience.

If anyone figures out a way around these issues in TikZ, I would be very happy to update quiver, though at the moment I"m not familiar enough with TikZ to figure out the problem myself.

BTW I think quiver should be featured on the nLab.

@jliptrap: you'd be very welcome to add a new entry on the nLab!

varkor commented 3 years ago

A similar problem appears when shortening squiggly arrows.

A solution was given on TeX.SE, which I'll add to quiver soon. I still need to ask about the first issue.

varkor commented 3 years ago

I think the original issue is the same issue as the second. For instance, the following looks fine:

\[\begin{tikzcd}
    \bullet && \bullet \\
    & \bullet
    \arrow[""{name=0, anchor=center, inner sep=0}, from=1-1, to=2-2]
    \arrow[""{name=1, anchor=center, inner sep=0}, from=1-3, to=2-2]
    \arrow[from=1-3, to=1-1]
    \arrow[shorten <=6pt, shorten >=6pt, Rightarrow, squiggly={pre length=8pt, post length=8pt}, from=1, to=0]
\end{tikzcd}\]

Unfortunately, the exact pre length and post length isn't so clear for diagonals, so it'll take some experimentation to figure out how to make this draw correctly in all cases.