Site icon texblog

Simple Smiley faces with TiKZ in LaTeX

I recently wrote an article on side-by-side figures in LaTeX (TUGboat 34:1), based on a series of posts on this blog. For illustration of the code samples, I created a series of very basic Smileys faces for which I publish the code here. Let me know below if you have suggestions for improvement or ideas for additional emotions. Thank you :-).

 

Neutral Smiley

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}
\draw[thick] (0cm,0cm) circle(1cm);
\draw[thick] (-0.5,-0.6) -- (0.5,-0.6);
\draw [thick, fill=black] (0,-0.2) circle (0.1);
\draw [rotate=90, fill=black] (0.3,0.3) ellipse (0.2 and 0.1);
\draw [rotate=90, fill=black] (0.3,-0.3) ellipse (0.2 and 0.1);
\end{tikzpicture}
\end{document}

 

Happy Smiley

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}
\draw[thick] (0cm,0cm) circle(1cm);
\draw[thick] plot [smooth,tension=1.5] coordinates{(-0.5,-0.5) (0,-0.8) (0.5,-0.5)};
\draw [thick, fill=black] (0,-0.2) circle (0.1);
\draw[thick] plot [smooth,tension=1.5] coordinates{(-0.4,0.4) (-0.3,0.5) (-0.2,0.4)};
\draw[thick] plot [smooth,tension=1.5] coordinates{(0.4,0.4) (0.3,0.5) (0.2,0.4)};
\end{tikzpicture}
\end{document}

 

Sad Smiley

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}
\draw[thick] (0cm,0cm) circle(1cm);
\draw[thick] plot [smooth,tension=1.5] coordinates{(-0.5,-0.6) (0,-0.4) (0.5,-0.6)};
\draw [thick, fill=black] (0,-0.2) circle (0.1);
\draw [rotate=90, fill=black] (0.3,0.3) ellipse (0.2 and 0.1);
\draw [rotate=90, fill=black] (0.3,-0.3) ellipse (0.2 and 0.1);
\draw[thick] plot [smooth,tension=1.5] coordinates{(0.3,0.0) (0.4,-0.2) (0.2,-0.2) (0.3,0.0)};
\end{tikzpicture}
\end{document}

 

Sleepy Smiley

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}
\draw[thick] (0cm,0cm) circle(1cm);
\draw[thick] (-0.4,0.3) -- (-0.2,0.3);
\draw[thick] (0.4,0.3) -- (0.2,0.3);
\draw [thick, fill=black] (0,-0.2) circle (0.1);
\draw [thick, fill=white] (0,-0.4) circle (0.2);
\end{tikzpicture}
\end{document}

 

Angry Smiley

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}
\draw[thick] (0cm,0cm) circle(1cm);
\draw[thick] plot [smooth,tension=1.5] coordinates{(-0.3,-0.7) (-0.2,-0.6) (0.3,-0.6)};
\draw[thick] (-0.4,0.5) -- (-0.2,0.4);
\draw[thick] (0.4,0.6) -- (0.2,0.5);
\draw [thick, fill=black] (0,-0.2) circle (0.1);
\draw [rotate=90, fill=black] (0.3,0.3) ellipse (0.05 and 0.1);
\draw [rotate=90, fill=black] (0.3,-0.3) ellipse (0.05 and 0.1);
\end{tikzpicture}
\end{document}

 

Blush Smiley

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}
\draw[thick] (0,0) circle (1);
\draw[thick] plot [smooth,tension=1.5] coordinates{(-0.3,-0.5) (0,-0.7) (0.3,-0.5)};\draw [thick, fill=black] (0,-0.2) circle (0.1);
\node[circle,minimum width=0.1, inner color=black] at (-0.6,-0.2) {};
\node[circle,minimum width=0.1, inner color=black] at (0.6,-0.2) {};
\draw [rotate=90, fill=black] (0.3,0.3) ellipse (0.2 and 0.1);
\draw [rotate=90, fill=black] (0.3,-0.3) ellipse (0.2 and 0.1);
\end{tikzpicture}
\end{document}
Exit mobile version