The cake is a lie

It all started a few days ago, when we had a question on TeX.sx about using TeX for (nearly) any kind of document. In one of the answers, our friend Andrew Stacey mentioned that he even does his kids birthday invitations in TeX; in the comments, Stefan Kottwitz asked for seeing this TikZ birthday cake, so Andrew updated his answer with a picture of the cake:

Yummy! An epic TikZ cake.

We all got very excited by this elegant cake, so our friend N.N. posted a follow-up question on how can I draw a cake using TikZ; Andrew then posted his code, to the joy of the community!

We all love cake.

I know only a few things about TikZ, as I only use the

automata

library. But  I was tempted to draw another cake. And if you play games like I do, by the title of this blog post, you already know what kind of cake I’m talking about.

“The cake is a lie” is a statement written on the walls of some test chambers in the game Portal. Basically, you need to solve all the puzzles; if you complete all the test chambers, the computer intelligence GLaDOS will give you cake. Spoiler alert: no, she won’t; you’ll be killed.

I decided to draw the Portal cake. Since I had no TikZ skills, I decided to draw it using Inkscape:

Then I exported this drawing using the Inkscape2TikZ extension. The generated TikZ code is a little verbose and probably full of redundant entries. I changed some lines and colors to make it look more acceptable.

Here’s my final

cake.tex

code:
\documentclass{article}

\usepackage{tikz}

\usepackage{xparse}

\usepackage{siunitx}
\DeclareSIUnit {\oz}{oz}

\usepackage{draftwatermark}
\SetWatermarkScale{1.5}
\SetWatermarkText{THE CAKE IS NOT A LIE!}

\DeclareDocumentCommand{\mycake}{ O{1}}{\scalebox{#1}{%
\begin{tikzpicture}[y=0.80pt, x=0.8pt,yscale=-1, inner sep=0pt, outer sep=0pt]
  \path[draw=black,line join=miter,line cap=butt,miter limit=4.00,line
    width=8.000pt] (87.9883,389.9973) — (54.7259,395.4121) .. controls
    (37.8407,422.4174) and (182.2527,459.2492) .. (215.6229,445.6923) —
    (492.5362,319.6348) — (252.7351,362.4298);
  \path[draw=black,line join=miter,line cap=butt,miter limit=4.00,line
    width=8.000pt] (53.3147,399.6636) — (55.1924,650.6812) .. controls
    (80.3308,699.1142) and (177.5217,709.4526) .. (223.8248,700.1879) —
    (499.2060,567.1386);
  \path[draw=black,fill=black,line join=miter,line cap=butt,miter limit=4.00,line
    width=8.000pt] (498.6461,567.7180) — (498.6461,506.5124) —
    (219.9421,640.6284) — (219.8750,698.3790) — cycle;
  \path[draw=black,fill=black,line join=miter,line cap=butt,miter limit=4.00,line
    width=8.000pt] (500.4491,483.7110) — (500.4491,422.5054) —
    (219.8574,560.0192) — (220.6523,619.6350) — cycle;
  \path[draw=black,fill=black,line join=miter,line cap=butt,miter limit=4.00,line
    width=8.000pt] (500.9710,398.7070) — (500.9710,337.5015) —
    (220.3793,475.0152) — (221.1742,534.6311) — cycle;
  \path[fill=black] (211.5534,391.9849) .. controls (190.4624,412.5142) and
    (156.7224,412.0589) .. (136.1931,390.9679) .. controls (115.6637,369.8768) and
    (116.1191,336.1368) .. (137.2101,315.6075) .. controls (151.3880,301.8072) and
    (171.2816,297.4896) .. (189.0359,302.5485) .. controls (193.5020,303.8210) and
    (172.2187,341.9516) .. (176.2890,344.4091) .. controls (180.1085,346.7152) and
    (209.3129,313.2778) .. (212.5705,316.6245) .. controls (233.0998,337.7155) and
    (232.6445,371.4555) .. (211.5534,391.9849) — cycle;
  \path[draw=none,fill=black,line join=miter,line cap=butt,line width=0.800pt]
    (186.3371,329.5296) — (219.6599,279.7564) — (159.3415,251.0736) —
    (168.1994,231.2487) — (231.0486,278.0692) — cycle;
  \path[draw=none,fill=black,line join=miter,line cap=butt,line width=0.800pt]
    (116.4176,330.7600) .. controls (103.7818,336.7533) and (91.3865,343.2273) ..
    (83.5287,358.7765) .. controls (84.8484,378.3386) and (96.6285,390.4290) ..
    (109.1089,402.0192) .. controls (96.0130,372.2019) and (99.2822,356.9008) ..
    (116.4176,330.7600) — cycle;
  \path[draw=none,fill=black,line join=miter,line cap=butt,line width=0.800pt]
    (117.7380,392.8639) .. controls (120.0294,406.6600) and (122.8492,420.3569) ..
    (135.6415,432.1839) .. controls (154.8135,436.2890) and (169.6750,428.2836) ..
    (184.2478,419.4673) .. controls (151.9800,423.8681) and (138.1657,416.5213) ..
    (117.7380,392.8639) — cycle;
  \path[draw=none,fill=black,line join=miter,line cap=butt,line width=0.800pt]
    (239.3887,351.3370) .. controls (247.4428,362.7699) and (255.0512,374.5032) ..
    (254.2453,391.9064) .. controls (243.4749,408.2899) and (227.2716,413.0231) ..
    (210.7046,416.9762) .. controls (236.7722,397.4556) and (241.4514,382.5252) ..
    (239.3887,351.3370) — cycle;
\end{tikzpicture}
}}

