summaryrefslogtreecommitdiff
path: root/tex/context/base/core-mak.tex
blob: 761f83156c711605bb8160cb20affe0975f1331e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
%D \module
%D   [       file=core-mak,
%D        version=1997.10.05,
%D          title=\CONTEXT\ Core Macros,
%D       subtitle=General Makeup Commands,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{Context Core Macros / General Makeup Commands}

\unprotect

% \definieerplaats[naam][instellingen]
% \stelplaatsin[naam][instellingen]
% \plaats<naam>[[instellingen]]
%
% - still undocumented and also not in setupb yet
% - kan ook intern/direct (scheelt duplicatie), zie \framedtext

\def\dodefineplacement[#1][#2]%
  {\getparameters
     [\??pl#1]
     [\c!left=\hss,
      \c!right=\hss,
      \c!linecorrection=\v!off,
      \c!depthcorrection=\v!off,
      \c!margin=\v!standard,
      \c!grid=\v!middle,
      %\c!before=,
      %\c!after=,
      #2]%
   \setvalue{\e!place#1}{\doplacement[\??pl#1]}}

\def\defineplacement
  {\dodoubleempty\dodefineplacement}

\def\setupplacement
  {\dodoubleempty\dosetupplacement}

\def\dosetupplacement[#1]%
  {\dodoubleempty\getparameters[\??pl#1]}

\def\doplacement
  {\dodoubleempty\dodoplacement}

\def\dodoplacement[#1][#2]% correctie moet mooier
  {\bgroup
   \dowithnextboxcontent
     {\forgetall}
     {\setlocalhsize
      \getparameters[#1][#2]%
      \getvalue{#1\c!before}%
      \begingroup
      \positioningparfalse
      \setbox\nextbox\hbox to \localhsize
        {\getvalue{#1\c!left}%
         \flushnextbox
         \getvalue{#1\c!right}}%
      \ifinsidefloat \else
        \addlocalbackgroundtobox\nextbox
      \fi
      \ifgridsnapping
        \doifundefined{#1\c!grid}{\letvalue{#1\c!grid}\v!middle}%
        % unchecked
        \doifinset{\getvalue{#1\c!margin}}{\v!standard,\v!yes}\noindent
        \snaptogrid[\getvalue{#1\c!grid}]\hbox{\flushnextbox}%
      \else
        \doifvalue{#1\c!linecorrection}\v!on \startbaselinecorrection
        \doifinset{\getvalue{#1\c!margin}}{\v!standard,\v!yes}\noindent
        \flushnextbox
        \doifvalue{#1\c!depthcorrection}\v!on\baselinecorrection
        \doifvalue{#1\c!linecorrection }\v!on\stopbaselinecorrection
      \fi
      \endgroup
      \getvalue{#1\c!after}%
      \egroup}
   \vbox}

\protect \endinput