Skip to main content

How to draw Reddit Alien in LaTeX using Tikz - Video tutorial and code

If you are not a Redditor you are a lucky person. It's a one way traffic scenario with no dead end. Once you subscribe to Reddit there is no way back and it is no good being there. I am expecting my colleagues to have an intervention for my Reddit addiction soon but till then I am all here to invest (read:waste) my precious time.

Since we got that out of our way, let us get back to business. Today, we are going to see how to draw a cartoon figure using LaTeX. The motivation behind this post is /r/latex on Reddit as I wanted that subreddit to have its logo drawn in LaTeX. I did not know it already was in LaTeX but it seems my work is appreciated there so I am going to contribute my 2 cents to the community.

Specifically, we will learn following things in this tutorial:

  1. How to work with Colors - defining RGB colors in LaTeX.
  2. How to use multiple layers to set order of document objects (send to back, bring forward like functionality).
  3. How to use Arcs in an effective way. 
  4. How to draw lines with multiple points 
  5. How to draw curved lines in LaTeX




Check out this video for explanation of the code. The co-ordinates might look crazy but after you go through the video it will be a cinch. Leave a comment if you have a question. The code is given below, so if you improve it please do let me know and I will post your code on here.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,shadows,arrows}
\begin{document}
\pgfdeclarelayer{background}
\pgfdeclarelayer{main}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
\definecolor{orangered}{RGB}{255,69,00}
\tikzstyle{vrutt}=[draw=orangered, fill=orangered, circle,minimum height=0.5in, line width=5mm]
\tikzstyle{elli}=[draw, ellipse, minimum height=2.85in, text width=2.95in, text centered, line width=5mm]
\begin{tikzpicture}
\begin{pgfonlayer} {foreground}
\node [elli, fill=white] (face) {};
%feet
\node [below of=face,yshift=-4.1in, xshift=-2.0in] (base){};
\draw [line width=5mm](base) -- +(3.8in,0in);
\draw [line width=5mm] (4.3,-11.5) arc (-10:80:1.8);
\draw [line width=5mm] (-4.7,-11.5) arc (190:80:1.8);
%torso
\draw [line width=5mm](face.230) to[out=260, in=150] +(0.75in,-3.15in);
\draw [line width=5mm](face.310) to[out=280, in=30] +(-0.75in,-3.15in);
%eyes
\node [vrutt, xshift=-5em, yshift=9mm] (lefteye) {};
\node [vrutt, xshift=5em, yshift=9mm] (righteye) {};
% Smile
\draw [line width=5mm] (-2.0,-1.0) to[out=320, in=220] (2.0,-1.0);
%Antenna
\draw[line width=5mm](-0.5,3.76) -- +(1cm, 2.5cm) -- +(3.5cm, 2cm);
\node [vrutt, fill=none, draw=black, above of=face, yshift=4.65cm, xshift=3.5cm, minimum height=0.5in] (antenna){};
%Text
\node (face.275)[yshift=-3in] (text){\Huge \textbf{\LaTeX}};
\end{pgfonlayer}
\begin{pgfonlayer} {background}
%Ears
\draw [line width=4mm] (4.4,1.3) arc (-80:315:1);
\draw [line width=4mm] (-4.3,1.3) arc (-80:315:1);
%hands
\draw [line width=4mm] (3.05,-7.8) arc (-70:80:2.3);
\draw [line width=4mm] (-3.05,-7.8) arc (250:90:2.3);
\end{pgfonlayer}
\end{tikzpicture}
\end{document}

The alien looks like this one:














Comments

Post a Comment

Comments on QuickLatex are strictly moderated. As much as I hate moderation, I must fight spam. Please rest assured that if your comment is relevant I will approve it and answer.

Popular posts from this blog

Writing basic math in LaTeX - inline math and math environment

Internet abounds with LaTex tutorials on how to write mathematics equations and simple symbols in LaTeX. It is sometimes not clear as to how the math environment works in general and how to differntiate between inline math equations and how to write them on a line of their own. I earlier did a tutorial on how to write mathematical equations using Latex  which covered the "equation" environment in LaTeX. Math environment is equally important and in this tutorial I am going to talk about how to use basic math environment in LaTeX. Specifically, I am going to discuss how to do the following in LaTeX: How to initiate Math environment Writing inline math equations and writing equations in a separate line How to use frac for equations How to use paranthesis and brackets to enclose mathematical symbols and equations How to type powers and indices How to write matrices Following video illustrates the step by step instructions to use math in LaTeX   The code used in

LaTeX Video Tutorial: How to Create a Resume or CV (Curriculum Vitae) using LaTeX

One of the most frequent questions my colleagues ask me is how to create a Resume or Curriculum Vitae (CV), if you will, in LaTeX . I have a style file that was passed to me by a friend who found it on Internet. Since this looked good I used it and, thanks to the original contributor, I am going to share it with you all today. You will be able to download these files and create a professional Resume for yourself.  The files can be download from the linked locations: The Resume.tex file (main document) The Class file res.cls (for page setting) In the video tutorial , attached below, I have explained how to change the text for your needs. The structure of the Resume (or CV) is highly flexible and once you get hold of the basics it will be pretty straight forward for you to tweak it for your own use.  I have tried to add the basic sections that are present in most of the Resumes but you will most probably add more depending on your requirements. I am pretty sure it

Latex Tutorial: How to Create Images, Diagrams, and Flow Charts Using Latex

This tutorial is an extension of previous video tutorial on how to use tikz for image creation in Latex . In this video I explain how to set up your document for flow chat design. This equally applies to any other image that uses similar structure. Specifically, in this video I talk about following things: How to create a flow chart How to setup styles for reusable components of an image How to draw arrows from one component to other How to change the styles of components How to change the arrowhead for Latex arrows How to align components left, right, top, and below of each other The code use:d in the video is here: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,shadows,arrows} \begin{document} \tikzstyle{decision} = [diamond, draw, fill=blue!50] \tikzstyle{line} = [draw, -stealth, thick] \tikzstyle{elli}=[draw, ellipse, fill=red!50,minimum height=8mm, text width=5em, text centered] \tikzstyle{block} = [draw, rectangle, fill=blue!50, text width