\begin{document}

\begin{center}
\scshape\huge Aperture Science\\\ Enrichment Center
\end{center}

\vspace{2em}

\begin{center}
\mycake[.3]
\end{center}

\vspace{2em}

\section*{Cake recipe}

One \SI{18.25}{\oz} package chocolate cake mix. One can prepared coconut pecan frosting.
Three slash four cup vegetable oil. Four large eggs. One cup semi-sweet chocolate chips.
Three slash four cups butter or margarine. One and two third cups granulated sugar. Two
cups all purpose flour. Don’t forget garnishes such as: Fish shaped crackers. Fish shaped
candies. Fish shaped solid waste. Fish shaped dirt. Fish shaped ethyl benzene. Pull and
peel licorice. Fish shaped organic compounds and sediment shaped sediment. Candy coated
peanut butter pieces. Shaped like fish. One cup lemon juice. Alpha resins. Unsaturated
polyester resin. Fiberglass surface resins. And volative malted milk impoundments. Nine
large egg yolks. Twelve medium geosynthetic membranes. One cup granulated sugar. An entry
called ‘how to kill someone with your bare hands.’ Two cups rhubarb, sliced. Two slash three
cups granulated rhubarb. One tablespoon all-purpose rhubarb. One teaspoon grated orange
rhubarb. Three tablespoons rhubarb, on fire. One large rhubarb. One cross borehole
electro-magnetic imaging rhubarb. Two tablespoons rhubarb juice. Adjustable aluminum head
positioner. Slaughter electric needle injector. Cordless electric needle injector. Injector
needle driver. Injector needle gun. Cranial caps. And it contains proven preservatives, deep
penetration agents, and gas and odor control chemicals. That will deodorize and preserve
putrid tissue.

\begin{flushright}
\textbf{— GLaDOS}
\end{flushright}

\end{document}
Now, let’s see how it looks:

I’m making a note here: “huge success!”

:)

6 thoughts

  1. Who is the creator of the TexCube picture? I’m thinking about printing it on a T-Shirt (just for me, not as a sale idea), and wanted to know if this would be acceptable (so to speak what licence is associated to it). It would be even nicer if a vector Cersion of it existed 😉

    Anyway, great post!

    1. I got a picture of a normal Companion Cube and gimp’ed a TeX logo in it.

      :)

      I’m not sure about the legal part related to the usual Portal stuff, but feel free to use my image, I’d love to see this cube on a T-shirt.

      :)

      Would you like a

      svg

      version of it? I think I can draw it for you.

      :)

      Edit: I drew a

      svg

      version here, hope you like it.

      :)

    2. Wow, very nice, thanks a lot! I would like to print it on a black T-shirt, so would it be possible that you drew me the same thing in white (and possibly with a red heart)? Thanks for your Effort

Leave a Reply

Your email address will not be published. Required fields are marked *