ConTeXt:如何将我的奶牛垂直排列在边缘?

ConTeXt:如何将我的奶牛垂直排列在边缘?

在我的 MWE 中,我把 2 头牛放在边缘。

顶部奶牛:我明白了为什么奶牛会突出于边距。我可以将奶牛向下移动(同时仍使用\inmargin),以便奶牛的顶部位于边距的顶部吗?

底部的牛:我使用了带框的文本location=hanging,将框架和牛向下移动。但我认为它向下移动了太多。我可以让框架的顶部与“dobesideimage 之后的文本”行的顶部齐平吗? 在此处输入图片描述

\showframe
\setupexternalfigures[location=default] % get the cow
%\setuppapersize[A4][A3,landscape] \setuparranging[2SIDE]

\setuplayout[backspace=80mm, width=100mm, topspace=50mm, header=0mm, footer=0mm, height=200mm, margindistance=10mm, leftmargin=40mm]

\definemargindata[mymarginnote][left]
    [margin=margin,width=\leftmarginwidth,style={\ss},align=high, ]

\define[3]\dobesideimage% in left margin: image with optional text  below 
    {\mymarginnote
        {\framedtext [width=\leftmarginwidth, offset=0mm,location=hanging,]
            {#1\\ \externalfigure[#2][width=\leftmarginwidth]\\#3}
        }   
    } 

\starttext 

\inmargin{\externalfigure[cow][width=\leftmarginwidth]\\I didn’t need a clock, but it was there, and l could, so l did. }

\dorecurse{1}{\input{tufte} }

Text before dobesideimage.

\dobesideimage {Text before cow.}{cow}{So, l recently bought a small clock. I didn’t need a clock, but it was there, and l could, so l did. }

Text after dobesideimage.

\dorecurse{1}{\input{tufte} }

\stoptext

答案1

我认为最好尽可能多地使用内置机制,因为它们可以提供帮助。我不明白你到底想要什么,但我下面建议的也许可以作为一个开始?观察high图形位置的关键。另外,请注意\movesidefloat用于将第二幅图像向下推一点的。

\showframe
\setupexternalfigures[location=default] % get the cow

\setuplayout[backspace=80mm, width=100mm, topspace=50mm, header=0mm, footer=0mm, height=200mm, margindistance=10mm, leftmargin=40mm]

\starttext 

\startplacefigure
  [location={inleft,high,nonumber},
   title={I didn’t need a clock, but it was there, and l could, so l did.}]
  \externalfigure[cow][width=\leftmarginwidth]
\stopplacefigure
\dorecurse{1}{\samplefile{tufte} }

Text before dobesideimage.

\setupmargindata
  [inleftmargin]
  [style=sans,
   align=flushleft]

\inleftmargin{Text before cow}

\setupcaptions
  [style=sans]

\setupcaption
  [inleft]
  [width=\leftmarginwidth,
   align=flushleft]

\movesidefloat[2*line]
\startplacefigure
  [location={inleft,high,nonumber},
   title={So, l recently bought a small clock. I didn’t need a clock, but it was there, and l could, so l did.}]
   \externalfigure[cow][width=\leftmarginwidth]
\stopplacefigure

Text after dobesideimage.

\dorecurse{1}{\samplefile{tufte} }

\stoptext

边缘的牛

相关内容