ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] about : setuplayout[width=fit or height=fit]
@ 2025-01-10  8:28 wangzhongtian
  2025-01-10 23:31 ` [NTG-context] " Hans Hagen via ntg-context
  0 siblings, 1 reply; 2+ messages in thread
From: wangzhongtian @ 2025-01-10  8:28 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/html, Size: 5787 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: about : setuplayout[width=fit or height=fit]
  2025-01-10  8:28 [NTG-context] about : setuplayout[width=fit or height=fit] wangzhongtian
@ 2025-01-10 23:31 ` Hans Hagen via ntg-context
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen via ntg-context @ 2025-01-10 23:31 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

On 1/10/2025 9:28 AM, wangzhongtian wrote:
> hi,hans ,
> 
> Maybe I find some bug in file page-lay.mkxl, in 
> \def\page_layouts_synchronize.
> 
> 1. Here is the source code snippet from the above code file. I think it 
> is reasonable if change the last line of code to:
> 
> \global\advanceby\makeupheight\dimexpr-\topdistance-\topheight- 
> \scratchdimen\relax
> 
> \orelse\ifx\p_page_layouts_height\v!fit
> \ifzeropt\bottomspace
> \global\bottomspace\topspace
> \fi
> \global\makeupheight\dimexpr\paperheight-\bottomspace\relax
> \scratchdimen\dimexpr\topspace-\topheight-\topdistance\relax
> \ifdim\scratchdimen<\zeropoint
> \scratchdimen\zeropoint
> \fi
> \global\advanceby\makeupheight\dimexpr-\bottomdistance-\bottomheight- 
> \scratchdimen\relax

you mean

\global\advanceby\makeupheight
   \dimexpr-\bottomdistance-\bottomheight-\scratchdimen\relax

becomes

\global\advanceby\makeupheight
   \dimexpr-\topdistance-\topheight-\scratchdimen\relax

but the top values are actually in scratchdimen so

\global\advanceby\makeupheight
   \dimexpr-\topdistance-\topheight-\topspace-\topheight-\topdistance\relax

or

\global\advanceby\makeupheight
   \dimexpr-2\topdistance-2\topheight-\topspace\relax

which is wrong, so the question is: what is the issue you try to fix

> 2. Here is the source code snippet from above code file. I think it is 
> reasonable if change the last line of code to:
> 
> \global\advanceby\makeupwidth\dimexpr
> -\leftmargindistance-\leftmarginwidth
> -\leftedgedistance -\leftedgewidth
> -\scratchdimen\relax
> 
> \orelse\ifx\p_page_layouts_width\v!fit
> \ifzeropt\cutspace
> \global\cutspace\backspace
> \fi
> \global\makeupwidth\dimexpr\paperwidth-\cutspace\relax
> \scratchdimen\dimexpr\backspace
> -\leftedgewidth-\leftedgedistance
> -\leftmarginwidth-\leftmargindistance\relax
> \ifdim\scratchdimen<\zeropoint
> \scratchdimen\zeropoint
> \fi
> 
> \global\advanceby\makeupwidth\dimexpr
> 
> -\rightmargindistance-\rightmarginwidth
> 
> -\rightedgedistance-\rightedgewidth
> -\scratchdimen\relax
> 
> 
> ----------------------------
> 
> zhongtian wang
> 
> Shijiazhuang YouWen Information Technology Co.,Ltd,China
> 
> 13311202589 wangzht@189.cn
> <mailto:wangzhongtian@189.cn>
> 
> 
> 
> 
> 
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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 / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2025-01-10 23:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-10  8:28 [NTG-context] about : setuplayout[width=fit or height=fit] wangzhongtian
2025-01-10 23:31 ` [NTG-context] " Hans Hagen via ntg-context

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