varkor / quiver

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

Having problems with curved arrows in Overleaf #217

Closed Tompouce-onGit closed 7 months ago

Tompouce-onGit commented 7 months ago

I am trying to insert the following diagram into a LaTeX document:

https://q.uiver.app/#q=WzAsMyxbMCwwLCJcXG1hdGhjYWx7Q30iXSxbMiwwLCJcXG1hdGhjYWx7RH0iXSxbNCwwLCJcXG1hdGhjYWx7RX0iXSxbMCwxLCJGIiwwLHsiY3VydmUiOi0zfV0sWzAsMSwiRyIsMix7ImN1cnZlIjozfV0sWzEsMiwiSCIsMCx7ImN1cnZlIjotM31dLFsxLDIsIksiLDIseyJjdXJ2ZSI6M31dLFszLDQsIlxcYWxwaGEiLDAseyJzaG9ydGVuIjp7InNvdXJjZSI6MjAsInRhcmdldCI6MjB9fV0sWzUsNiwiXFxiZXRhIiwwLHsic2hvcnRlbiI6eyJzb3VyY2UiOjIwLCJ0YXJnZXQiOjIwfX1dXQ==

However, I encounter many errors like Package tikz Error: + or - expected, Use of \tikz@curveCdot doesn't match its definition, or telling me I have a missing or extra $ or }. It seems that it is the 'curve' style defined in quiver.sty that is causing issue, since diagrams with only straight arrows compile without problem.

I am writing this document using the Overleaf online editor, and have downloaded the quiver.sty file from the CTAN for use in that project as the quiver package isn't natively available through Overleaf. I have also tried using the quiver.sty file that can be downloaded through the quiver app interface, but the result is the same.

This seems like it could be the same issue as #89, but since the original poster didn't elaborate on his issue I cannot tell.

varkor commented 7 months ago

Are you using \usepackage{quiver} in your LaTeX document, before \begin{document}?

KiringYJ commented 7 months ago

I've encountered the same problem. Here's the error I received and the Overleaf settings I used. After manually adding the quiver.sty file next to my .tex file, the error was resolved. Screenshot 2024-04-05 212151 Screenshot 2024-04-05 212208

varkor commented 7 months ago

I'm going to mark this resolved by https://github.com/varkor/quiver/issues/217#issuecomment-2038120849, but let me know if you're still having problems.

Tompouce-onGit commented 6 months ago

Are you using \usepackage{quiver} in your LaTeX document, before \begin{document}?

Sorry for the late response, I was very busy. I am using \usepackage{quiver}, and the quiver.sty is added to my project along with the .tex file. My issue is happening despite of this.

varkor commented 6 months ago

Would you be able to post a minimised example of your TeX document source code that produces this error?

Tompouce-onGit commented 6 months ago

It's very curious. In the Tex document I am working on at the moment, I encounter the issue I have just described, but when I tried creating a new Tex document to showcase my issue with examples of diagrams featuring curved arrows, it didn't occur. Since it seems to me that I am encountering the issue due to the packages I have loaded in my document, here is the preamble, but I must admit I am quite intimidated by the idea that I will have to analyse how each on these packages and their loading order could be at fault.

\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[autolanguage]{numprint}
\usepackage{lipsum}
\usepackage{xcolor}

\usepackage{caption}
\usepackage{subcaption}

\usepackage{amsmath}
\usepackage{mathtools}
\usepackage[bb=libus,cal=cm]{mathalpha}
\usepackage{quiver}
\usepackage{braket}

\usepackage{hyperref}
\usepackage{xurl}
varkor commented 6 months ago

Could you try adding \usetikzlibrary{babel} after \usepackage{quiver}? Sometimes babel interacts badly with TikZ without it.

Tompouce-onGit commented 6 months ago

I added this line and it seemed to have solved the issue. Thank you for your help! Out of curiosity, was this mentioned somewhere and I simply missed it?

varkor commented 6 months ago

Out of curiosity, was this mentioned somewhere and I simply missed it?

It's not currently mentioned on quiver anywhere. Maybe it would be worth adding a message somewhere, since this is one of the packages that conflicts most often.

Tompouce-onGit commented 6 months ago

Maybe it would be worth adding a message somewhere

I agree. After searching for the term "babel" in the issues and seeing that I wasn't the only user to experience this problem, I think a warning message could save many users a lot of headaches, and you the trouble of potentially helping with the same problem over and over.