1

So I tried looking for that on the net, but nobody seems to be addressing this issue.

I am trying to add diagrams to a document, and it does work. But the result is not as fancy as in this tool : https://tikzcd.yichuanshen.de/.

Here is a comparison :

On the website

On my document

The difference is that mine is not square-ish, which I'd like to change. Is there some sort of styling option available ? It appears that most of the pictures of usage of tikz-cd have the fancy version, and the documentation does not troubleshoot this.


Here is the header I have :

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[english,french]{babel}
\usepackage[top=1in,left=1in,right=1in,bottom=1in]{geometry}
\usepackage{graphicx}
\usepackage{amsmath,amssymb,amsthm,bbm,mathrsfs}
\usepackage{color}
\usepackage{textcomp}
\usepackage{tikz}
\usepackage{tikz-cd}

And I'm basically having this :

\begin{center}
    \begin{tikzcd}
        \pi^{-1}(U) \arrow[d, "\pi"'] \arrow[r, "\varphi"] & U\times F \arrow[ld, "\text{pr}_1"] \\
            U                                                  &                                    
    \end{tikzcd}
\end{center}
3
  • 1
    You can use the options row sep =... and column sep =.... to create your triangle with tikz-cd. Please, can you add your complilable code?
    – Sebastiano
    Commented May 6, 2020 at 22:08
  • 2
    It is very easy to add this background but obviously it is not something that most users want so it is not automatic.
    – user194703
    Commented May 6, 2020 at 22:20
  • Oh sorry if I left some confusion, I'm not talking about the gray UI from the tool, I'm just talking about the fact my diagrams are more rectangular-shaped than square !
    – Anthony
    Commented May 6, 2020 at 22:23

1 Answer 1

2

Using the parameters, for example, [row sep=1.5cm, column sep=1cm] you will have.....

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[english,french]{babel}
\usepackage[top=1in,left=1in,right=1in,bottom=1in]{geometry}
\usepackage{graphicx}
\usepackage{amsmath,amssymb,amsthm,bbm,mathrsfs}
\usepackage{color}
\usepackage{textcomp}
\usepackage{tikz}
\usepackage{tikz-cd}
\begin{document}
\begin{center}
\begin{tikzcd}[row sep=1.5cm, column sep=1cm]
 \pi^{-1}(U) \arrow[d, "\pi"'] \arrow[r, "\varphi"] & U\times F \arrow[ld, "\text{pr}_1"] \\
 U  &                                    
\end{tikzcd}
\end{center}
\end{document}

this output:

enter image description here

4
  • Works like a charm ! Do you know if there is a way to do it consistently for all diagrams ? (a header option maybe ?)
    – Anthony
    Commented May 6, 2020 at 22:26
  • 1
    I think that into the manual tikz-cd there are specific details on your question. For my opinion there is important also the creativity. :-) Look the manual texdoc.net/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.pdf to pag.7, [column sep=small], [column sep=scriptsize] pag. 8, \begin{tikzcd}[row sep=scriptsize, column sep=scriptsize] pag. 10, for example. There is not a specific rule.
    – Sebastiano
    Commented May 6, 2020 at 22:30
  • FFR : \tikzcdset{row sep/normal=1.5cm, column sep/normal=1cm}
    – Anthony
    Commented May 6, 2020 at 22:35
  • 1
    @Anthony It is possible :-)....Remember: I am a modest user...:-) and I want to remain thus!
    – Sebastiano
    Commented May 6, 2020 at 22:35

You must log in to answer this question.

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