summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/spac-adj.mkiv
blob: 936e00624e087c857072160880334b9a283c128a (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
%D \module
%D   [       file=spac-adj, % moved from spac-par.mkiv
%D        version=2009.10.16, % 1997.03.31, was core-spa.tex
%D          title=\CONTEXT\ Spacing Macros,
%D       subtitle=Paragraphs,
%D         author=Hans Hagen,
%D           date=\currentdate,
%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
%C details.

\writestatus{loading}{ConTeXt Spacing Macros / Adjustments}

\unprotect

% Very nasty but needed for margin stuff inside colored
% paragraphs. Obsolete for while .

\registerctxluafile{spac-adj}{1.001}

\definesystemattribute [graphicvadjust]  [public]

\unexpanded\def\enablegraphicvadjust
  {\writestatus\m!system{graphicvadjusting is no longer needed!}
   \clf_enablegraphicvadjust %once anyway
   \glet\enablegraphicvadjust\relax}

\unexpanded\def\graphicvadjust % currently not enabled ... nasty bidi handling
  {\clf_enablegraphicvadjust   % and probably no longer needed anyway
   \dowithnextboxcontentcs\forgetall\spac_vadjust_graphic_finish\vbox}

\def\spac_vadjust_graphic_finish
  {\vadjust
     {\vbox attr \graphicvadjustattribute \plusone
        {\unvbox\nextbox
         % corrects for one line paragraphs
         \nointerlineskip
         \kern-\struttotal
         \nointerlineskip
         \verticalstrut}}}

\unexpanded\def\fakedvadjust
  {\dowithnextboxcs\spac_vadjust_faked_finish\vtop}

\def\spac_vadjust_faked_finish
  {\setbox\nextbox\hpack{\llap{\lower\strutdepth\box\nextbox}}%
   \smashedbox\nextbox}

\protect \endinput