TeX - LaTeX Asked by Emmanuel Chibuzo Akaligwo on January 3, 2021
What would be the LaTeX code for the diagram below?
I have attached my code:
documentclass[10pt,a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{amssymb}
usepackage{graphicx}
begin{document}
begin{eqnarray}label{cdofNLalgebra}
setlength{unitlength}{1cm}
begin{array}{l}
begin{picture}(4,2.6)
put(1.4,2.3){$X$}
put(1.7,2.4){vector(1,0){2.3}}
put(4.1,2.3){$Y$}
put(4.1,2.2){vector(0, -1){1.8}}
put(4.2,1.2){$pi_2$}
put(3.6,0.0){$G(T)$}
put(1.7,2.3){vector(1,-1){2.0}}
put(2.3,1.2){$pi_1$}
end{picture}
end{array}
end{eqnarray}
end{document}
You can also use tikz-cd
.
documentclass[tikz, margin=10pt]{standalone}
usepackage{tikz-cd} % if tikz is already loaded, you can also use usetikzlibrary{cd}
begin{document}
begin{tikzcd}[row sep=2cm]
& G(T) arrow{dl}[swap]{pi_1} arrow[leftrightarrow]{dr}{pi_2} &
X arrow[rr] arrow[ur, bend right=15,dashrightarrow] & & Y
end{tikzcd}
end{document}
Correct answer by Alenanno on January 3, 2021
It looks like you want to draw a commutative diagram of some sort. There are packages which make this quite easy, e.g. diagxy or xymatrix.
Answered by gmvh on January 3, 2021
Just a general example of doing such like drawings-- if you want you can increase the bend angle of the arrow in the preamble
documentclass[tikz, margin=3.14159mm]{standalone}
usetikzlibrary{arrows.meta,
calc,
positioning,
quotes}
begin{document}
begin{tikzpicture}[
node distance = 35mm,
vertex/.style = {text width=3.2em, align=center},
every edge/.style = {-Straight Barb, draw, semithick},
bend angle=15 % <---
]
%
node (B) [vertex] { $X$};
node (C) [vertex, right=of B] { $Y$};
node (A) [vertex, above=of $(B.north)!0.5!(C.north)$] { $G(T)$};
%
draw (A) edge ["$pi_1$" '] (B)
(B) edge [bend right, dashed] (A)
(C) edge [<->, "$pi_2$" '] (A)
(B) edge [] (C);
end{tikzpicture}
end{document}
Answered by js bibra on January 3, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP