From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Feature request: setuppapersize
Date: Mon, 10 Jan 2011 14:29:03 +0100 [thread overview]
Message-ID: <4D2B099F.5050106@wxs.nl> (raw)
In-Reply-To: <alpine.LNX.2.01.1101081830401.30494@ybpnyubfg.ybpnyqbznva>
On 9-1-2011 12:45, Aditya Mahajan wrote:
> Hans,
>
> Since we have some leverage with backward compatibility in MkIV, can we
> make \setuppapersize (slightly) more intuitive.
>
> Normally, one would expect
>
> \setuppapersize[A5]
>
> to be equivalent to
>
> \setuppapersize[A5][A5]
>
> but currently it is equivalent to
>
> \setuppapersize[A5][A4]
>
> This is a bit confusing, and means that we always have to specify the
> printpaper size; even if it is equal to paper size. Can we modify the
> definition of \dodefinepapersize to change this behavior?
>
> \def\dodefinepapersize[#1][#2][#3]%
> {\ifsecondargument
> \doifsomething{#1} % to be sure
> {\doifassignmentelse{#2}
> {\getparameters
> [\??pp#1] % geen \c!scale, scheelt hash ruimte
> [\c!width=\@@ppwidth,\c!height=\@@ppheight,\c!offset=\@@ppoffset,#2]%
> %AM: Added these two lines
> \setvalue{\??pp:1:#1}{#1}%
> \setvalue{\??pp:2:#1}{#1}}%
> {\setvalue{\??pp:1:#1}{#2}%
> \setvalue{\??pp:2:#1}{#3}}}% (*) see below
> \else
> \getparameters[\??pp][#1]%
> \setuppapersize % hm. this will freeze !
> \fi}
>
> Perhaps, in line (*), we should also check if #3 is something, otherwise
> set ??p:2:#1 to #2:
>
> \doifsomethingelse{#3}
> {\setvalue\??pp:2:#1}{#3}}
> {\setvalue\??pp:2:#1}{#2}}
>
>
> What do you think?
more elegant and downward compatible is this:
\definepapersize
[samesized]
[ \c!width=\paperwidth,
\c!height=\paperheight]
\setuppapersize
[A4][samesized]
in page-lay.mkiv
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2011-01-10 13:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-08 23:45 Aditya Mahajan
2011-01-10 13:29 ` Hans Hagen [this message]
2011-01-10 14:04 ` Peter Münster
2011-01-10 14:26 ` Hans Hagen
2011-01-10 15:20 ` Peter Münster
2011-01-10 15:51 ` Hans Hagen
2011-01-10 16:07 ` Peter Münster
2011-01-10 18:02 ` Aditya Mahajan
2011-03-19 17:59 ` Aditya Mahajan
2011-03-20 21:49 ` C.
2011-03-20 23:43 ` Aditya Mahajan
2011-03-21 11:47 ` C.
2011-03-21 16:08 ` Wolfgang Schuster
2011-03-21 16:46 ` Aditya Mahajan
2011-03-22 13:28 ` Hans Hagen
2011-03-22 15:59 ` Aditya Mahajan
2011-03-22 16:10 ` Cecil Westerhof
2011-05-22 18:33 ` Aditya Mahajan
2011-03-21 7:26 ` Otared Kavian
2011-01-22 16:34 ` Aditya Mahajan
2011-01-23 19:16 ` Hans Hagen
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=4D2B099F.5050106@wxs.nl \
--to=pragma@wxs.nl \
--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).