2
\begin{tikzcd}
3 \arrow[dr] & \\
4 \arrow[r] & 2\arrow[dr] & \\
1
\end{tikzcd}

enter image description here

could you help me? how do yo writting latex?

  • I see you've asked some questions about similar diagrams before, are you able to do any part of this yourself? Where does the problem lie, exactly? – Torbjørn T. Jan 19 at 11:35
  • the direction of the arrows and the writing of numbers. i can't get the image i want – tuce Jan 19 at 11:38
  • Then show us the code with what you have achieved so far. – Stefan Pinnow Jan 19 at 11:38
  • all I did was faulty, – tuce Jan 19 at 11:40
  • 2
    So? Usually a question saying "I have this code that does this, but I want to get the output shown in this image, what do I have to change" is better than "what code do I need to reproduce this image". – Torbjørn T. Jan 19 at 11:44
6

Like this?

\documentclass[margin=1cm]{standalone}
\usepackage{amsmath}     
\usepackage{tikz,tikz-cd}
\begin{document}

\begin{tikzcd}
3 \arrow[rd] &  &  \\
4 \arrow[r] &
\begin{array}{c}
2\\
3\  4
\end{array}   
\arrow[rd] &  \\
 &  & 
 \begin{array}{c}
1\\
2\\
3\ 4
\end{array}   
\end{tikzcd}
\end{document}

enter image description here

  • thank you, yes, but how can I write these numbers a little closer? – tuce Jan 19 at 12:30
6

You can set the numbers in an array, but in \footnotesize, with reduced interline spacing. Better to define a suitable command for it.

With between origins, the south-east bound arrows will be aligned.

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

\newcommand{\stack}[1]{%
  \mbox{%
    \footnotesize
    \renewcommand{\arraystretch}{0.75}%
    $\begin{array}{@{}c@{}}#1\end{array}$%
  }%
}

\begin{document}

\[
\begin{tikzcd}[row sep={4em,between origins},column sep={4em,between origins}]
\stack{3} \arrow[dr] \\
\stack{4} \arrow[r] &
\stack{2\\3\;4} \arrow[dr] \\
&& \stack{1\\2\\3\;4}
\end{tikzcd}
\qquad
\begin{tikzcd}[row sep={4em,between origins},column sep={4em,between origins}]
\stack{1\\2\\3} \arrow[dr] \\
\stack{1\\2\\4} \arrow[r] &
\stack{1\\2} \arrow[dr] \\
&& \stack{1}
\end{tikzcd}
\]

\end{document}

enter image description here

If you want Times-like fonts, use newtx:

\documentclass{article}
\usepackage{amsmath,tikz-cd}
\usepackage{newtxtext,newtxmath}

\tikzcdset{arrow style=math font}

\newcommand{\stack}[1]{%
  \mbox{%
    \footnotesize
    \renewcommand{\arraystretch}{0.75}%
    $\begin{array}{@{}c@{}}#1\end{array}$%
  }%
}

\begin{document}

\[
\begin{tikzcd}[row sep={4em,between origins},column sep={4em,between origins}]
\stack{3} \arrow[dr] \\
\stack{4} \arrow[r] &
\stack{2\\3\;4} \arrow[dr] \\
&& \stack{1\\2\\3\;4}
\end{tikzcd}
\qquad
\begin{tikzcd}[row sep={4em,between origins},column sep={4em,between origins}]
\stack{1\\2\\3} \arrow[dr] \\
\stack{1\\2\\4} \arrow[r] &
\stack{1\\2} \arrow[dr] \\
&& \stack{1}
\end{tikzcd}
\]

\end{document}

enter image description here

Your picture seems to have been produced with Xy-pic (but the quality is inferior and the arrow tips very ugly).

\documentclass{article}
\usepackage{amsmath}
\usepackage[all]{xy}
\usepackage{newtxtext,newtxmath}

\newcommand{\stack}[1]{%
  \mbox{%
    \footnotesize
    \renewcommand{\arraystretch}{0.75}%
    $\begin{array}{@{}c@{}}#1\end{array}$%
  }%
}

\begin{document}

\[
\xymatrix@R-1pc{
  \stack{3} \ar[dr] \\
  \stack{4} \ar[r] &
  \stack{2\\3\;4} \ar[dr] \\
  && \stack{1\\2\\3\;4}
}
\qquad
\xymatrix@R-1pc{
  \stack{1\\2\\3} \ar[dr] \\
  \stack{1\\2\\4} \ar[r] &
  \stack{1\\2} \ar[dr] \\
  && \stack{1}
}
\]

\end{document}

enter image description here

  • Excuse me very much for my opinion. Please can you add the same example with Xy-pic. Peraphs with newtxmath and \usepackage[all,cmtip]{xy} the result is the same of the picture? – Sebastiano Jan 19 at 15:42
  • @Sebastiano Added – egreg Jan 19 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.