%%
%% Copyright (c) 2022-2023 by Friedemann Bartels
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version.  The latest version of this license is in:
%%
%%    http://www.latex-project.org/lppl.txt
%%
%% and version 1.3c or later is part of all distributions of
%% LaTeX version 2008/05/04 or later.
%%

\documentclass[draft,graphpaper,preflight,optimize={density=600}]{pagelayout}
\usepackage{microtype}
\usepackage{fontspec}

\setmainfont{Menlo}

\pagewidth=5.5cm
\pageheight=4cm
\margin=5mm
\gutter=5mm
\bleed=2mm

\begin{document}
  \fontsize{6.3pt}{8.6pt}\selectfont

  % generic template
  \template{ss}{
    \text{
      This text fills the first placeholder.
    }
  }

  % custom template
  \grid
  \newtemplate{my template}{
    \setgrid{
      {[2]{3!}{2!}}
    }
    \placeholder{0 0 1 1}
  }
  \template{my template}{}
  \nogrid

  % graphics
  \newborder{my border}{width=2mm, color=white, radius=5mm}
  \newshadow{my shadow}{size=8}
  \template[margin=7mm]{s}{
    \graphic[
      scale=1.05,
      hpos=0,
      vpos=0,
      shadow=my shadow,
      border=my border,
      border radius=0mm
    ]{kopi}
  }

\end{document}
