ConTeXt 中的标准构成层

ConTeXt 中的标准构成层

需要将 PDF 文件作为水印放置在标题页和分页后面。这些已使用 进行布局\standardmakeup。已创建图层,可以将其放置在普通文本页面上,但无法弄清楚如何强制它在 上工作\standardmakeup。我一直在使用 TeXLive 2012 中的 MkIV。

以下是我迄今为止尝试过的最简单的例子

\startenvironment[Test]

% -- Title page setups
\definelayer[jikishin][position=no,repeat=no,width=\paperwidth,height=\paperheight]
\setlayerframed[jikishin][x=0cm,y=3cm]{\externalfigure[images/Jikishin.pdf][size=artbox]}   

\definemakeup[title][doublesided=no,page=right,headerstade=empty,footerstate=empty]


\setuppapersize             [A5][A5]

\setuppagenumbering
 [alternative=doublesided]

\stopenvironment



\startfrontmatter  % --- here not sure how to get the layer activated
    \startmakeup[title]
        \title{Jikishin Ju Jitsu}
    \stopmakeup
\stopfrontmatter

\startbodymatter
    \chapter{Body of document}
    \input knuth
\stopbodymatter

答案1

在 ConTeXt 中设置页面背景的标准方法是使用

\setupbackgrounds[page][background=....]

为了确保背景仅限于titlemakeup页面,请使用以下before\definemakeup

\definemakeup[title][...., before={\setupbackgrounds[page][background=...]}, ...]

这是一个完整的示例(我用作cow.pdf示例图像)

\definelayer
    [jikishin]
    [
      position=no,
      repeat=no,
      width=\paperwidth,
      height=\paperheight,
    ]

\setlayerframed
      [jikishin]
      [x=0cm,y=3cm]
      {\externalfigure[cow]}   

\definemakeup
    [title]
    [
      doublesided=no,
      page=right,
      headerstate=empty,
      footerstate=empty,
      before=\setups{title:setups},
    ]

\startsetups title:setups
    \setupbackgrounds[page][background=jikishin]
\stopsetups


\setuppapersize
    [A5][A5]

\setuppagenumbering
    [alternative=doublesided]


\starttext
\startfrontmatter  % --- here not sure how to get the layer activated
    \starttitlemakeup
        \title{Jikishin Ju Jitsu}
    \stoptitlemakeup
\stopfrontmatter

\startbodymatter
    \chapter{Body of document}
    \input knuth
\stopbodymatter
\stoptext

相关内容