44

We have questions about Christmas trees and Hearts for Valentines but we have no questions that specialize in Halloween or Dia de los Muertos art. Here it goes:

Using TikZ or PSTricks or any other of your favorite LaTeX tools, create pumpkins, ghouls, etc., appropriate to the season.

I think multiple submissions should be fine provided different objects are created.

  • 3
    Boys and girls of every age, wouldn't you like to see something strange? :) – Paulo Cereda Nov 1 '14 at 11:28
  • We have chickenize. The time is ripe for a pumpkinification package. – Thérèse Nov 1 '15 at 0:41
82

Here's some diabolical TikZ code:

\documentclass[tikz,border=0]{standalone}
\usetikzlibrary{backgrounds}
\begin{document}
\tikz[background rectangle/.style={fill=black},show background rectangle]\foreach\c[count=\i from0]in{red!10!black,red!15!black,red!20!black,red!25!black,red!30!black,red!35!black,red!40!black,red!45!black,red!50!black,red!55!black,red!60!black,red!65!black,red!75!black,red!75!black!75!orange,red!75!black!50!orange,red!75!black!25!orange,red!75!black!5!orange,orange,orange!75!yellow,orange!50!yellow,orange!25!yellow,yellow,yellow!75,yellow!50,white}\clip[preaction={fill=\c},xscale=1-\i/100,yshift=(\i>0)*1.5](-6,-7)(6,3)\foreach\x in{1,-1}{[xscale=\x](0:1)to[bend right]++(315:2)to[bend right]++(60:4)to[bend right,looseness=0.5]cycle}[shift=(270:\i/15),yscale=1-\i/50](0:5)arc(360:330:5 and 3)\foreach\i in{330,300,270,240}{arc(\i:\i-10:5 and 3)--(\i-15:5 and 5)--(\i-20:5 and 3)arc(\i-20:\i-30:5 and 3)}arc(210:180:5 and 3)arc(180:195:5 and 6)\foreach\i in{195,225,255,285,315}{arc(\i:\i+10:5 and 6)--(\i+15:5 and 4)--(\i+20:5 and 6)arc(\i+20:\i+30:5 and 6)}arc(345:360:5 and 6)--cycle;
\end{document}

enter image description here

And this may take until next Halloween to compile:

