Skip to content

Introduce equationcd as shortcut for equation + tikzcd environment#9

Draft
tobiasdiez wants to merge 1 commit into
astoff:masterfrom
tobiasdiez:patch-2
Draft

Introduce equationcd as shortcut for equation + tikzcd environment#9
tobiasdiez wants to merge 1 commit into
astoff:masterfrom
tobiasdiez:patch-2

Conversation

@tobiasdiez

Copy link
Copy Markdown

It is quite common to display commutative diagrams as display equations (in fact, I would argue that 90% of all diagrams are displayed in this way). For this one has to wrap the tikzcd environment in an equation environment, which leads to a quite complex construction.

This PR introduces a new environment equationcd that wraps tikzcd in equation, so that one can simply write

\begin{equationcd][label = equationLabel, tikz = tikzcdStyles]
commutative diagram comes here
\end{equationcd}

Things to do:

  • Document addition

@astoff

astoff commented May 1, 2020

Copy link
Copy Markdown
Owner

I'm a bit conservative at this point about adding smart functionality like this because it can hard to get all corner cases working right. That said:

  • The package must be format-independent (like TikZ itself) and not depend on expl3
  • The syntax \begin{equationcd}[some regular tikzcd option], as opposed to \begin{equationcd}[tikz = some regular tikzcd option], must work. Especially given that if commas or equal signs are involved, you need to "protect" everything with braces, which is annoying.

I also think the benefits of this feature has to be weighted against the simplicity of leaving it to the user to define, say, \newenvironment{equationcd*}{\[\tikzcd}{\endtikzcd\]}, which covers at least the unnumbered version.

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.

2 participants