summaryrefslogtreecommitdiff
path: root/tex/context/base/typo-mar.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/typo-mar.mkiv')
-rw-r--r--tex/context/base/typo-mar.mkiv58
1 files changed, 31 insertions, 27 deletions
diff --git a/tex/context/base/typo-mar.mkiv b/tex/context/base/typo-mar.mkiv
index 30aea9f61..c9218ace2 100644
--- a/tex/context/base/typo-mar.mkiv
+++ b/tex/context/base/typo-mar.mkiv
@@ -177,11 +177,15 @@
\fi
\doifelsenothing{#content}\donefalse\donetrue
\ifdone
+ \edef\currentmarginreference{\margindataparameter\c!reference}%
+ \ifx\currentmarginreference\empty \else
+ \set_page_only_destination_box_attribute\currentmarginreference\currentmarginreference
+ \fi
\edef\currentmargindatastrut{\margindataparameter\c!strut}%
\the\everymargindatacontent
\dostarttagged\t!margintext\currentmargindata
\ifcsname\currentmarginframedhash\s!parent\endcsname
- \setbox\nextbox\hbox\bgroup
+ \setbox\nextbox\hbox \currentmarginreference \bgroup
\the\everymargindatacontent
\dosetmargindataattributes\c!style\c!color
\setupcurrentmarginframed[\c!location=\v!normal,#textparameters]%
@@ -196,7 +200,7 @@
\else
\edef\currentmargindatawidth{\margindataparameter\c!width}%
\ifx\currentmargindatawidth\empty
- \setbox\nextbox\hbox\bgroup
+ \setbox\nextbox\hbox \currentmarginreference \bgroup
\the\everymargindatacontent
\dosetmargindataattributes\c!style\c!color
\ifx\currentmargindatastrut\empty \else
@@ -207,7 +211,7 @@
\let\currentmarginfirstheight\empty
\else
\dosetraggedcommand{\margindataparameter\c!align}%
- \setbox\nextbox\hbox\bgroup
+ \setbox\nextbox\hbox \currentmarginreference \bgroup
\vtop \bgroup
\the\everymargindatacontent
\dosetmargindataattributes\c!style\c!color
@@ -225,38 +229,38 @@
\dostoptagged
\fi
\ifdone
- \initializenextposition % we use positions at the lua end
+ \initializenextposition % we use positions at the lua end (will become pdf.h/v)
\ctxlua{typesetters.margins.save{
- \c!location = "\margindataparameter\c!location",
- \c!method = "\margindataparameter\c!method",
- \c!category = "\margindataparameter\c!category",
- \c!name = "\margindataparameter\c!name",
- \c!margin = "\margindataparameter\c!margin", % local normal margin edge
- \c!distance = \number\dimexpr\margindataparameter\c!distance,
- \c!hoffset = \number\dimexpr\margindataparameter\c!hoffset,
- \c!voffset = \number\dimexpr\margindataparameter\c!voffset,
- \c!dy = \number\dimexpr\margindataparameter\c!dy,
- \c!bottomspace = \number\dimexpr\margindataparameter\c!bottomspace,
+ location = "\margindataparameter\c!location",
+ method = "\margindataparameter\c!method",
+ category = "\margindataparameter\c!category",
+ name = "\margindataparameter\c!name",
+ margin = "\margindataparameter\c!margin", % local normal margin edge
+ distance = \number\dimexpr\margindataparameter\c!distance,
+ hoffset = \number\dimexpr\margindataparameter\c!hoffset,
+ voffset = \number\dimexpr\margindataparameter\c!voffset,
+ dy = \number\dimexpr\margindataparameter\c!dy,
+ bottomspace = \number\dimexpr\margindataparameter\c!bottomspace,
\ifx\currentmarginfirstheight\empty \else
- baseline = \currentmarginfirstheight,
+ baseline = \currentmarginfirstheight,
\fi
- threshold = \number\dimexpr\margindataparameter\c!threshold, % overlap related, will change
+ threshold = \number\dimexpr\margindataparameter\c!threshold, % overlap related, will change
\ifhmode
- inline = true,
+ inline = true,
\fi
- \c!scope = "\margindataparameter\c!scope",
- \c!align = "\margindataparameter\c!align",
- \c!line = "\margindataparameter\c!line",
- \c!stack = "\margindataparameter\c!stack",
- \c!number = \number\nextbox,
+ scope = "\margindataparameter\c!scope",
+ align = "\margindataparameter\c!align",
+ line = "\margindataparameter\c!line",
+ stack = "\margindataparameter\c!stack",
+ number = \number\nextbox,
}}%
\else
\ctxlua{typesetters.margins.save{
- \c!location = "\margindataparameter\c!location",
- \c!method = "\margindataparameter\c!method",
- \c!category = "\margindataparameter\c!category",
- \c!name = "\margindataparameter\c!name",
- \c!scope = "\margindataparameter\c!scope",
+ location = "\margindataparameter\c!location",
+ method = "\margindataparameter\c!method",
+ category = "\margindataparameter\c!category",
+ name = "\margindataparameter\c!name",
+ scope = "\margindataparameter\c!scope",
}}%
\fi
\endgroup}