\documentclass[tikz,border=0]{standalone}
\usetikzlibrary{decorations,backgrounds}
\tikzset{pics/flame/.style 2 args={code={
  \fill [fill=#1, yscale=1-#2/4, xscale=1-#2/5, rotate=rand*5]
    (0:.5+rnd) coordinate (a) arc (360:180:1 and 1) 
    .. controls ++(90:rnd)            and ++(270:rnd) .. (90+rand*5:2+rnd*2)
    .. controls ++(270+rand*5:.5+rnd) and ++(90+rand*5:.5+rnd) .. (a) 
    \pgfextra{\pgfgetpath\flame\global\let\flame=\flame};
  \foreach \l in {1,...,20}
    \draw [draw=#1, line width=\l/2, draw opacity=1/10] \pgfextra{\pgfsetpath\flame};
}}}
\pgfdeclaredecoration{flames}{burn}{
  \state{burn}[width=\pgfdecorationsegmentlength]{
     \pic {flame={flame}{\pgfdecorationsegmentamplitude}};
   }
}
\colorlet{flame}{red}
\begin{document}
\foreach \i in {1,...,5}{
\begin{tikzpicture}[background rectangle/.style={fill=black}, show background rectangle, line join=round]
\useasboundingbox (-20,-20) rectangle (20,20); 
\foreach \c [count=\x from 0] in {red!50!black, red!75!black, orange, yellow}{
  \colorlet{flame}{\c}
  \draw [decoration={flames, segment length=1.5cm-\x*0.125cm, amplitude=\x}, decorate] 
    circle [radius=15]
    (270:15) -- (54:15) -- (198:15) -- (342:15) -- (126:15) -- cycle;
}
\end{tikzpicture}
}
\end{document}

enter image description here

  • 1
  • The “depth” in the lower part of the mouth (in the center) has changed (to the worse, in my opinion). Is this intended? Or does the pumpkin need a new dental care plan? – Manuel Nov 1 '14 at 13:34
  • 1
    @Manuel you're right. In part that resulted from treating the mouth and eyes as one path (before they were independent), making adjustments trickier. I've "kind-of" sorted it now. – Mark Wibrow Nov 1 '14 at 14:53
30

tikz?, pstricks? everyone knows the underworld used picture mode.

enter image description here

\documentclass{article}
\usepackage{color}
\usepackage{pict2e}
\pagecolor[RGB]{255,177,69}
\begin{document}

\begin{picture}(120,200)
\thicklines
\put(100,100){\circle{150}}

\put(70,130){\line(1,-1){10}}
\put(70,130){\line(-1,-1){10}}
\put(60,120){\line(1,0){20}}

\put(130,130){\line(1,-1){10}}
\put(130,130){\line(-1,-1){10}}
\put(120,120){\line(1,0){20}}

\put(100,90){\line(1,-1){10}}
\put(100,90){\line(-1,-1){10}}
\put(90,80){\line(1,0){20}}

\put(70,50){\line(1,0){60}}
\put(70,50){\line(-2,1){5}}
\put(130,50){\line(2,1){5}}
\end{picture}

\end{document}
  • Any method is fine by me. – A.Ellett Oct 31 '14 at 20:00
  • The underworld and the aviation industry? – Chris Chudzicki Oct 31 '14 at 20:36
  • Er, this seems more like a smiley than anything Hallow-y to me... Maybe if you used an eclipse instead of a circle? – thkala Nov 1 '14 at 11:04
  • @thkala beware that smile, danger lurks... – David Carlisle Nov 1 '14 at 11:07
  • 1
29
\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}\def\onehalf{
\fill(0.25,0) to [bend right] ++(180:1) to [bend right] ++(330:1.5) to[bend right, looseness=0.5] cycle;
\draw [decoration={expanding waves,angle=4,segment length=0.5pt},decorate] (-1cm,0.7cm) to[out=0,in=140] (0.7cm,-0.2cm);
\fill (1.05cm,-1.1cm) to[out=270,in=180] ++(2mm,-0.4cm) to[out=0,in=0,looseness=0.5] cycle;
\fill[preaction={draw,decorate},decoration={ticks}] (-0.3,-1.5) to[out=-30,in=180] (1,-2) to[bend left] (1,-3) to[bend left] cycle;}
\onehalf\begin{scope}[cm={-1,0,0,1,(2,0)}]\onehalf\end{scope}
\end{tikzpicture}
\end{document}

enter image description here

15

A truly demonic entity would manually write its own postscript code.

%!PS-Adobe-2.0 EPSF-2.0
%%Title: pumpkin.eps
%%BoundingBox: 0 0 200 200
/tri {newpath 0 0 moveto 10 0 lineto 0 20 lineto -10 0 lineto closepath fill} bind def
1.0 0.6 0.25 setrgbcolor
1 setlinewidth
100 100 100 0 360 arc gsave stroke grestore fill
0 0 0 setrgbcolor
100 90 60 190 350 arc stroke
100 100 translate tri
-50 40 translate tri
100 0 translate tri
showpage
%EOF

pumpkin

  • and thkla said mine looked like a smiley! – David Carlisle Nov 1 '14 at 11:08
  • A bit too round and too happy for me. Maybe an eclipse instead of a circle, and a flat black rectangle for the mouth? – thkala Nov 1 '14 at 11:11
  • @DavidCarlisle: Don't worry, this does too :-) – thkala Nov 1 '14 at 11:12
  • Goota love this pumpkin. :) Can't wait for a poker face version. :) – Paulo Cereda Nov 1 '14 at 11:27
15

