4

I would like help to use ConTexT’s \placefigure. ConTexT seems to ignore some location options. How can I get it to use the options? I’m using ConText LMTX, the current version.

I found this post from 10 years ago: How do I make text not overlap layers or otherwise define a first page with sidebar and image-based footer? . The location options in the first answer: [none, right, margin, top] seemed to work 10 years ago. They put the image on the right, in the margin and at the top.

I pasted that first answer from that post into this MWE:

\showframe
\setuplayout[backspace=20mm, width=100mm, topspace=20mm, header=0mm, footer=0mm, height=250mm, margindistance=10mm, rightmargin=50mm]

\starttext  
\input{knuth}

\placefigure[none, right, margin, top]{}{
\externalfigure[faims.jpg]
                 [width=50mm]
                 {
                 \color[faimsblue]{\setupwhitespace[small] http://www.fedarch.org}}
                 \framed[width=50mm, frame=off, align={stretch, verytolerant, hz, hanging}, ]{\tfxx\setupinterlinespace[line=3.78ex]\sc\color[faimsblue]{Contributors: Australian Heritage}}}    
\input{knuth}
\input{knuth}   

\stoptext 

But when I run it, it ignores the margin and top location options. See screenshot below. I tried it on the online ConTexT live and got the same result.

How can I get ConTexT to use the options margin and top? MWE example pdf

1 Answer 1

4

I prefer to use \start and \stop versions of the environments. Maybe the location=margin solves your problem? I also changed some other smaller things.

\showframe
\setuplayout[backspace=20mm, width=100mm, topspace=20mm, header=0mm, footer=0mm, height=250mm, margindistance=10mm, rightmargin=50mm]

\setupexternalfigures[location=default]

\setupwhitespace[medium]

\setupcaptions[
    style={\switchtobodyfont[small]},
]

\starttext  
\samplefile{ward}

\startbuffer
This is a caption to the top cow (the best?). Moo! I liek milk!
\stopbuffer

\startplacefigure[location={margin,nonumber},title={\getbuffer}]
\externalfigure[cow][width=50mm]
\stopplacefigure    

\samplefile{tufte}

\startbuffer
\blue \samplefile{ward}
\stopbuffer

\startplacefigure[location={margin,nonumber},title={\getbuffer}]
\externalfigure[cow][width=50mm]
\stopplacefigure    

\input{knuth}   
\stoptext 

figures in the margin

1
  • Thanks for that and for rewriting it, it helps me understand how to write ConTexT. When I add bottom to the location of the second cow it stays in the same place. I suspect that's just how it is.
    – Stanley
    Nov 30, 2022 at 20:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .