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.sty support #1280

Closed
l8l opened this issue May 13, 2020 · 3 comments · Fixed by #2325
Closed

tikz-cd.sty support #1280

l8l opened this issue May 13, 2020 · 3 comments · Fixed by #2325

Comments

@l8l
Copy link

l8l commented May 13, 2020

For all sorts of diagrams in mathematics, the latex tikz-cd package (distinct from tikz), is extremely useful. As can be seen here, it is one of the most used packages for which there is no binding yet.

I provide below the code of a minimal example that I would like to be able to convert into html (format html5 with mathml (including a mathjax fallback option) or mathsvg)

\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage{tikz-cd}

\begin{document}

\title{LaTeXML with tikz-cd}
\maketitle

\begin{abstract}
This is a sample LaTeXML document with a missing binding for the tikz-cd package.
\end{abstract}

\section{First Section}

Here is a typical tikz-cd graph:
\begin{equation}
  \begin{tikzcd}
    	A \ar{r}{\phi} \ar{d}{a} \ar{dr}{b} & B \\
    	C & D
  \end{tikzcd}
\end{equation}

\end{document}

As I said, it would already be fine/very useful if latexml would be able to convert all the graphs into svg-images and include them on the html site, even when the rest of the equations are in the format mathml. I suppose that this should be easier than a complete mathml support for graphs because one could write a macro that compiles the diagram as a standalone and then includes the svg automatically at the right place.

In case it helps, I also provide below the code for a minimal standalone latex document that produces (upon compilation with latex) the graph as a single pdf document:

\documentclass[tikz, preview]{standalone}
\usepackage{amsmath,amssymb,amsfonts}
% any other macros or packages that might affect the diagram
\usepackage{tikz-cd}
\begin{document}
\begin{equation}
  \begin{tikzcd}
    	A \ar{r}{\phi} \ar{d}{a} \ar{dr}{b} & B \\
    	C & D
  \end{tikzcd}
\end{equation}
\end{document}

Thanks a lot.

@dginev
Copy link
Collaborator

dginev commented Oct 23, 2020

One early comment I will make for this issue is that on my (hopefully vanilla) texlive 2019 I am seeing tikz-cdrelying on a pgf version 3 library tikzlibraryarrows.meta.code.tex, which isn't installed on my system. So this should be something we visit after we have baseline tikz working on a texlive 2020, and maybe we can achieve a direct reliance on the pgf kernel with little binding intervention for tikz-cd.

@dginev dginev changed the title tikz-cd binding support in LaTeXML tikz-cd.sty support Nov 11, 2020
@dginev
Copy link
Collaborator

dginev commented Dec 29, 2020

The build log of the first example looks much better after the latest merge of #1413 .

What seems required next is an upgrade to latexml's treatment of halign, (discussed some time back e.g. in #760, and now on our mid-term roadmap. We should be able to implement a range of features and bindings once we ship that upgrade, tikz-cd and xy being two big beneficiaries.

@dginev dginev mentioned this issue Dec 29, 2020
@dginev
Copy link
Collaborator

dginev commented Mar 16, 2022

Update: tikz-cd support is one of the most vocally requested packages from the ar5iv announcement period.

In addition, a doctoral candidate who has completed their thesis tried out latexml and reported back on twitter with tikz-cd as one of the most "dangeours" missing pieces, i.e. one of the most likely to cause errors/fatals.

Side-note: They also ran into a pgf Fatal that was already patched in the github head branch, so we may also consider a 0.8.7 release at some recent point.

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

Successfully merging a pull request may close this issue.

3 participants