1

Following is the minimal working example

\documentclass[12pt,reqno,a4paper]{amsart}
%\usepackage[utf8]{inputenc} % not needed with up-to-date TeX systems
\usepackage[english]{babel}
\usepackage[all]{xy}
\usepackage{tikz-cd}
\newcommand{\mc}{\mathcal}
\begin{document}
\begin{equation}\begin{tikzcd}
    & & (\mc{G}_1\times_M \mc{H}_1)/\mc{G}_1 \arrow[ldd] \arrow[rdd] & & \\
    & & \mc{G}_1 \arrow[dd,xshift=0.75ex,"t"]\arrow[dd,xshift=-0.75ex,"s"'] & & \mc{H}_1 \arrow[dd,xshift=0.75ex,"t"]\arrow[dd,xshift=-0.75ex,"s"'] \\
    & \mc{G}_1 \arrow[ld, "t_{\mc{G}}"'] \arrow[rd, "s_{\mc{G}}"] & & \mc{H}_1 \arrow[ld, "t_{\mc{H}}"'] \arrow[rd] & \\
    M & & M & & M 
    \end{tikzcd}.\end{equation}

    \begin{equation}    \begin{tikzcd}[sep=small]
    \underline{M} \arrow[dd,"L"'] \arrow[rr, "G"] & & \underline{N} \arrow[dd, "q"] \\
    & & \\
    \mc{D} \arrow[Rightarrow, shorten >=20pt, shorten <=20pt, uurr] \arrow[rr, "F"] & & \mc{C}
    \end{tikzcd}. \end{equation}
\end{document}

Question is the following:

Is the size of a diagram in tikzcd fixed or can one increase or decrease the size of the diagram?

I have followed suggestion in the below answer. It worked for the first diagram (in the edited version) but, second diagram has distorted. I am adding the picture of it.

enter image description here

3

1 Answer 1

4
+50

tikz-cd has several options to change the size, such as sep=tiny, small, large or huge, or the cramped option. They are described on p. 7 of the manual. However, as tikz-cd is "secretly" a TikZ matrix, you can also use the tikz keys column sep or row sep, and access all the other styles of sections 20 and 60 of pgfmanual v3.1.5. The discussion of matrices in the pgfmanual is likely be extended in the future.

\documentclass[12pt,reqno,a4paper]{amsart}
\usepackage{tikz-cd}
\begin{document}
\begin{equation}
\begin{tikzcd}[sep=small]
& & (\mathcal{G}_1\times_M \mathcal{H}_1)/\mathcal{G}_1 \arrow[ldd] \arrow[rdd] & & \\
& & \mathcal{G}_1 \arrow[dd,shift left=0.75ex,"t"]\arrow[dd,shift left=-0.75ex,"s"'] & &
\mathcal{H}_1 \arrow[dd,shift left=0.75ex,"t"]\arrow[dd,shift left=-0.75ex,"s"'] \\
& \mathcal{G}_1 \arrow[ld, "t_{\mathcal{G}}"'] \arrow[rd, "s_{\mathcal{G}}"] & & \mathcal{H}_1 \arrow[ld, "t_{\mathcal{H}}"'] \arrow[rd] & \\
M & & M & & M 
\end{tikzcd}\;.
\end{equation}
\begin{equation}
\begin{tikzcd}[column sep=1ex,row sep=1ex]
& & (\mathcal{G}_1\times_M \mathcal{H}_1)/\mathcal{G}_1 \arrow[ldd] \arrow[rdd] & & \\
& & \mathcal{G}_1 \arrow[dd,shift left=0.75ex,"t"]\arrow[dd,shift left=-0.75ex,"s"'] & &
\mathcal{H}_1 \arrow[dd,shift left=0.75ex,"t"]\arrow[dd,shift left=-0.75ex,"s"'] \\
& \mathcal{G}_1 \arrow[ld, "t_{\mathcal{G}}"'] \arrow[rd, "s_{\mathcal{G}}"] & & \mathcal{H}_1 \arrow[ld, "t_{\mathcal{H}}"'] \arrow[rd] & \\
M & & M & & M 
\end{tikzcd}\;.
\end{equation}
\end{document}

enter image description here

Let me also mention that the example you are giving is working, but not really minimal. I also replace the xshift by shift left.

9
  • oh no :D It does not look good.. :( Commented Jun 3, 2020 at 7:54
  • 2
    @PraphullaKoushik Well, that's your opinion. I have no idea what your aesthetics preferences are, but this post does answer the question Is the size of a diagram in tikzcd fixed or can one increase or decrease the size of the diagram?, though.
    – user194703
    Commented Jun 3, 2020 at 7:59
  • Yes Yes.. It does answer my question :) Commented Jun 3, 2020 at 7:59
  • 1
    @PraphullaKoushik It has a huge preamble, most of which is not relevant for the question/diagram. To produce the diagram the small preamble of the answer is sufficient. (While there are different opinions, I do not recommend using macros like \newcommand{\mc}{\mathcal} since, if you ever collaborate with others and share the code, and each collaborator has their own macros, the confusion is tremendous. But this is just an opinion.) "Minimal" means the minimal amount of packages and macros relevant to the problem.
    – user194703
    Commented Jun 3, 2020 at 8:15
  • 2
    @PraphullaKoushik When I compile your code, I do not get a distorted diagram. The only problem is shorten >=20pt, shorten <=20pt, in \arrow[Rightarrow, shorten >=20pt, shorten <=20pt, uurr] . If I remove these keys, i.e. use \arrow[Rightarrow, uurr] instead, the diagram looks fine to me.
    – user194703
    Commented Jun 6, 2020 at 18:49

You must log in to answer this question.

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