Asked
Active
Viewed 699 times
0
-
2Welcome to the site. What have you tried so far? Can you post some code? – Steven B. Segletes Jun 29 '16 at 17:44
-
unfortunately, I have not any code with respect to this figure. I don't know where I must start. – Nima Jun 29 '16 at 17:47
-
2@Nima: You must start here: What are good learning resources for a LaTeX beginner? – Werner Jun 29 '16 at 18:06
2 Answers
3
Here is a short solution with pstricks. Loading auto-pst-pdf, you can compile with pdflatex, if you use the --enable-write18' switch for MiKTeX,shell-escapefor TeX Live or MacTeX. Alternatively you can compile directly withxelatex`:
\documentclass[a4paper, 11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}%
\usepackage{lmodern}
\usepackage[x11names]{pstricks}%, pdf[]
\usepackage{pst-poly}
\usepackage{auto-pst-pdf} % for pdflatex
\pagestyle{empty}
\begin{document}
\begin{pspicture}%
\psset{unit=1.5cm, linewidth=0.6pt, arrows=c, shortput=nab, linejoin=1}
\rput(0,0){\PstSquare[PolyName=A]}
\rput(2,0){\PstSquare[PolyName=B]}
\psset{fillstyle=solid, fillcolor=Grey0!60!}
\pspolygon(A2)(A3)(A4)
\pspolygon(B2)(B1)(B4)
\psset{linestyle=solid, labelsep=2.5ex}
\ncline{A2}{A4}_{$ L $}
\ncline{B4}{B2}_{$ U $}
\end{pspicture}
\end{document}
Bernard
- 271,350
3
TikZ requires no special treatment; this gives squares with a 2cm side.
\documentclass{article}
\usepackage{tikz,xcolor}
\begin{document}
\begin{tikzpicture}
\fill[black!30] (0,0)--(0,2)--(2,0)--cycle ; % the filled triangle
\draw (0,0)--(0,2)--(2,2)--(2,0)--cycle ; % the square
\draw (0,2)--(2,0) ; % the diagonal
\node at (0.5,0.5) {$L$} ; % the label
\end{tikzpicture}\quad
\begin{tikzpicture}
\fill[black!30] (2,2)--(0,2)--(2,0)--cycle ;
\draw (0,0)--(0,2)--(2,2)--(2,0)--cycle ;
\draw (0,2)--(2,0) ;
\node at (1.5,1.5) {$U$} ;
\end{tikzpicture}
\end{document}
egreg
- 1,121,712


