Kamis, 13 Februari 2025

Latex Shapes 1

1. Open the Latex editor
2. Type this following Latex code in your Latex editor:

% !TEX TS-program = pdflatex

%% File Description:

%% to draw a Latex Shapes


\documentclass{article}

%% Load Packages

\usepackage{amsmath}

\usepackage{tikz}

\usetikzlibrary{shapes.geometric}


\usepackage[active,multi,pdftex,tightpage]{preview}

\PreviewEnvironment[{[]}]{tikzpicture}

\setlength\PreviewBorder{5pt}


\usepackage[euler-digits,euler-hat-accent]{eulervm}

\usepackage{bookman}

\usepackage[T1]{fontenc}


\begin{document}


\begin{figure}

\begin{tikzpicture}

% -------------------

% rounded rectangle shape

%% requires tikz package

% -------------------

\draw[rounded corners,very thick] (0,0) rectangle (5,2); \draw (2.5,-0.2) node [below]  {\textbf{Rounded Rectangle}};

\end{tikzpicture}

\end{figure}


\begin{figure}

\begin{tikzpicture}

% -------------------

% a diamond shape

% requires library shapes.geometric

% -------------------

\node [diamond,very thick,draw=black,fill=white,text=white,aspect=2] {\textbf{Diamond Shape}};

\draw (0,-1) node[below] {\textbf{Diamond Shape}};

\end{tikzpicture}

\end{figure}


\begin{figure}

\begin{tikzpicture}

% -------------------

% a black circled shape

% requires tikz package

% -------------------

\node [circle,radius=5,draw=black,fill=black,

very thick] (0,0) {\textbf{Black Circle Shape}};

\draw (0,-2) node[below] {\textbf{Black Circle Shape}};

\end{tikzpicture}

\end{figure}

\end{document}

3. Save file as roundedRectangle1.tex

4. Then build or typeset the Latex code.

Output




Related Post

Tidak ada komentar:

Posting Komentar

Various Other Posts