Jumat, 19 Juli 2024

Draw Rectangle In Latex 1

  1. add this following latex package on the latex preamble:
    \usepackage[pdftex]{pict2e}
  2. type this latex code in your latex editor:
    \subsection*{Rectangle ABCD with Naming All Vertices and Labelling All Sides}
    \vspace{1em}
    \setlength{\unitlength}{1cm}
    \setlength{\fboxrule}{0.1cm} % line or border thickness
    \setlength{\fboxsep}{0pt}
    \fbox{\begin{picture}(7,3) % width, height of rectangle shape
    % Naming All Vertices
    \put(-0.4,-0.5){\hbox{\kern3pt\texttt{D}}} % bottom left vertice corner
    \put(7.1,-0.45){\hbox{\kern3pt\texttt{C}}} % bottom right vertice corner
    \put(7.05,3.05){\hbox{\kern3pt\texttt{B}}} % top right vertice corner
    \put(-0.5,3.05){\hbox{\kern3pt\texttt{A}}} % top left vertice corner
    % Labelling All Sides
    \put(3,-0.5){\hbox{\kern3pt\texttt{7 cm}}} % bottom side
    \put(7.1,1.5){\hbox{\kern3pt\texttt{3 cm}}} % right side
    \put(3,3.2){\hbox{\kern3pt\texttt{7 cm}}} % top side
    \put(-1.2,1.5){\hbox{\kern3pt\texttt{3 cm}}} % left side
    \end{picture}}
  3. for complete latex source code:
    \documentclass[12pt,a4paper]{article}
    \usepackage[pdftex]{pict2e}
    \usepackage{amsmath}
    \usepackage{amsfonts}
    \usepackage{amssymb}
    \usepackage{fourier}
    \usepackage[dvipsnames]{xcolor}
    \author{private course and after school tutor}
    \begin{document}
    \subsection*{Rectangle ABCD with Naming All Vertices and Labelling All Sides}
    \vspace{1em}
    \setlength{\unitlength}{1cm}
    \setlength{\fboxrule}{0.1cm} % line or border thickness
    \setlength{\fboxsep}{0pt}
    \fbox{\begin{picture}(7,3) % width, height of rectangle shape
    % Naming All Vertices
    \put(-0.4,-0.5){\hbox{\kern3pt\texttt{D}}} % bottom left vertice corner
    \put(7.1,-0.45){\hbox{\kern3pt\texttt{C}}} % bottom right vertice corner
    \put(7.05,3.05){\hbox{\kern3pt\texttt{B}}} % top right vertice corner
    \put(-0.5,3.05){\hbox{\kern3pt\texttt{A}}} % top left vertice corner
    % Labelling All Sides
    \put(3,-0.5){\hbox{\kern3pt\texttt{7 cm}}} % bottom side
    \put(7.1,1.5){\hbox{\kern3pt\texttt{3 cm}}} % right side
    \put(3,3.2){\hbox{\kern3pt\texttt{7 cm}}} % top side
    \put(-1.2,1.5){\hbox{\kern3pt\texttt{3 cm}}} % left side
    \end{picture}}
    \end{document}
  4. compile the latex source code, and then you can see the result:

    rectangle ABCD with naming vertices and measurement labeling

Bibliography

https://latex.org/forum/index.php
https://latexref.xyz/
https://texdoc.org/
https://www.overleaf.com/
https://www.ox.ac.uk/ ( university )

tex math and science document sample, latex math and science document example, learn about latex, latex lesson, mathematics, latex equation, latex draw, drawing in latex, latex graphic

Related Post

Tidak ada komentar:

Posting Komentar

Various Other Posts