How to write the LaTex code of the tetrahedron (avoiding the arrow) given in the figure below:
Asked
Active
Viewed 2,497 times
3
Enlico
- 2,592
Shahnawaz Ahmad
- 469
2 Answers
4
\documentclass{article}
\usepackage{pst-solides3d}
\begin{document}
\psset{viewpoint=40 -10 10 rtp2xyz,lightsrc=viewpoint,Decran=30}
\begin{pspicture}[solidmemory](-2,-2)(3,3)
\psSolid[object=tetrahedron,r=3,action=draw*,name=T]% without 0
\psSolid[object=point,definition=solidgetsommet,args=T 0,text=d,pos=uc]% Point T0 %(top)
\psSolid[object=point,definition=solidgetsommet,args=T 1,text=c,pos=cl]% Point T1
\psSolid[object=point,definition=solidgetsommet,args=T 2,text=b,pos=dc]% Point T1
\psSolid[object=point,definition=solidgetsommet,args=T 3,text=a,pos=cr]% Point T1
\end{pspicture}
\end{document}
-
Herbert, I have compiled with Latex and PDF does not appear the drawing. Why? (I use TXCenter). – benedito Nov 14 '16 at 09:29
-
-
-
I will create your figure with
pstplusat the link http://www.xm1math.net/pstplus/index.html. – Sebastiano Dec 15 '16 at 17:42
4
The following code makes use of tikz package.
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (a) at (4,2.5);
\coordinate (b) at (3,.8);
\coordinate (c) at (5,0);
\coordinate (d) at (5.3,1.2);
\coordinate (e) at (0,0);
\draw[thick, fill=black!10] (a) -- (b) -- (e) -- cycle;
\draw[thick, fill=black!20] (a) -- (b) -- (c) -- (d) -- cycle;
\draw[thick, fill=black!30] (b) -- (c) -- (e) -- cycle;
\draw[very thick] (a) -- (c);
\draw[thick, dash dot dot] (b) -- (d);
\fill[black!20, draw=black, thick] (a) circle (3pt) node[black, above right] {$a$};
\fill[black!20, draw=black, thick] (b) circle (3pt) node[black, above left] {$b$};
\fill[black!20, draw=black, thick] (c) circle (3pt) node[black, below right] {$c$};
\fill[black!20, draw=black, thick] (d) circle (3pt) node[black, above right] {$d$};
\fill[black!20, draw=black, thick] (e) circle (3pt) node[black, below left] {$e$};
\end{tikzpicture}
\end{document}
which results in
You can further play with positions and anchors of nodes to get exactly the alignment you want for labels.
Enlico
- 2,592
-
Thank you so much. But I can not set figure number below this diagram. – Shahnawaz Ahmad Nov 13 '16 at 18:38
-
If you are talking about "Figure 3: In this sketch a nice tetrahedron is depicted", that is the caption, you should simply put the
tikzpictureenvironment inside afigureenvironment and add acaptionafter it (still inside thefigureenv). – Enlico Nov 13 '16 at 20:13


TikZtoPSTricks. – Johannes_B Nov 13 '16 at 09:48tikz-pgftag, since the OP didn't mention a desired method to obtain the sketch (not in the title, nor in the text), so any approach is good, thePSTricksone as well as theTikZone. – Enlico Nov 13 '16 at 20:21