1

I would like to define something called fieldtower (a style?) which stands for arrows=no head, column sep=small. This thing should be usable at will between tikzcd environments. So something like this

\begin{tikzcd}[style=fieldtower]
    ...
\end{tikzcd}

is equivalent to this:

\begin{tikzcd}[arrows=no head, column sep=small]
    ...
\end{tikzcd}

Is there way to do this, that's better than a macro? I've tried the following tikz code, but using it in this context just produces a strange error.

\tikzstyle{fieldtower} = [arrows=no head, column sep=small]
3
  • Did you try \newcommand{\fieldtower}{arrows=no head, column sep=small} and \begin{tikzcd}[\fieldtower]?
    – SebGlav
    Feb 4, 2022 at 21:59
  • @SebGlav Did you try?
    – egreg
    Feb 4, 2022 at 23:08
  • I have to admit I didn't at this time (no computer to try) and that it was a dumb idea ;)
    – SebGlav
    Feb 5, 2022 at 11:45

1 Answer 1

4

I'd say

\tikzcdset{fieldtower/.style={arrows=no head, column sep=small}}

Note that \tikzstyle has been deprecated for some years.

\documentclass{article}
\usepackage{tikz-cd}

\tikzcdset{fieldtower/.style={arrows=no head, column sep=small}}

\begin{document}

\begin{tikzcd}
A \arrow[r] & B \arrow[d] \\
& C
\end{tikzcd}

\bigskip

\begin{tikzcd}[fieldtower]
A \arrow[r] & B \arrow[d] \\
& C
\end{tikzcd}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .