I'm on overleaf doing some homework with latex and part of it includes adding a picture of this triangle on the right side of the paper. I know I have to use tikz but when I try and research it myself, I get bombarded with different answers that are not exactly what I'm looking for. Please help!
Asked
Active
Viewed 2,805 times
2
-
6And we are supposed to do your homework? ;-) – Feb 03 '18 at 23:16
-
no, I would like some guidance on how to create it. that's why I said "How do I..." not "Create for me". I already did all of the other coding but when it comes to creating the triangle itself, I don't know. – Priscilla96 Feb 03 '18 at 23:22
-
2Have a look at https://commons.wikimedia.org/wiki/File:Equilateral-triangle-tikz.svg The code below the image should give you enough hints to start. – Uwe Ziegenhagen Feb 03 '18 at 23:39
-
Also related: Automatically draw and labels angles of a triangle in TikZ and How do I draw a little red square to label my right triangle? – Claudio Fiandrino Feb 04 '18 at 14:20
2 Answers
3
For fun, here is a short code with pst-eucl, which works well with xelatex:
\documentclass{article}
\usepackage{pst-eucl}%,
\pagestyle{empty}
\begin{document}
$ \begin{pspicture}
{\psset{dimen=middle, unit=2, labelsep=0.8ex, linejoin = 1}
\pstTriangle[PointSymbol = none, PosAngle = {90,180,0}, PointNameSep = 0.8em](1.2;75){A}(0,0){B}(1.6, 0){C}}
\psset{linewidth = 0.5pt,MarkAngleRadius =5mm}
{\psset{unit = 7.5mm}
\pstMarkAngle{B}{A}{C}{$ \alpha $}
\pstMarkAngle{C}{B}{A}{$ \beta $}
\pstMarkAngle{A}{C}{B}{$ \gamma $}}
\psset{linestyle = none, labelsep =3pt , shortput = nab}
\ncline{A}{B}_{$ c $}%
\ncline{B}{C}_{$ a $}
\ncline{C}{A}_{$ b $}
\end{pspicture} $
\end{document}
Bernard
- 271,350
1
Also for the fun, here is a way to do it with MetaPost, included in a LuaLaTeX program (MetaPost being included in LuaTeX).
The Metafun format of MetaPost has been used here for its handy and self-explanatory anglebetween macro.
\documentclass[border=3mm]{standalone}
\usepackage{luatex85, luamplib}
\mplibsetformat{metafun}
\mplibtextextlabel{enable}
\begin{document}
\begin{mplibcode}
u = .75cm;
beginfig(1);
pair A, B, C;
A = u*(1, 5); B = origin; C = u*(7, 0);
draw A--B--C--cycle;
label.lft("$B$", B);
label.ulft("$A$", A);
label.rt("$C$", C);
label.lft("$c$", .5[A,B]);
label.urt("$b$", .5[A,C]);
label.bot("$a$", .5[B,C]);
draw anglebetween(A--B, A--C, "$\alpha$");
draw anglebetween(B--A, B--C, "$\beta$");
draw anglebetween(C--A, C--B, "$\gamma$");
endfig;
\end{mplibcode}
\end{document}
Franck Pastor
- 18,756


