Debian Codegraph @

texmf-dist/tex/latex/l3experimental/xcoffins/xcoffins.sty

raw
1 %%
2 %% This is file `xcoffins.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% xcoffins.dtx (with options: `package')
8 %%
9 %% Copyright (C) 2010-2026 The LaTeX Project
10 %%
11 %% It may be distributed and/or modified under the conditions of
12 %% the LaTeX Project Public License (LPPL), either version 1.3c of
13 %% this license or (at your option) any later version. The latest
14 %% version of this license is in the file:
15 %%
16 %% http://www.latex-project.org/lppl.txt
17 %%
18 %% This file is part of the "l3experimental bundle" (The Work in LPPL)
19 %% and all files in that bundle must be distributed together.
20 %%
21 %% File: xcoffins.dtx
22 \ProvidesExplPackage{xcoffins}{2026-05-26}{}
23 {L3 Experimental design level coffins}
24 \keys_define:nn { coffin }
25 {
26 coffin1-hpole .tl_set:N = \l__coffin_A_hpole_tl ,
27 coffin1-hpole .value_required:n = true ,
28 coffin1-vpole .tl_set:N = \l__coffin_A_vpole_tl ,
29 coffin1-vpole .value_required:n = true ,
30 coffin2-hpole .tl_set:N = \l__coffin_B_hpole_tl ,
31 coffin2-hpole .value_required:n = true ,
32 coffin2-vpole .tl_set:N = \l__coffin_B_vpole_tl ,
33 coffin2-vpole .value_required:n = true ,
34 grow-bounding-box .bool_set:N = \l__coffin_bound_box_grow_bool ,
35 grow-bounding-box .default:n = true ,
36 hoffset .dim_set:N = \l__coffin_hoffset_dim ,
37 hoffset .value_required:n = true ,
38 voffset .dim_set:N = \l__coffin_voffset_dim ,
39 voffset .value_required:n = true
40 }
41 \keys_set:nn { coffin }
42 {
43 coffin1-hpole = H ,
44 coffin1-vpole = l ,
45 coffin2-hpole = H ,
46 coffin2-vpole = l ,
47 grow-bounding-box = true ,
48 hoffset = 0 pt ,
49 voffset = 0 pt
50 }
51 \cs_new_protected:Npn \__coffin_design_names:N #1
52 {
53 \dim_set:Nn \l__coffin_height_dim { \coffin_ht:N #1 }
54 \dim_set:Nn \l__coffin_depth_dim { \coffin_dp:N #1 }
55 \dim_set:Nn \l__coffin_width_dim { \coffin_wd:N #1 }
56 \dim_set:Nn \l__coffin_totalheight_dim
57 { \l__coffin_height_dim + \l__coffin_depth_dim }
58 \cs_set_eq:NN \Height \l__coffin_height_dim
59 \cs_set_eq:NN \Depth \l__coffin_depth_dim
60 \cs_set_eq:NN \Width \l__coffin_width_dim
61 \cs_set_eq:NN \TotalHeight \l__coffin_totalheight_dim
62 }
63 \dim_new:N \l__coffin_height_dim
64 \dim_new:N \l__coffin_depth_dim
65 \dim_new:N \l__coffin_width_dim
66 \dim_new:N \l__coffin_totalheight_dim
67 \NewDocumentCommand \NewCoffin { m }
68 { \coffin_new:N #1 }
69 \NewDocumentCommand \SetHorizontalCoffin { m +m }
70 { \hcoffin_set:Nn #1 {#2} }
71 \NewDocumentCommand \SetVerticalCoffin { m m +m }
72 { \vcoffin_set:Nnn #1 {#2} {#3} }
73 \NewDocumentCommand \SetHorizontalPole { m m m }
74 {
75 \group_begin:
76 \__coffin_design_names:N #1
77 \use:e
78 {
79 \group_end:
80 \coffin_set_horizontal_pole:Nnn #1
81 { \exp_not:n {#2} } { \dim_eval:n {#3} }
82 }
83 }
84 \NewDocumentCommand \SetVerticalPole { m m m }
85 {
86 \group_begin:
87 \__coffin_design_names:N #1
88 \use:e
89 {
90 \group_end:
91 \coffin_set_vertical_pole:Nnn #1
92 { \exp_not:n {#2} } { \dim_eval:n {#3} }
93 }
94 }
95 \NewDocumentCommand \JoinCoffins
96 {
97 o
98 s
99 m
100 > { \SplitArgument { 1 } { , } } O { H , l }
101 m
102 > { \SplitArgument { 1 } { , } } O { H , l }
103 > { \SplitArgument { 1 } { , } } D ( ) { 0 pt , 0 pt }
104 }
105 {
106 \IfNoValueTF {#1}
107 {
108 \IfBooleanTF #2
109 { \coffin_attach:NnnNnnnn #3 #4 #5 #6 #7 }
110 { \coffin_join:NnnNnnnn #3 #4 #5 #6 #7 }
111 }
112 {
113 \group_begin:
114 \keys_set:nn { coffin } {#1}
115 \tl_set:Ne \l__coffin_tmp_tl
116 {
117 \group_end:
118 \bool_if:NTF \l__coffin_bound_box_grow_bool
119 { \coffin_join:NnnNnnnn }
120 { \coffin_attach:NnnNnnnn }
121 \exp_not:N #3
122 { \exp_not:o { \l__coffin_A_hpole_tl } }
123 { \exp_not:o { \l__coffin_A_vpole_tl } }
124 \exp_not:N #5
125 { \exp_not:o { \l__coffin_B_hpole_tl } }
126 { \exp_not:o { \l__coffin_B_vpole_tl } }
127 { \dim_use:N \l__coffin_hoffset_dim }
128 { \dim_use:N \l__coffin_voffset_dim }
129 }
130 \l__coffin_tmp_tl
131 }
132 }
133 \NewDocumentCommand \TypesetCoffin
134 {
135 m
136 > { \SplitArgument { 1 } { , } } O { H , l }
137 > { \SplitArgument { 1 } { , } } D ( ) { 0 pt , 0 pt }
138 }
139 { \coffin_typeset:Nnnnn #1 #2 #3 }
140 \NewDocumentCommand \RotateCoffin { m m }
141 { \coffin_rotate:Nn #1 {#2} }
142 \NewDocumentCommand \ResizeCoffin { m m m }
143 { \coffin_resize:Nnn #1 {#2} {#3} }
144 \NewDocumentCommand \ScaleCoffin { m m m }
145 { \coffin_scale:Nnn #1 {#2} {#3} }
146 \NewDocumentCommand \CoffinDepth { m }
147 { \dim_eval:n { \coffin_dp:N #1 } }
148 \NewDocumentCommand \CoffinHeight { m }
149 { \dim_eval:n { \coffin_ht:N #1 } }
150 \NewDocumentCommand \CoffinTotalHeight { m }
151 { \dim_eval:n { \coffin_ht:N #1 + \coffin_dp:N #1 } }
152 \NewDocumentCommand \CoffinWidth { m }
153 { \dim_eval:n { \coffin_wd:N #1 } }
154 \NewDocumentCommand \DisplayCoffinHandles { m m }
155 { \coffin_if_exist:NT #1 { \coffin_display_handles:Nn #1 {#2} } }
156 \NewDocumentCommand \MarkCoffinHandle
157 { m > { \SplitArgument { 1 } { , } } O { H , l } m }
158 { \coffin_if_exist:NT #1 { \coffin_mark_handle:Nnnn #1 #2 {#3} } }
159 \NewDocumentCommand \ShowCoffinStructure { m }
160 { \coffin_show_structure:N #1 }
161 %%
162 %%
163 %% End of file `xcoffins.sty'.