ConTeXt:左下层预设帮助

ConTeXt:左下层预设帮助

我有一个覆盖左边距和文本区域的图层。leftbottom 预设将内容放置在页面上过高的位置。它的高度是图层中 y 值的两倍(在 \definelayer 中,y=20 毫米;内容的高度为 40 毫米)。

左下预设

\showframe

\definepapersize[mypage][height=260mm, width=185mm]
\setuppapersize[mypage] 

\setuplayout
    [backspace=58mm, width=106mm, header=0mm, footer=5mm,  leftmargindistance=5mm, leftmargin=32mm, topspace=20mm, height=220mm, footerdistance=5mm,]

\definelayer % layer covers margin & text area
    [mylayer]
    [x=21mm, width=143mm, 
    y=20mm, height=210mm]

\setlayer
    [mylayer]
    [preset=lefttop]
    {LEFTTOP}

\setlayer
    [mylayer]
    [preset=leftbottom]
    {LEFTBOTTOM}

\setupbackgrounds
    [page]
    [background=mylayer]

\starttext
\input lorem
\stoptext

答案1

也许是这样的?

\showframe

\definepapersize[mypage][height=260mm, width=185mm]
\setuppapersize[mypage]

\setuplayout
     [backspace=58mm,
      width=106mm,
      header=0mm,
      footer=5mm,
      leftmargindistance=5mm,
      leftmargin=32mm,
      topspace=20mm,
      height=220mm,
      footerdistance=5mm]

\definelayer
     [mylayer]
     [width=\dimexpr\leftmarginwidth+\textwidth\relax,
      height=\textheight]

\setlayer
     [mylayer]
     [preset=lefttop]
     {LEFTTOP}

\setlayer
     [mylayer]
     [preset=leftbottom]
     {LEFTBOTTOM}

\setupbackgrounds
     [text] [leftmargin]
     [background=mylayer]

\starttext
     \input lorem
\stoptext

图层

答案2

您最初的说法在我看来基本正确,所以我不太确定 40 毫米的差异是从哪里来的。

但这似乎有效:

\showframe

\definepapersize[mypage][height=260mm, width=185mm]
\setuppapersize[mypage]

\setuplayout
    [backspace=58mm, width=106mm, header=0mm, footer=5mm,  leftmargindistance=5mm, leftmargin=32mm, topspace=20mm, height=220mm, footerdistance=5mm, rightmargin=15mm]

\definelayer % layer covers margin & text area
    [mylayer][
        x=\dimexpr\backspace-\leftmarginwidth-\leftmargindistance,
        width=\dimexpr\paperwidth+\rightmargindistance+\rightmarginwidth,
        y=\dimexpr\topspace-\headerheight-\headerdistance,
        height=\dimexpr\paperheight-\footerdistance-\footerheight,
    ]

\setlayer
    [mylayer]
    [preset=lefttop]
    {LEFTTOP}

\setlayer
    [mylayer]
    [preset=leftbottom]
    {LEFTBOTTOM}

\setlayer
    [mylayer]
    [preset=righttop]
    {RIGHTTOP}

\setlayer
    [mylayer]
    [preset=rightbottom]
    {RIGHTBOTTOM}

\setupbackgrounds
    [page]
    [background=mylayer]

\starttext
\input lorem
\stoptext

样本

(附言:你的\textheight可能应该是你的整数倍,\baselineskip以确保填满整个页面)

相关内容