ConteXt 中标题页布局的提示

ConteXt 中标题页布局的提示

在阅读了 ConteXt 开发人员提供的大量手册、文档和 wiki 文章后,我仍然不知道如何实现这一点。我想设置一份新闻稿标题页。顶部包含一个图形作为标题。接下来是左侧的框架框,该框旁边是一篇两栏文章。框架框下方是一张小图片,两栏文章是空白。

[ Title Graphic ]
[Framed][ 2-col ]
[ Box  ][ umn a ]
[      ][ rticle]
        [       ]
[Pic]

使用 LaTeX 时,我会使用两个小页面作为框架和文章,然后放置图片,\hfill\vfill进行一些调整。

感谢您的帮助。

答案1

当然,但使用 ConTeXt 也可以实现同样的效果。事实上,第一个例子只是我犯过的错误总结,后来我才意识到,aTABLE可以用来实现你想要的效果。

\def\framedbox#1#2
{\hbox to 2em\bgroup
\setupframed[height=10cm,width=3cm,framed=off]
\framed[width=2cm,align=left]{#1}
\egroup} 

\setupcolumns[n=2,]
\starttext
\title{\hfil A test}
\framedbox{}
\vskip -4in 
\hskip 2.5cm{\lbox to 2.5cm{
        \bTABLE
        \setupTABLE[,2,3][frame=off, distance=4pt,align=vfil]
\bTR \bTD \input zapf \eTD \eTR 
    \bTD \input zapf \par \input linden \eTD \eTR 
    \bTD \input tufte \eTD \eTR
\eTABLE
}} 
\stoptext

这是几乎完整的示例。请根据需要更改一些值。

\setuplayout[width=130mm,]

\def\framedbox#1#2
{\hbox to 1em\bgroup
\setupframed[height=10cm,width=4cm,framed=off]
\framed[width=4cm,align=left]{#1}
\egroup}

\setuppagenumbering[state=stop]
\setupcolumns[n=2,]
\starttext
\title{\hfil \externalfigure[http://tug.org/images/logobw.jpg][width=6cm]}
\framedbox{}
\vskip -4in 
\hskip 4.5cm{\rbox to 0.5cm{
        \bTABLE
        \setupTABLE[1,2][frame=off, distance=4pt,align=vfil]
\bTR \bTD \input zapf \eTD \eTR 
    \bTD \input tufte \eTD \eTR
\eTABLE


\externalfigure[context_logo.jpg]
}} 
\stoptext

在此处输入图片描述

第二次编辑

我原本想分别使用TABLEheadTABLEfoot。但实际上并非如此,因为前者可以消除在文档前面指定所述页脚设置的需要。

\showframe
\starttext 

\setuplayout[footer=\textwidth]
\setuphead[chapter][header=none]
\setupfooter[chapter][]
\setupfootertexts[][{\dorecurse{8}{\framed{\externalfigure[context_logo.jpg]}}}]
\title{\dorecurse{1}{\externalfigure[mill.png][width=\textwidth,height=7cm]}}
{\lbox to 0.5cm{
        \bTABLE
        \setupTABLE[2,3][frame=off, distance=4pt,align=vfil,option=stretch] 
        \bTR \bTD \dorecurse{8}{\externalfigure[context_logo.jpg]\par} \eTD \eTR
        \bTD \dorecurse{1}{\input zapf }\eTD \eTR 
    \bTD \dorecurse{1}{\input linden }\eTD \eTR
\eTABLE
}


\framed{\dorecurse{8}{\externalfigure[context_logo.jpg]\par}
}

\input cervantes-es

\externalfigure[mill.png]
\stoptext

在此处输入图片描述 在此处输入图片描述

答案2

如果你愿意单独标记标题页,这里有一个可能的方法。我更改了第一页的页边距,并将框架和图片设置为图层。

% To visualize the page areas
% Needs to be placed on the top, because it resets the page backgrounds
\showframe

% Layout for regular pages
\setuplayout
  [
    topspace=1cm,
    backspace=1.5cm, 
    leftmargin=1cm,
    width=middle,
    height=middle,
    bottomspace=1cm,
    header=2\lineheight,
    headerdistance=2\lineheight,
    footer=2\lineheight,
  ]

\definemeasure[marginspace][0.4\paperwidth]
\definemeasure[marginwidth][0.35\paperwidth]

% Different layout for the title page:
\definelayout
  [1]
  [
    topspace=6\lineheight,
    header=\zeropoint,
    backspace=\measure{marginspace},
    leftmargin=\measure{marginwidth},
    cutspace=1.5cm,
    rightmargin=1cm,
  ]


\definelayer[titlelayer]
\definelayer[marginlayer]
\definelayer[footerlayer]

\setupbackgrounds[text][leftmargin][background=marginlayer]
\setupbackgrounds[footer][leftmargin][background=footerlayer]
\setupbackgrounds[text][background=titlelayer]


% Dummy text and figures
\usemodule[visual]
\useMPlibrary[dum]


% To make it easier to show the output on TeX.SX
\setuppapersize[A4][A3,landscape]
\setuparranging[2SIDE]


\starttext

\setlayer[marginlayer]
    {\externalfigure[marginimage]
                    [width=\measure{marginwidth}, height=12\lineheight]}

\setlayer[footerlayer]
    {\externalfigure[footerimage]
                    [width=\measure{marginwidth}, height=2\lineheight]}

\setlayer[titlelayer]
         [
           x=-\dimexpr(\measure{marginwidth}+\leftmargindistance)\relax,
           y=-4\lineheight,
         ] 
    {\externalfigure[titleimage]
                    [
                      width=\dimexpr(\measure{marginwidth}+\leftmargindistance+\textwidth)\relax, 
                      height=3\lineheight,
                    ]}

\startsimplecolumns
  \dorecurse{3}{\fakewords{120}{120}\par}
\stopsimplecolumns

\page

\dorecurse{5}{\fakewords{120}{120}\par}

\stoptext

两页的跨页效果如下。

在此处输入图片描述

相关内容