varkor / quiver

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

LaTeX result is too different from webpage #237

Closed UlyssesZh closed 2 months ago

UlyssesZh commented 2 months ago

Example

Webpage result: Screenshot_20231118-094051_Firefox.jpg

LaTeX result: test

LaTeX codes ```tex \documentclass{standalone} \usepackage{quiver} \begin{document} $\displaystyle\begin{tikzcd} && W \\ \\ {W^{(1)}} &&&& {W^{(2)}} \\ \\ {W^{\perp(1)}} &&&& {W^{\perp(2)}} \\ \\ {\vec W^{\parallel(1)}} &&&& {\vec W^{\parallel(2)}} \\ \\ && {\vec W^\parallel} \\ \\ && {W^\perp} \\ & {\vec W^{\perp\parallel}} && {W^{\perp\perp}} \arrow["\pi", curve={height=-30pt}, from=1-3, to=11-3] \arrow[""{name=0, anchor=center, inner sep=0}, "\times"', curve={height=-24pt}, no head, from=3-1, to=3-5] \arrow["{\pi^{(1)}}", from=3-1, to=5-1] \arrow[""{name=1, anchor=center, inner sep=0}, "\times", curve={height=30pt}, no head, from=3-1, to=5-5] \arrow["{\pi^{(2)}}", from=3-5, to=5-5] \arrow[""{name=2, anchor=center, inner sep=0}, "\times", curve={height=30pt}, no head, from=5-1, to=3-5] \arrow[""{name=3, anchor=center, inner sep=0}, "\times", curve={height=30pt}, no head, from=5-1, to=5-5] \arrow[""{name=4, anchor=center, inner sep=0}, "{+}", curve={height=12pt}, no head, from=5-1, to=7-1] \arrow[""{name=5, anchor=center, inner sep=0}, "{+}"', curve={height=-12pt}, no head, from=5-5, to=7-5] \arrow["{\vec\rho}"', "\shortmid"{marking}, curve={height=18pt}, from=7-1, to=7-5] \arrow[""{name=6, anchor=center, inner sep=0}, "{\times/+}", no head, from=7-1, to=7-5] \arrow["{\vec\pi}"', "\shortmid"{marking}, curve={height=18pt}, from=7-1, to=12-2] \arrow["{\vec\pi}", "\shortmid"{marking}, curve={height=-30pt}, from=7-5, to=12-2] \arrow["{\vec c^{(1)}}", "\shortmid"{marking}, curve={height=-6pt}, from=9-3, to=7-1] \arrow["{\vec c^{(2)}}"', "\shortmid"{marking}, curve={height=6pt}, from=9-3, to=7-5] \arrow[""{name=7, anchor=center, inner sep=0}, "{+}", curve={height=24pt}, no head, from=9-3, to=11-3] \arrow[""{name=8, anchor=center, inner sep=0}, "{+}"', curve={height=-6pt}, no head, from=12-2, to=12-4] \arrow[from=0, to=1-3] \arrow["\pi", "\shortmid"{marking}, curve={height=6pt}, from=1, to=11-3] \arrow[curve={height=-18pt}, from=4, to=3-1] \arrow["\pi", "\shortmid"{marking}, curve={height=-6pt}, from=2, to=11-3] \arrow["\pi"', "\shortmid"{marking}, curve={height=-18pt}, from=3, to=12-4] \arrow[curve={height=18pt}, from=5, to=3-5] \arrow["{\vec\pi}"', curve={height=24pt}, from=6, to=12-2] \arrow[curve={height=-18pt}, from=7, to=1-3] \arrow[from=8, to=11-3] \end{tikzcd}$ \end{document} ```

We cannot blame KaTeX because this is mostly layout problem.

varkor commented 2 months ago

quiver currently relies on various heuristics to produce tikz-cd code that reproduces the appearance of diagrams in the editor. Unfortunately, these are not perfect. There are some improvements that can be made (see #46 and #111), but ultimately the best solution would be to switch away from tikz-cd to TikZ. This would be a large project, though. For now, I'll close in favour of #46.