Sunday

LaTeX: Draw Smiley using TikZ package

Download and install Basic MiKTeX 64-bit Installer from
http://miktex.org/download

Start Menu > MiKTeX > TeXworks

Name and save the empty new file as texworks_smiley.tex

Write code below:
{
\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{figure}[H] %Here placement specifier
\begin{center}
\begin{tikzpicture}
\filldraw[fill=yellow,draw=black,very thick] (0,0) ellipse (3cm and 4cm); %draw face
\fill[black] (-1,2) ellipse (0.5cm and 1cm); %draw left eye
\fill[black] (1,2) ellipse (0.5cm and 1cm); %draw right eye
\draw[black,very thick] (-2.1,0) arc (225:315:3cm); %start point from (-2.1,0), radius is 3cm, starting angle 225 degree
\end{tikzpicture}
\end{center}
\end{figure}
\end{document} 
}

Toolbar >  Typeset of play icon
or
Hit Ctrl+T to execute and typeset the LaTeX code

Output:

No comments:

Measure execution time with Julia, example using sorting algorithms

# random integers between 1 and 100 inclusive, generate thousands of them x = rand ( 1 : 100 , 100000 ) @time sort (x; alg=InsertionSort, r...