From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Question to covers
Date: Sat, 21 Jul 2018 17:39:26 +0200 [thread overview]
Message-ID: <5B5353AE.8000705@gmail.com> (raw)
In-Reply-To: <B8E11373-58E0-429A-A517-8F20484195E1@fiee.net>
[-- Attachment #1.1: Type: text/plain, Size: 2564 bytes --]
> Henning Hraban Ramm <mailto:texml@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
%%%%%%
[-- Attachment #1.2: Type: text/html, Size: 3888 bytes --]
[-- Attachment #2: Type: text/plain, Size: 492 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2018-07-21 15:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-20 15:16 Tomas Hala
2018-07-20 18:49 ` Henning Hraban Ramm
2018-07-21 15:39 ` Wolfgang Schuster [this message]
2018-07-21 17:12 ` Henning Hraban Ramm
2018-07-21 20:06 ` Hans Hagen
[not found] <20180728081230.GA31599@akela.mendelu.cz>
2018-07-28 9:15 ` Henning Hraban Ramm
2018-07-28 10:01 ` Henning Hraban Ramm
2018-07-28 10:30 ` Wolfgang Schuster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5B5353AE.8000705@gmail.com \
--to=schuster.wolfgang@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).