关于 ConTeXt 中样式的问题

关于 ConTeXt 中样式的问题

大家正在处理一份文档,我真的很想重新创建这个文档的页码和页脚样式文档 提前致谢。

答案1

正如评论所说,你可以简单地复制粘贴代码languages-mkiv.pdf

\defineoverlay
  [page]
  [\useMPgraphic{page}]

\setupbackgrounds
  [page]
  [background=page]

\setuppagenumbering
  [alternative=doublesided,
   location=]

\definecolor[maincolor][darkgray]

\startuseMPgraphic{page}

    StartPage ;

        linecap := butt ;

        if OnRightPage :

            path p ; p := (
                urcorner Page shifted (-2cm,0) --
                urcorner Page                  --
                urcorner Page shifted (0,-2cm) -- cycle
            ) shifted (-2.5mm,-2.5mm) ;

        else :

            path p ; p := (
                ulcorner Page shifted (2cm,0)  --
                ulcorner Page                  --
                ulcorner Page shifted (0,-2cm) -- cycle
            ) shifted (2.5mm,-2.5mm) ;

        fi ;

        fill p
            withpen pencircle scaled 1mm
            withcolor \MPcolor{maincolor} ;

        draw thetextext("\bf\userpagenumber",
            if OnRightPage : urcorner p shifted (-5mm,-5mm) else : ulcorner p shifted (5mm,-5mm) fi)
            withcolor white ;

        if OnRightPage :

            path p ; p := (
                lrcorner Page shifted (-5cm,0) --
                lrcorner Page
            ) shifted (-5mm,10mm)

        else :

            path p ; p := (
                llcorner Page shifted (5cm,0) --
                llcorner Page
            ) shifted (5mm,10mm) ;

        fi ;

        draw p
            withpen pencircle scaled 1mm
            withcolor \MPcolor{maincolor} ;

        draw if OnRightPage :
            thetextext.lft("\bf\getspecificstructuretitle{chapter}",lrcorner Page shifted (-5mm,5mm))
        else :
            thetextext.rt ("\bf\getspecificstructuretitle{chapter}",llcorner Page shifted ( 5mm,5mm))
     %  fi withcolor \MPcolor{\namedstructureuservariable{chapter}{color}} ;
        fi withcolor \MPcolor{maincolor} ;

    StopPage ;
\stopuseMPgraphic

\starttext

\startchapter[title=Example 1]
\stopchapter

\startchapter[title=Example 2]
\stopchapter

\startchapter[title=Example 3]
\stopchapter

\stoptext

在此处输入图片描述

相关内容