I am using this template (kik-android.cls, now whatsapp.cls):

Showcase of beautiful typography done in TeX & friends

as a guide to write a document using pdflatex mode. Since I am on pdflatex I deleted \usepackage{fontspec} and \setmainfont{DroidSans}.

Now I want to change the dimensions of the document since I have to print it on a A4 paper. So I change the line:




and a lot of errors appeared.

With errors

In chat some users kindly told me that a change from a small size to a large paper size may cause problems with tikzpicture.

This is whatsapp.cls:

% whatsapp.cls
%   taken from https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends/239511#239511
%   by Brian Jacobs (fixes by Maximilian Noethe).
%   April 10, 2018


% Start with article. Eventually this should be removed,
% because I'm not actually using it for much of anything

% Load all necessary packages

% Set up the page

% Style the page

% Color Definitions

% Customization Flags
\def\@partnerName{Sample Name}

% Macros to draw the background
    let \p1 = (current page.north east) in
      (\x1 - .42in - #1in, \y1 - 0.0415in - #1in) rectangle (\x1 - .43in -#1in, \y1 - 0.1409 in);

% Background Macro
  \begin{tikzpicture}[remember picture, overlay]
    % Background
    \fill[backgroundgray] (current page.north east) rectangle (current page.south west);

    (current page.south west) -- (current page.south east) --++(0,1in) -| (current page.south west) -- cycle;
    let \p1 = (current page.north east) in
    let \p2 = (current page.north west) in
    (\p1,\y1 - 0.1667in) rectangle (\x2,\y2 - .5289in);
    let \p1 = (current page.south east) in
    let \p2 = (current page.south west) in
    (\x1,\y1 + 0.3141in) rectangle (\x2,\y2 + .6090in);
    let \p1 = (current page.south east) in
    let \p2 = (current page.south west) in
    (\x1,\y1 + .6090in) -- (\x2,\y2 + .6090in);

    % Kik Top bar decorations

      % Name
      let \p1 = (current page.north west) in
        (\x1 + .4647in, \y1 - .3481in) node[anchor=west] {\@partnerName};

      % Arrow
      let \p1 = (current page.north west) in
        (\x1 + .1314in, \y1 - .3397in) -- (\x1 + .2179in , \y1 - .3397in);
      let \p1 = (current page.north west) in
        (\x1 + .1795in, \y1 - .2981in) -- (\x1 + .1314in, \y1 - .3397in) --
        (\x1 + .1795in, \y1 - .3846in);

    % Kik Bottom Bar Decorations

    % Android Bottom Bar Decorations
    % Home
    \draw[very thick,androidgray]
      let \p1 = (current page.south) in
        (\x1 - .1186in, \y1 + .08974in) -- (\x1 + .1186in, \y1 + .08974in) -- 
        (\x1 + .1186in, \y1 + .1795in)  -- (\x1, \y1 + .2115in) -- 
        (\x1 - .1186in, \y1 + .1795in) -- cycle;

    % Pages
    \draw[very thick,androidgray]
      let \p1 = (current page.south east) in
        (\x1 - .4391in, \y1 + .1058in) rectangle (\x1 - .6026in, \y1 + .1795in);
    \draw[very thick,androidgray]
      let \p1 = (current page.south east) in
        (\x1 - .3974in, \y1 + .1346in) -- (\x1 - .3974in, \y1 + .2219in) --
        (\x1 - .5545in, \y1 + .2219in);

    % Back arrow
    \draw[very thick,androidgray]
      let \p1 = (current page.south west) in
        (\x1 + .4199in, \y1 + 0.1635in) -- (\x1 + .5833in, \y1 + 0.1635in) to[bend left=90]
        (\x1 + .5833in, \y1 + .0993in) -- (\x1 + .5032in, \y1 + .0993in);
    \draw[very thick,androidgray]
      let \p1 = (current page.south west) in
        (\x1 + .4487in, \y1 + .1987in) -- (\x1 + .4199in, \y1 + .1635in) -- (\x1 + .4487in, \y1 + .1282in);


% Make the background appear on every page

% Commands for use by the user.




    \draw (0,0) node[anchor=north east,rectangle,rounded corners=2,fill=msggreen, scale=0.75,draw=circgray] {
        \raggedright #1\\
        \tiny \color{msggreen}.
    \fill[msggreen] (-0.01in,-0.06in) -- (0.06in,-0.12in) -- (-0.01in,-0.18in) -- cycle;
    \draw[circgray] (0,-0.06in) -- (0.06in,-0.12in) -- (0in,-0.18in);

    \draw (-.6,-.3) node[scale=1.825,circle, path picture={
        \node at (path picture bounding box.center){
    ] {};
    \else\fill[black] (-.6,-.3) circle (.12in);\fi
    \draw (0,0) node[anchor=north west,rectangle,rounded corners=2,fill=white, scale=0.75,draw=linegray] {
        \raggedright #1\\
        \tiny \color{white}.
    \fill[white] (0.01in,-0.06in) -- (-0.06in,-0.12in) -- (0.01in,-0.18in) -- cycle;
    \draw[linegray] (0,-0.06in) -- (-0.06in,-0.12in) -- (0in,-0.18in);

    \draw (0,0) node[scale=.65] {\color{kiktimepalegray}#1 \color{kiktimedarkgray}@ #2};

and this is Guia.tex:


\setPartnerName{Dave Johnson}

    \you{Knock knock}
    \me{Who's there?}
    \me{Canoe who?}
    \you{Canoe help me with my homework?}
    \time{Fri}{12:03 PM}
    \you{...please. I'm gonna fail calculus. :-(}

Without errors

Since the problem is the paper size, I realize that deleting lines 57-127 (the Background part) it compiles without errors:

Without errors

So the problem is around the Background section of the whatsapp class.

Can anyone help me discovering the error(s)?

EDIT Since some users compile Guia.tex using whatsapp.cls without errors I add the log file after one compilaton of Guia.tex: https://pastebin.com/H1Q5qMzi (sorry for the link but the log was too long.)

  • On my machine it compiles without errors. What do I need to change to reproduce the error? – user194703 Feb 22 at 23:42
  • @Schrödinger'scat thank you for your feedback! Did you use whatsapp.cls? I just copied it and it gives me errors. I will add the log file for clarification. – manooooh Feb 22 at 23:45
  • Yes, I copied the snippet in your code that starts with % whatsapp.cls and called it whatsapp.cls. Of course, I made sure that it gets loaded. I get zillions of warnings but no errors. I compile with pdflatex. – user194703 Feb 22 at 23:47
  • @Schrödinger'scat did you write whatsapp.cls on a editor and save it as .cls? And created a .tex and copied the Guia.tex on the same folder directory? I have no idea why you have no errors. Do you have uncommented [a4paper]{geometry} on line 23, and commented the line 22? – manooooh Feb 22 at 23:52
  • 1
    I was not trying to suggest that you hit return. Rather, I think you should try to write a cleaner class file, which uses tikzpagenodes. BTW, there is an error on the headlines of the exercise guide, "make" should probably read "bake". ;-) – user194703 Feb 23 at 1:33

Your Answer

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

Browse other questions tagged or ask your own question.