ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: How to use local layout parameters (instead of global ones)?
@ 2013-11-19 22:50 Géry Ogam
  0 siblings, 0 replies; 5+ messages in thread
From: Géry Ogam @ 2013-11-19 22:50 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 64 bytes --]

> then use
>
> \dimexpr\measure{w2}\relax

It works, thank you.

[-- Attachment #1.2: Type: text/html, Size: 364 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to use local layout parameters (instead of global ones)?
  2013-11-19 10:20 Géry Ogam
@ 2013-11-19 10:27 ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2013-11-19 10:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11/19/2013 11:20 AM, Géry Ogam wrote:
>  > \definemeasure[h1][1.2\measured{w1}+26mm]
>> \definemeasure[h2][1.2\measured{w2}+26mm]

then use

\dimexpr\measure{w2}\relax

> \measured gives me this error (/Undefined control sequence/):

old context

Hans

-----------------------------------------------------------------
                                           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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to use local layout parameters (instead of global ones)?
@ 2013-11-19 10:20 Géry Ogam
  2013-11-19 10:27 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Géry Ogam @ 2013-11-19 10:20 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1663 bytes --]

> \definemeasure[h1][1.2\measured{w1}+26mm]
> \definemeasure[h2][1.2\measured{w2}+26mm]

\measured gives me this error (*Undefined control sequence*):

*\17>>h1 ^^@-1.2\measured*
*                       {w1}+26mm*
*\measure ...sname \csname \??measure #1\endcsname*
*                                                  \else \zeropoint \fi*
*\page_layouts_synchronize ...tparameter \c!height*
*                                                  }\ifx
\p_page_layouts_heig...*
*<inserted text> ...yout \previouslayout \page_layouts_synchronize*
*                                                  \page_layouts_check_next
\...*
*\setup_layout ...out :}[#1]\the \everysetuplayout*
*                                                  \the \everyswitchlayout
\l...*
*\syst_helpers_double_empty_one_spaced ...1[{#2}][]*

I am using ConTeXt  ver: 2013.04.20. So I tried to use \dimexpr:

\definemeasure[h1][\the\dimexpr 1.2\measure{w1}+26mm\relax]
\definemeasure[h2][\the\dimexpr 1.2\measure{w2}+26mm\relax]

but it gives me this error (there is a problem with the decimal point in
1.2 because there is no error when I put an integer instead):

*\17>>w1 .-0.*
*            7500\paperwidth*
*\measure ...sname \csname \??measure #1\endcsname*
*                                                  \else \zeropoint \fi*
*\17>>h1 r-\the \dimexpr 1.2\measure {w1}*
*                                         + 26mm \relax*
*\measure ...sname \csname \??measure #1\endcsname*
*                                                  \else \zeropoint \fi*
*\page_layouts_synchronize ...tparameter \c!height*
*                                                  }\ifx
\p_page_layouts_heig...*

[-- Attachment #1.2: Type: text/html, Size: 2941 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to use local layout parameters (instead of global ones)?
  2013-11-18 22:29 Géry Ogam
@ 2013-11-19  0:30 ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2013-11-19  0:30 UTC (permalink / raw)
  To: ntg-context

On 11/18/2013 11:29 PM, Géry Ogam wrote:
> Hello,
>
>
> Here is my problem:
>
>
> \setuplayout[%
>      width=0.75\paperwidth,
>      height=\dimexpr\paperheight-1.2\paperwidth+1.2\textwidth+26mm]
>
> \definelayout[luxury][%
>      width=0.6667\paperwidth,
>      height=\dimexpr\paperheight-1.2\paperwidth+1.2\textwidth+26mm]
>
>
> \starttext
>
> - textwidth: \the\textwidth \crlf
> - textheight: \the\textheight
> \page
>
> \setuplayout[luxury]
>
> - textwidth: \the\textwidth \crlf
> - textheight: \the\textheight % <-- The height (\texteight parameter)
> which depends on the width (\textwidth parameter) in my ‘luxury’ layout
> has NOT changed though the local width (\textwidth parameter) has
> changed. Therefore height used the global parameter \textwidth (defined
> in setuplayout) instead of the local parameter \textwidth (defined in
> definelayout[luxury]). Question: how to use the local one?
>
> \stoptext

best do that indirect:

\definemeasure[w1][0.7500\paperwidth]
\definemeasure[w2][0.6667\paperwidth]
\definemeasure[h1][1.2\measured{w1}+26mm]
\definemeasure[h2][1.2\measured{w2}+26mm]

\setuplayout
   [width=\measure{w1},
    height=\measure{h1}]

\definelayout
   [luxury]
   [width=\measure{w2},
    height=\measure{h2}]


-- 

-----------------------------------------------------------------
                                           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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* How to use local layout parameters (instead of global ones)?
@ 2013-11-18 22:29 Géry Ogam
  2013-11-19  0:30 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Géry Ogam @ 2013-11-18 22:29 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 877 bytes --]

Hello,


Here is my problem:


\setuplayout[%
    width=0.75\paperwidth,
    height=\dimexpr\paperheight-1.2\paperwidth+1.2\textwidth+26mm]

\definelayout[luxury][%
    width=0.6667\paperwidth,
    height=\dimexpr\paperheight-1.2\paperwidth+1.2\textwidth+26mm]


\starttext

- textwidth: \the\textwidth \crlf
- textheight: \the\textheight
\page

\setuplayout[luxury]

- textwidth: \the\textwidth \crlf
- textheight: \the\textheight % <-- The height (\texteight parameter) which
depends on the width (\textwidth parameter) in my ‘luxury’ layout has NOT
changed though the local width (\textwidth parameter) has changed.
Therefore height used the global parameter \textwidth (defined in
setuplayout) instead of the local parameter \textwidth (defined in
definelayout[luxury]). Question: how to use the local one?

\stoptext


Best regards.

[-- Attachment #1.2: Type: text/html, Size: 1236 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-11-19 22:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-19 22:50 How to use local layout parameters (instead of global ones)? Géry Ogam
  -- strict thread matches above, loose matches on Subject: below --
2013-11-19 10:20 Géry Ogam
2013-11-19 10:27 ` Hans Hagen
2013-11-18 22:29 Géry Ogam
2013-11-19  0:30 ` Hans Hagen

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).