[NTG-context] Bleeding pictures as floats?

Henning Hraban Ramm texml at fiee.net
Wed May 6 07:06:09 CEST 2015


Am 2015-05-05 um 02:59 schrieb Wolfgang Schuster <schuster.wolfgang at gmail.com>:

>> \def\bleed{3mm}
>> \def\maxWidth{\dimexpr(\paperwidth+\bleed)}
> 
> Use \definemeasure and \measure to set your own dimensions.
> It is also bad style to redefine the \bleed command.

Ok, forgot about that.

> Can you make a working minimal example.


\definepapersize[a6][width=105mm,height=148mm]
\definepapersize[a6o][width=115mm,height=158mm]
\setuppapersize[a6][a6o]
\setuplayout[
	location=middle,marking=on,
	grid=yes,
	backspace=12.5mm, width=80mm,
	topspace=12.5mm,
	header=0mm,footer=10mm,
]

\definemeasure[Bleed][3mm]
\definemeasure[maxWidth][\dimexpr \paperwidth + \measure{Bleed}\relax]
\definemeasure[maxHeight][\dimexpr \paperheight + 2\measure{Bleed}\relax]
\definemeasure[topOffset][\dimexpr \topspace + \measure{Bleed}\relax]

\setupexternalfigures[
	maxwidth=\measure{maxWidth},
	maxheight=\measure{maxHeight}
]
\setupcaptions[style=\ss\tfx,align=flushleft,number=no,width=\textwidth]

\definefloat[bleedfigure][figure]
\setupfloat[bleedfigure][
	outermargindistance=-2\measure{Bleed},
	%leftmargindistance=-2\measure{Bleed},
	%rightmargindistance=-2\measure{Bleed},
	maxwidth=\measure{maxWidth}
]

\def\topfig#1#2{%
	\placebleedfigure[top]{#1}{%
		\offset[topoffset=-\measure{topOffset}]%
		{\externalfigure[#2][width=\measure{maxWidth}]}%
	}%
}

\starttext

\chapter{Test}

\topfig{Caption}{koe}
\input tufte

\topfig{Caption}{koe}

\input knuth
\topfig{Caption}{koe}

\showlayout

\stoptext

————
So, one of my mistakes was, I had set \setupexternalfigures[maxwidth=\paperwidth], that overrides all other float definitions.

With this (perhaps not minimal) example I get nearly what I want, but the image starts with the paper and is centered (x/y -1,5mm/0mm) where I want it to start on -3mm/-3mm on a left page, 0mm/-3mm on a right page. I thought my definitions should do that...


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)



More information about the ntg-context mailing list