summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/pack-mis.mkvi
diff options
context:
space:
mode:
authorMojca Miklavec <mojca.miklavec@gmail.com>2012-05-14 17:38:55 +0000
committerMojca Miklavec <mojca.miklavec@gmail.com>2012-05-14 17:38:55 +0000
commit15995e10bfc68edf79970c4ea4fbb6678566c46e (patch)
tree2de7ca2a83f2d37ef043ad7429a5cb945bb79ddb /Master/texmf-dist/tex/context/base/pack-mis.mkvi
parentc9a39f716f1e5ec820ed3aab2c9aef25c5a9d730 (diff)
ConTeXt 2012.05.14 16:00
git-svn-id: svn://tug.org/texlive/trunk@26371 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/pack-mis.mkvi')
-rw-r--r--Master/texmf-dist/tex/context/base/pack-mis.mkvi71
1 files changed, 49 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/context/base/pack-mis.mkvi b/Master/texmf-dist/tex/context/base/pack-mis.mkvi
index ab6d2b3343d..978cc120c96 100644
--- a/Master/texmf-dist/tex/context/base/pack-mis.mkvi
+++ b/Master/texmf-dist/tex/context/base/pack-mis.mkvi
@@ -5,7 +5,7 @@
%D subtitle=Miscelaneous,
%D author=Hans Hagen,
%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
@@ -22,7 +22,9 @@
% \placement [name][settings]
% \place<name> [settings]
-\installcommandhandler \??pl {placement} \??pl
+\installcorenamespace{placement}
+
+\installcommandhandler \??placement {placement} \??placement
\appendtoks
\setuevalue{\e!place\currentplacement}{\pack_placement{\currentplacement}}%
@@ -44,13 +46,14 @@
\unexpanded\def\pack_placement#tag%
{\bgroup
\edef\currentplacement{#tag}%
- \dosingleempty\pack_placement_indeed}
+ \doifnextoptionalelse\pack_placement_yes\pack_placement_nop}
-\def\pack_placement_indeed[#settings]% set test can be sped up but non critical
- {\iffirstargument
- \setupcurrentplacement[#settings]%
- \fi
- \dowithnextboxcontent{\forgetall}{\pack_placement_flush\egroup}\vbox}
+\def\pack_placement_yes[#settings]%
+ {\setupcurrentplacement[#settings]%
+ \pack_placement_nop}
+
+\def\pack_placement_nop
+ {\dowithnextboxcontentcs\forgetall\pack_placement_flush\vbox}
\def\pack_placement_flush
{\setlocalhsize
@@ -61,24 +64,48 @@
{\placementparameter\c!left
\flushnextbox
\placementparameter\c!right}%
- \ifinsidefloat \else
- \addlocalbackgroundtobox\nextbox
- \fi
+ %\ifinsidefloat \else
+ % \page_backgrounds_add_local_to_box\nextbox
+ %\fi
\ifgridsnapping
- \doifinset{\placementparameter\c!margin}{\v!standard,\v!yes}\noindent % unchecked
- \doifelsenothing{\placementparameter\c!grid}
- {\snaptogrid[\v!middle]}
- {\snaptogrid[\placementparameter\c!grid]}%
- \hbox{\flushnextbox}%
+ \pack_placement_flush_grid_yes
\else
- \doif{\placementparameter\c!linecorrection}\v!on \startbaselinecorrection
- \doifinset{\placementparameter\c!margin}{\v!standard,\v!yes}\noindent
- \flushnextbox
- \doif{\placementparameter\c!depthcorrection}\v!on\baselinecorrection
- \doif{\placementparameter\c!linecorrection }\v!on\stopbaselinecorrection
+ \pack_placement_flush_grid_nop
\fi
\endgroup
- \placementparameter\c!after}
+ \placementparameter\c!after
+ \egroup}
+
+\def\pack_placement_flush_grid_yes
+ {\edef\p_grid{\placementparameter\c!grid}%
+ \ifx\p_grid\empty
+ \let\p_grid\v!middle
+ \fi
+ \pack_placement_flush_grid_noindent
+ \snaptogrid[\p_grid]\hbox{\box\nextbox}}
+
+\def\pack_placement_flush_grid_nop
+ {\edef\p_linecorrection {\placementparameter\c!linecorrection}%
+ \edef\p_depthcorrection{\placementparameter\c!depthcorrection}%
+ \ifx\p_linecorrection\v!on
+ \startbaselinecorrection
+ \fi
+ \pack_placement_flush_grid_noindent
+ \box\nextbox
+ \ifx\p_depthcorrection\v!on
+ \baselinecorrection
+ \fi
+ \ifx\p_linecorrection\v!on
+ \stopbaselinecorrection
+ \fi}
+
+\def\pack_placement_flush_grid_noindent
+ {\edef\p_margin{\placementparameter\c!margin}%
+ \ifx\p_margin\v!standard
+ \noindent
+ \else\ifx\p_margin\v!yes
+ \noindent
+ \fi\fi}
\protect \endinput