all hallows eve

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{calc,backgrounds}
\usepackage{hieroglf}
\newcommand*{\llygaddienyddiwr}{\textpmhg{\He}}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
% adapted (simplified version) from tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex
\makeatletter
\tikzset{%
  on foreground layer/.style={%
                execute at begin scope={%
                  \pgfonlayer{foreground}%
                  \let\tikz@options=\pgfutil@empty%
                  \tikzset{every on foreground layer/.try,#1}%
                  \tikz@options%
                },
                execute at end scope={\endpgfonlayer}
  },
}
\makeatother
\tikzset{%
  pics/yr Angau/.style n args={2}{
        code={
          \path  (-#2/4,-.55*#2)
                |- (-.15*#2,-.15*#2) coordinate (angau7)
                [out=-20, in=110] to (-.025*#2,-.25*#2) coordinate (angau8)
                [out=85, in=-85] to (0,-.1*#2) coordinate (angau9)
                [out=135, in=-100] to (-.125*#2,-.015*#2) coordinate (angau3)
                -| (-#2/4,#2/2) -| (.375*#2,-.55*#2) -- cycle;
          \path [line cap=round, line width=.025*#2]
                  (0,-.5125*#2) coordinate (angau5) -- ++(-#2/6,.95*#2) coordinate [pos=.875] (angau4) coordinate [pos=.95] (angau1);
          \path [draw=#1, fill=#1, line width=.005*#2, line join=miter]% llafn
                (angau1) [out=30, in=150] to ($(angau5) + (.375*#2,#2)$) [out=-30, in=135] to ++(.125*#2,-.1*#2) [out=135, in=30] to (angau4);
                \path [angau clogyn={#1}{#2}]% corff & pen
                (-.2*#2,-#2/2)
                  [out=85, in=-110] to (angau7)
                  [out=160, in=-45] to (-.2*#2,-.115*#2)
                  [out=135, in=-135] to (-.2*#2,.075*#2)
                  [out=45, in=-135] to (-.05*#2,.125*#2)
                  [out=80, in=-80] to (-.075*#2,.2*#2)
                  [out=100, in=-150] to (.025*#2,.35*#2) coordinate (pen angau)
                  [out=-35, in=80] to (.125*#2,.2*#2)
                  [out=-100, in=170] to (.15*#2,.1*#2)
                  [out=-10, in=120] to (.3*#2,-#2/2)
                  [out=170, in=-10] to cycle;
          \path [angau inner={#1}{#2}]% gwyneb
                (.025*#2,.325*#2) coordinate (pen angau1)
                  [out=-40, in=60] to (.025*#2,.125*#2) coordinate (angau6)
                  [out=120, in=-145] to cycle;
          \begin{scope}% carn (neu 'dwrn'?)
                \clip  (-#2/4,-.55*#2)
                  |- (angau7)
                  [out=-20, in=110] to(angau8)
                  [out=85, in=-85] to (angau9)
                  [out=135, in=-100] to (angau3)
                  -| (-#2/4,#2/2) -| (.375*#2,-.55*#2) -- cycle;
                \path [draw=#1, line cap=round, line width=.025*#2]
                  (angau5) -- (angau1);
          \end{scope}
          \path [angau outer={#2}{#1}]% llewysau (llinellau)
                (angau6)
                  [out=-100, in=85] to (.025*#2,-#2/2)
                (angau7)
                  [out=-20, in=110] to (angau8)
                  [out=85, in=-85] to (angau9)
                  [out=135, in=-100] to (angau3)
                (.15*#2,-.02*#2)
                  [out=-60, in=30] to (.125*#2,-.175*#2) coordinate (angau10)
                  [out=-10, in=135] to (.275*#2,-.475*#2) coordinate (angau2);
          \path [angau inner={#1}{#2}]% llawes chwith
                (angau8) [out=85, in=-85] to (angau9) [out=-85, in=-85] to cycle;
          \path [angau inner={#1}{#2}]% llawes dde
                (angau10) [out=-10, in=135] to (angau2) [out=135, in=-20] to ($(angau10) + (-.005*#2,-.015*#2)$) [out=160, in=170] to cycle;
        }
  },
  pics/dienyddiwr/.style n args={2}{
        code={
          \begin{scope}[on foreground layer]% carn (neu 'dwrn'?)
                \path (-#2/4,-.55*#2)
                  |- (-.15*#2,-.15*#2) coordinate (dienyddiwr7)
                  [out=-20, in=110] to (-.025*#2,-.25*#2) coordinate (dienyddiwr8)
                  [out=85, in=-85] to (0,-.1*#2) coordinate (dienyddiwr9)
                  [out=135, in=-100] to (-.125*#2,-.015*#2) coordinate (dienyddiwr3)
                  -| (-#2/4,#2/2) -| (.375*#2,-.55*#2) -- cycle;
                \begin{scope}
                  \clip  (-#2/4,-.55*#2)
                        |- (dienyddiwr7)
                        [out=-20, in=110] to (dienyddiwr8)
                        [out=-85, in=-85] to (dienyddiwr9)
                        [out=135, in=-100] to (-.125*#2,-.015*#2) coordinate (dienyddiwr3)
                        -| (-#2/4,#2/2) -| (.375*#2,-.55*#2) -- cycle;
                  \path [draw=#1, line cap=round, line width=.025*#2]
                  (-.05*#2,-.25*#2) coordinate (dienyddiwr5) -- ++(#2/4,.45*#2) coordinate [pos=.875] (dienyddiwr4) coordinate [pos=.95] (dienyddiwr1);
                \end{scope}
          \end{scope}
          \path [draw=#1, fill=#1, line width=.005*#2, line join=miter]% llafn
                (dienyddiwr1)
                  [out=-35, in=-115] to ++(.2*#2,-.025*#2)
                  [out=-90, in=35] to ($(dienyddiwr4) + (.125*#2,-.175*#2)$)
                  [out=65, in=-35] to (dienyddiwr4);
          \path [angau clogyn={#1}{#2}]% corff & pen
          (-.2*#2,-#2/2)
                [out=85, in=-110] to (dienyddiwr7)
                [out=160, in=-45] to (-.2*#2,-.115*#2)
                [out=135, in=-135] to (-.2*#2,.075*#2)
                [out=45, in=-135] to (-.05*#2,.125*#2)
                [out=80, in=-80] to (-.075*#2,.2*#2)
                [out=100, in=-150] to (.025*#2,.35*#2) coordinate (pen dienyddiwr)
                [out=-35, in=80] to (.125*#2,.2*#2)
                [out=-100, in=170] to (.15*#2,.1*#2)
                [out=-10, in=120] to (.3*#2,-#2/2)
                [out=170, in=-10] to cycle;
          \path [angau inner={#1}{#2}]% gwyneb
                (.025*#2,.325*#2) coordinate (pen dienyddiwr1)
                  [out=-40, in=60] to (.025*#2,.125*#2) coordinate (dienyddiwr6)
                  [out=120, in=-145] to cycle;
          \begin{scope}[on foreground layer]
                \path [angau outer={#2}{#1}]% llewysau (llinellau)
                  (dienyddiwr7)
                        [out=-20, in=110] to (dienyddiwr8)
                        [out=85, in=-85] to (dienyddiwr9)
                        [out=135, in=-100] to (dienyddiwr3)
                  (.15*#2,-.02*#2)
                        [out=-60, in=30] to (.125*#2,-.175*#2) coordinate (dienyddiwr10)
                        [out=-10, in=135] to (.275*#2,-.475*#2) coordinate (dienyddiwr2);
                \path [angau inner={#1}{#2}]% llawes chwith
                  (dienyddiwr8) [out=85, in=-85] to (dienyddiwr9) [out=-85, in=-85] to cycle;
                \path [angau inner={#1}{#2}]% llawes dde
                  (dienyddiwr10) [out=-10, in=135] to (dienyddiwr2) [out=135, in=-20] to ($(dienyddiwr10) + (-.005*#2,-.015*#2)$) [out=160, in=170] to cycle;
          \end{scope}
          \path [angau outer={#2}{#1}]% clogyn (llinell canolog)
                (dienyddiwr6)
                  [out=-100, in=85] to (.025*#2,-#2/2);
          \begin{scope}% llygaid
                  \clip (pen dienyddiwr1) [out=-40, in=60] to (dienyddiwr6) [out=120, in=-145] to cycle;
                  \path [fill=#1!25!darkgray, draw=#1!25!darkgray, line width=.005*#2]
                        ($(dienyddiwr6)!2/3!(pen dienyddiwr1) - (.03*#2,0)$) coordinate (llygad dienyddiwr chwith) +(.005*#2,0) coordinate (llygad dienyddiwr chwith1) circle (.013*#2 and .003*#2)
                        ($(dienyddiwr6)!2/3!(pen dienyddiwr1) + (.03*#2,0)$) coordinate (llygad dienyddiwr de) +(-.006*#2,0) coordinate (llygad dienyddiwr de1) circle (.013*#2 and .003*#2);
                  \path [fill=#1, draw=#1, line width=.005*#2]
                        (llygad dienyddiwr chwith1) +(.003*#2,0) circle (.003*#2)
                        (llygad dienyddiwr de1) +(-.003*#2,0) circle (.003*#2);
                  \node [#1, font=\tiny, xscale=-.0075*#2, yscale=.0075*#2, inner sep=0pt, outer sep=0pt, anchor=center] at (llygad dienyddiwr chwith) {\llygaddienyddiwr};
                  \node [#1, font=\tiny, scale=.0075*#2, inner sep=0pt, outer sep=0pt, anchor=center] at (llygad dienyddiwr de) {\llygaddienyddiwr};
          \end{scope}
        }
  },
  angau outer/.style n args={2}{draw=#2, line join=miter, line width=.005*#1},
  angau clogyn/.style n args={2}{angau outer={#2}{#1}, inner color=#1, outer color=black},
  angau inner/.style n args={2}{angau clogyn={#1!25!black}{#2}},
}
\begin{document}
\begin{tikzpicture}[background rectangle/.style={top color=black!35!red, bottom color=black!85!red}, show background rectangle]
  \pic {yr Angau={darkgray}{50pt}};
  \pic at (1,0) {dienyddiwr={red}{50pt}};
\end{tikzpicture}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.