[NTG-context] Question to covers

Wolfgang Schuster schuster.wolfgang at gmail.com
Sat Jul 21 17:39:26 CEST 2018


> Henning Hraban Ramm <mailto:texml at fiee.net>
> 20. Juli 2018 um 20:49
>
> Hi Tomáš,
>
> I don’t know of anything existing.
> Find attached what I use for a magazine – I include title and back 
> pages in the main PDF (to get a complete issue for corrections and 
> online distribution) and use that as externalfigure, just creating the 
> spine anew.
Hi Henning,

below is a modified version of your example where I changed a few things.

1. I used the "measure" commands to set the spine values, the advantage 
of the \measure is that it falls back to 0pt when you try to use a 
undefined value.

2. I determined the last page of the megazine with the 
\getfiguredimensions command, afterwards you can use the \noffigurepages 
command to get the last page of the document.

3. I put the layer and frame settings for the \setlayerframed command in 
separate arguments.

4. I got rid of the backgrounds setup for the layer. A better solution 
here is to create a page without margins which can be done with the 
"page" layout where you flush the collected content of the layer with 
the \flushlayer command.

5. I set the texts for the isse number and title with the \setvariables 
command.

Wolfgang

%%%%%%
\definemeasure [SpineWidth]  [6mm]
\definemeasure [SpineOffset] [\dimexpr(\measure{SpineWidth}-9pt)/5\relax]

\definepapersize
   [Cover]
   [width=\dimexpr420mm+\measure{SpineWidth}\relax,
    height=297mm]

\setuppapersize [Cover]

\setupexternalfigures [directory={_pdf}]

\useexternalfigure [MAG] [magazine.pdf]

\setvariables
   [cover]
   [issue={34},
    topic={Topic}]

\setuplayout
   [marking=on]

\definelayer
   [whole]
   [width=\paperwidth,
    height=\paperheight]

\starttext

\startlayout [page]

\setlayer
   [whole]
   [x=0mm,
    y=0mm]
   {\getfiguredimensions[MAG]
    \externalfigure[MAG][page=\noffigurepages]}

\setlayer
   [whole]
   [x=\dimexpr210mm+\measure{SpineWidth}\relax,
    y=0mm]
   {\externalfigure[MAG][page=1]}

\setlayerframed
   [whole]
   [x=210mm,
    y=20mm]
   [frame=off,
    offset=overlay,
    width=\measure{SpineWidth},
    align=center]
   {\getvariable{cover}{issue}}

\setlayerframed
   [whole]
   [x=210mm,
    y=92mm]
   [frame=off,
    offset=overlay,
    align=right,
    width=\measure{SpineWidth},
    height=190mm]
   {\rotate
      [rotation=90,
       align={right,middle},
       frame=off,
       height=\measure{SpineWidth},
       width=190mm]
      {\vskip\measure{SpineOffset}
       \vbox{MAGAZINE\hfill\getvariable{cover}{topic}}}}

\flushlayer [whole]

\stoplayout

\stoptext
%%%%%%
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20180721/4eded4de/attachment.html>


More information about the ntg-context mailing list