ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] placement of float captions in margin
@ 2024-08-01 14:49 Henning Hraban Ramm
  0 siblings, 0 replies; only message in thread
From: Henning Hraban Ramm @ 2024-08-01 14:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi, I think this related to Gerion’s problem, but I don’t want to occupy 
the thread.

I’m trying to get captions in the (inner) margin.

With the setup below it works for left (even) pages; on right pages, the 
caption is placed beside the image, but over the text and not in the 
margin. (Yes, the big distance of image and caption is suboptimal, but 
leftfloats are worse, and the layout in question doesn’t have much space 
in the outer margin.)

If I uncomment %command to use \margincaption, and comment location 
instead, the caption is correctly inside the inner margin, but the width 
is always that of the left margin, i.e. too small on left pages.
I didn’t find a combination of options that completely works.

Hraban


\showframe
\usemodule[visual]
\useMPlibrary[dum]

\setuplayout[
   backspace=40mm,
   rightmargin=20mm,
   leftmargin=30mm,
   width=fit,
   height=fit,
]
\setuppagenumbering[alternative=doublesided]

\definemargindata[margincaption][inner][
   margin=margin,
   %width=\innermarginwidth,
   align=flushleft,
   stack=yes,
   voffset=-.5em,
]
\setupmarginframed[inmargin][
   align={flushleft,low},
]

\definefloat[rightfigure][figure]
\setupfloat[rightfigure][
   default=right,
   width=.33\textwidth,
]

\setupcaption[rightfigure][
   align={flushleft},
   width=\innermarginwidth,
   location=innermargin, % comment this
%command={\margincaption[inner]}, % uncomment this
   frame=on,
   framecolor=red,
   style={\ss\tfx},
]

\starttext

\dorecurse{20}{

\section{\fakewords{1}{5}}

\fakewords{10}{100}

\startplacerightfigure[title={\fakewords{2}{10}}]
\externalfigure[dummy][width=.33\textwidth,lines=5]
\stopplacerightfigure

\fakewords{10}{100}

}

\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-01 14:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-01 14:49 [NTG-context] placement of float captions in margin Henning Hraban Ramm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).