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

Tikz cd #2325

Merged
merged 8 commits into from
Feb 22, 2024
Merged

Tikz cd #2325

merged 8 commits into from
Feb 22, 2024

Conversation

brucemiller
Copy link
Owner

This PR provides a binding for tikz-cd, after fixing some infrastructure.

The critical bug was that ALIGN_STATE which tracks {} during scanning to enable or disable certain alignment tokens (&,\cr,...) was being done too late (in Stomach rather than Gullet). It's easy to miss some corner cases, so some sandbox testing is warranted.

This is a WiP since the resulting svg are displayed too low; there would seem to be one too many adjustments involving pgf@pixminy (?) , although other tikz pictures seem mostly correct.

@dginev
Copy link
Collaborator

dginev commented Feb 16, 2024

I was just discussing with arXiv three of our existing successful Tikz conversions, and did a quick test with this PR - linking to the significantly older ar5iv editions:

  • arXiv:1804.07114 has a few nice pgfplots. Figure 4 now raises errors, and the article hits a Fatal by overflowing the pushback limit. So a regression?
  • arXiv:1501.02026 draws some grids. With the PR I seem to be getting an identically looking output, and no changes in the severity, great.
  • arXiv:2004.08822 has a couple of geometric drawings. That also come out as expected.

So, focusing on the one pgfplots case that regressed: it indeed works with the latexml master branch. Isolating a minimal regressing example:

\documentclass{article}
\begin{filecontents}{coord.txt}
  nc	I_M_opt	I_J	I
  1.000000	0.000000	0.000000	0.001190
  2.000000	0.004133	0.003861	0.002870
  3.000000	0.005510	0.007181	0.004562
\end{filecontents}

\usepackage{pgfplotstable}

\begin{document}

\begin{tikzpicture}
\begin{loglogaxis}[legend style={cells={align=left}}]
\pgfplotstableread{coord.txt}\mytable
\addplot[solid] table[x=nc,y=I] {\mytable};
\addlegendentry{legend}
\end{loglogaxis}
\end{tikzpicture}

\end{document}

Edit: can confirm this was fixed by 5298bf8 !

Copy link
Collaborator

@dginev dginev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our arXiv sandboxes are looking healthy, and we can continue to improve post-release - tikz has a lot of terrain to test, e.g. #2326 .

I am bookkeeping the sandbox results for the v0.8.8 release here, results of this PR are in the 5th table from the top:
https://gist.github.com/dginev/abb72c989f4474a3a33300ed23ac6c86

I think the PR gets us another step closer to "faithful TeX interpretation", which is excellent. Looks good to merge.

@brucemiller brucemiller linked an issue Feb 22, 2024 that may be closed by this pull request
@brucemiller brucemiller changed the title [WiP] Tikz cd Tikz cd Feb 22, 2024
@brucemiller brucemiller merged commit 3f1b890 into master Feb 22, 2024
26 checks passed
@brucemiller brucemiller deleted the tikz-cd branch February 22, 2024 12:51
teepeemm pushed a commit to teepeemm/LaTeXML that referenced this pull request Oct 29, 2024
* Do NOT bump ALIGN_STATE when digesting braces

* But rather maintain ALIGN_STATE while 'scanning', ie. when reading in Gullet, being careful about unread tokens

* Add two pgfmath functions defined by tikz-cd (axis_height, rule_thickness)

* Add new binding for tikz-cd

* pgfsys's alternative \halign needs the ALIGN_STATE adjustments, as well

* Recognize and convert math nested within ltx:XMText/ltx:picture

* Adjust placement of tikz picture (for tikz-cd)

* Fix unread oversight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tikz-cd.sty support
2 participants