Debian Codegraph @

texmf-dist/doc/latex/joinbox/joinbox.tex

raw
1 \documentclass[full]{l3doc}
2 \usepackage[scheme=plain]{ctex}
3 \usepackage{enumitem}
4 \usepackage{indentfirst}
5 \usepackage{titling}
6 \usepackage{geometry}
7 \usepackage{fancyvrb-ex}
8 \usepackage{joinbox}
9
10 \IndexPrologue
11 {
12 \section*{Index}
13 \markboth{Index}{Index}
14 \addcontentsline{toc}{section}{Index}
15 The~italic~numbers~denote~the~pages~where~the~
16 corresponding~entry~is~described,~
17 numbers~underlined~point~to~the~definition,~
18 all~others~indicate~the~places~where~it~is~used.
19 }
20
21 \newcommand\tikzmark[1]{\tikz \coordinate[overlay, remember picture] (#1);}
22
23 \geometry{
24 left=4.5cm,
25 right=2cm,
26 top=2cm,
27 bottom=2cm,
28 }
29 \hypersetup {
30 CJKbookmarks,
31 bookmarksopen,
32 bookmarksopenlevel=3,
33 pdfstartview=FitH,
34 pdfinfo = {
35 Title = The package joinbox ,
36 Subject = A LaTeX3 package ,
37 Author = Geng Nan
38 }
39 }
40
41 \DoNotIndex{\begin, \end}
42 \setlength{\parskip}{\medskipamount}
43 \DeclareDocumentEnvironment { noteen } { +b } {
44 \par\textbf{\textsf{NOTE:~}}#1\par
45 } {}
46 \DeclareDocumentEnvironment { notezh } { +b } {
47 \par\textbf{\textsf{注意:~}}#1\par
48 } {}
49
50 \AtEndDocument{
51 \newgeometry{
52 left=2cm,
53 right=2cm,
54 top=2cm,
55 bottom=2cm
56 }
57 \PrintIndex
58 }
59
60 \ExplSyntaxOn
61 \dim_new:N \l__my_syntax_dim
62 \box_new:N \g__my_syntax_box
63 \NewDocumentEnvironment { Syntax } { s }
64 {
65 \dim_set:Nn \l__my_syntax_dim
66 { \textwidth }
67 \hbox_gset:Nw \g__my_syntax_box
68 \small \ttfamily
69 \begin{minipage}[t]{\l__my_syntax_dim}
70 \raggedright\obeyspaces\obeylines
71 }
72 {
73 \end{minipage}
74 \hbox_gset_end:
75 \IfValueF { #1 } { \smallskip }
76 \box_use_drop:N \g__my_syntax_box
77 \smallskip
78 }
79
80 \DeclareDocumentEnvironment { Description } { o +b } {
81 \hbox_set:Nn \l_tmpa_box { #1 }
82 \dim_set:Nn \l_tmpa_dim { \box_wd:N \l_tmpa_box }
83 \begin{itemize}[labelwidth=\l_tmpa_dim, align=left]
84 #2
85 \end{itemize}
86 } { }
87
88 \keys_define:nn { joinbox/doc } {
89 opt .tl_set:N = \l_opt_tl,
90 desc .tl_set:N = \l_desc_tl,
91 init .tl_set:N = \l_init_tl,
92 init .initial:n = init-none,
93 }
94
95 \box_new:N \l__option_box
96 \NewDocumentEnvironment { option } { m +b } {
97 \keys_set:nn { joinbox/doc } { #1 }
98 \hbox_set:Nw \l__option_box
99 \small \ttfamily
100 \begin{minipage}[t]{\textwidth}
101 \obeyspaces\obeylines
102 \textcolor{red}{
103 \l_opt_tl
104 \exp_args:Nx\SpecialOptionIndex{\l_opt_tl}
105 }
106 {~}\l_desc_tl
107 \hfill(
108 \tl_if_eq:NnTF \l_init_tl { init-none } { no~value }
109 { initially~\texttt{\l_init_tl} }
110 )
111 \end{minipage}
112 \hbox_gset_end:
113 \box_use_drop:N \l__option_box
114 #2
115 \medskip
116 } { }
117
118 \DeclareDocumentCommand \opt { O{} m }
119 { \__codedoc_cmd:no {#1} { #2 } }
120 \ExplSyntaxOff
121
122 \def\vers{\texttt{v1.0.3}
123 \thanks{\url{https://gitee.com/nwafu_nan/joinbox}}
124 }
125
126 \begin{document}
127 \title{
128 \pkg{joinbox}盒子拼接宏包
129 \rlap{\makebox[4cm][r]{
130 \normalsize $\Longrightarrow$ \color{red}
131 \protect\hyperlink{en}{English Version}
132 \protect\hypertarget{zh}{}
133 }}
134 }
135 \author{\textit{耿楠} \texttt{<[email protected]>}}
136 \date{\the\year 年\the\month 月\the\day 日\qquad \vers
137 }
138 \maketitle
139
140 {\small
141 \tableofcontents
142 }
143 \newpage
144
145 \begin{documentation}
146
147 \section{引言}
148
149 \pkg{joinbox}是一个基于\pkg{l3coffins}用\pkg{Expl3}开发的
150 盒子拼接宏包,它用于实现盒子的垂直或水平拼接。垂直拼接
151 会以各对象等宽的方式拼接,而水平拼接会以各对象等高的方式
152 拼接。
153
154 该宏包提供了\tn{joinbox}、\tn{joinboxes}和\tn{joinfigs}三个拼接
155 命令。其中,\tn{joinbox}用于拼接两个独立对象,\tn{joinboxes}用于
156 拼接一组对象,\tn{joinfigs}用于拼接多个图像。这三个命令的不带*(星号)
157 版本用于垂直拼接,而带*(星号)的版本用于水平拼接。
158
159 同时,该宏包还提供了\tn{joinset}命令用于对输出基线、尺寸和拼接间距进行设置。
160
161 \section{用户接口}
162
163 \subsection{\cs{joinbox}拼接两个对象命令}
164
165 \begin{function}{\joinbox,\joinbox*}
166 \begin{syntax}
167 \cs{joinbox} \oarg{拼接选项} \marg{对象1} \marg{对象2}
168 \cs{joinbox*} \oarg{拼接选项} \marg{对象1} \marg{对象2}
169 \end{syntax}
170
171 \end{function}
172
173 用于拼接两个对象。 该命令需要用两个必选参数\marg{对象1}和
174 \marg{对象2}指定需要拼接的对象。拼接对象将被置于coffin中,
175 然后按需求进行拼接。
176
177 \marg{对象1}或\marg{对象2}可以置空,但两者不能同时为空。
178
179 在\oarg{拼接选项}中,可以通过逗号分隔的key-value指定输出结果
180 基线位置、 输出尺寸(垂直拼接是输出宽度,水平拼接是输出高度)
181 和拼接间距。
182
183 \subsection{\cs{joinboxes}拼接多个对象命令}
184
185 \begin{function}{\joinboxes,\joinboxes*}
186 \begin{syntax}
187 \cs{joinboxes} \oarg{拼接选项} \marg{拼接内容列表}
188 \cs{joinboxes*} \oarg{拼接选项} \marg{拼接内容列表}
189 \end{syntax}
190
191 \end{function}
192
193 用于拼接多个对象。该命令需要用一个必选参数\marg{拼接内容列表},
194 指定需要拼接的内容,不同内容之间用英文逗号进行分隔,若内容中含
195 有空格或逗号,则需要将其置于|{}|分组中。最少需要有1个拼接内容。
196
197 在\oarg{拼接选项}中,可以通过逗号分隔的key-value指定结果基线位置、
198 输出尺寸(垂直拼接是输出宽度,水平拼接是输出调试)、拼接间距。
199
200 \subsection{\cs{joinfigs}拼接多个图像命令}
201
202 \begin{function}{\joinfigs,\joinfigs*}
203 \begin{syntax}
204 \cs{joinfigs} \oarg{拼接选项} \marg{文件名称列表}
205 \cs{joinfigs*} \oarg{拼接选项} \marg{文件名称列表}
206 \end{syntax}
207
208 \end{function}
209
210 用于拼接多个图像。该命令需要用一个必选参数\marg{文件名称列表}
211 指定需要拼接图像,文件名称中可以包含路径,不同文件名称之间用
212 英文逗号进行分隔。最少需要有1个图像文件名称。
213
214 在\oarg{拼接选项}中,可以通过逗号分隔的key-value指定结果基线位置、
215 输出尺寸(垂直拼接是输出宽度,水平拼接是输出调试)、拼接间距。
216
217 \subsection{\cs{joinset}}
218 \begin{function}{\joinset}
219 \begin{syntax}
220 \cs{joinset} \marg{拼接选项}
221 \end{syntax}
222
223 \end{function}
224
225 用于通过逗号分隔的key-value指定拼接结果中的基线位置、
226 输出尺寸(垂直拼接是输出宽度,水平拼接是输出调试)、拼接间距。
227
228 \section{拼接选项}
229
230 \begin{option}{ opt = baseline, desc = {= \meta{t,vc,H,b}}, init=b }
231 设置joinbox或joinfigs拼接结果的输出基线位置,目前支持:
232 \end{option}\\
233 \begin{Description}
234 \item |t|--- 盒子顶端水平线、
235 \item |vc|---盒子水平中心线、
236 \item |H|---盒子内容基线、
237 \item |b|---盒子底端水平线。
238 \end{Description}
239 \begin{notezh}
240 可以省略\texttt{baseline}键名,但其值只能取|t|、|vc|、|H|和|b|。
241 \end{notezh}
242
243 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
244 默认基线->\fbox{
245 \joinbox{\LaTeX 科技排版}
246 {\LaTeX~Typesetting}
247 }
248
249 指定基线->\fbox{
250 \joinbox[baseline=t]{\LaTeX 科技排版}
251 {\LaTeX~Typesetting}
252 }
253
254 省略键名->\fbox{
255 \joinbox[vc]{\LaTeX 科技排版}
256 {\LaTeX~Typesetting}
257 }
258 \end{SideBySideExample}
259
260 \bigskip
261
262 \begin{option}{ opt = outlen, desc = {= \meta{dim}}, init=0pt }
263 设置joinbox或joinfigs拼接结果的输出尺寸,对于垂直拼接,设置
264 输出宽度,对于水平拼接,设置输出高度。
265
266 若指定的输出尺寸$\le 0$,则表示使用被拼接对象中的最小尺寸输出。
267 \end{option}\\
268 \begin{notezh}
269 可以省略\texttt{outlen}键名,但值只能取|dim|尺寸或尺寸表达式。
270
271 当同时省略\texttt{baseline}键名和\texttt{outlen}键名时,如果
272 键值为不支持的\texttt{baseline},也是不|dim|尺寸或|dim|尺寸表达式,
273 则会出错。
274 \end{notezh}
275 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
276 输出宽度\fbox{
277 \joinbox[outlen=2cm]{\LaTeX 科技排版}
278 {\LaTeX~Typesetting}
279 }
280
281 输出高度\fbox{
282 \joinbox*[outlen=0.2cm]{\LaTeX 科技排版}
283 {\LaTeX~Typesetting}
284 }
285
286 省略键名\fbox{
287 \joinbox[3cm]{\LaTeX 科技排版}
288 {\LaTeX~Typesetting}
289 }
290 \end{SideBySideExample}
291
292 \bigskip
293
294 \begin{option}{ opt = sep, desc = {= \meta{dim}}, init=0pt }
295 设置拼接对象之间的间距。
296 \end{option}\\
297 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
298 垂直间距\fbox{
299 \joinbox[sep=5pt]{\LaTeX 科技排版}
300 {\LaTeX~Typesetting}
301 }
302
303 水平间距\fbox{
304 \joinbox*[outlen=0.2cm,sep=5pt]
305 {\LaTeX 科技排版}
306 {\LaTeX~Typesetting}
307 }
308 \end{SideBySideExample}
309
310 \section{多盒子拼接}
311
312 可以使用\tn{joinboxes}命令一次拼接多个对象,不同对象间用逗号进行分隔,
313 如果对象包含逗号,则需要将该对象置于|{}|构成的分组中。
314
315 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
316 \joinboxes[sep=2pt]{%
317 \LaTeX 科技排版,
318 {\LaTeX, Typesetting}
319 }
320
321 \joinboxes*[0.2cm,sep=2pt]{%
322 \LaTeX 科技排版,
323 {\LaTeX, Typesetting}
324 }
325 \end{SideBySideExample}
326
327 \section{嵌套拼接}
328
329 可以嵌套使用\tn{joinbox}、\tn{joinboxes}命令以实现复杂对象拼接。
330
331 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
332 \joinbox*[outlen=0.04\textheight,sep=-5pt]
333 {
334 \joinbox[sep=5pt]{\LaTeX 科技排版}
335 {\qquad\LaTeX~Typesetting\qquad}
336 }{
337 \includegraphics[scale=0.2]{expl3}
338 }
339 \end{SideBySideExample}
340
341 \section{图像拼接}
342
343 \subsection{原始图像}
344
345 \begin{center}
346 \includegraphics[scale=0.4]{latexframe}\quad
347 \includegraphics[scale=0.4]{tl-lion}\quad
348 \includegraphics[scale=0.4]{expl3}
349 \end{center}
350
351 \subsection{垂直拼接图像}
352
353 垂直拼接时,各对象保持相同宽度。
354
355 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
356 \joinfigs[outlen=3cm, sep=5pt]
357 {latexframe, tl-lion, expl3}
358 \end{SideBySideExample}
359
360 \subsection{水平拼接图像}
361
362 水平拼接时,各对象保持相同高度。
363
364 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
365 \joinfigs*[outlen=1.3cm, sep=5pt]
366 {latexframe, tl-lion, expl3}
367 \end{SideBySideExample}
368
369 \subsection{嵌套拼接图像}
370
371 可以嵌套使用\tn{joinbox}、\tn{joinboxes}或\tn{joinfigs}命令以实现复杂图像拼接。
372
373 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
374 \joinbox*[0.20\textheight, sep=5pt]
375 {
376 \joinfigs[0.25\textwidth]
377 {latexframe, tl-lion, expl3}
378 }{
379 \joinfigs[0.25\textwidth]
380 {expl3, tl-lion, latexframe}
381 }
382 \end{SideBySideExample}
383
384 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
385
386 \joinboxes*[0.15\textheight, sep=5pt]{%
387 {
388 \joinfigs[0.25\textwidth]
389 {latexframe, tl-lion, expl3}
390 },
391 {
392 \joinfigs[0.25\textwidth]
393 {tl-lion, latexframe,expl3}
394 },
395 {
396 \joinfigs[0.25\textwidth]
397 {expl3, tl-lion, latexframe}
398 }
399 }
400 \end{SideBySideExample}
401
402 \section{单对象拼接}
403
404 \tn{joinbox}、\tn{joinboxes}或\tn{joinfigs}命令也可以实现只``伪拼接''
405 一个对象,此时,则可以通过选项调整输出的基线位置和大小。
406
407 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
408 \joinbox{\LaTeX 科技排版}{}
409
410 \joinbox[4cm]{}{\LaTeX 科技排版}
411
412 \joinboxes{\LaTeX 科技排版}
413 \end{SideBySideExample}
414
415 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
416 基线位置->\joinfigs[vc,4cm]{latexframe}
417 \end{SideBySideExample}
418
419 \section{垂直盒子拼接}
420
421 由于是基于Expl3的\tn{hcoffin_set:Nn}函数构造内部盒子实现拼接的,因此,
422 待拼接内容中的|\\|和\tn{par}(包括空行)等断行和分段命令将失效。此时,
423 可以先用\tn{parbox}等命令或\env{minipage}等环境先构建一个垂直盒子,
424 然后再将构造的垂直盒子作为一个对象进行拼接。
425
426 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
427 \joinbox{
428 \parbox{8em}{
429 \centering
430 \LaTeX 科技排版
431
432 \LaTeX~Typesetting
433 }
434 }{\includegraphics{expl3}}
435 \end{SideBySideExample}
436
437 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
438 \joinboxes*{
439 {
440 \begin{minipage}{8em}
441 \centering
442 \LaTeX 科技排版
443
444 \LaTeX~Typesetting
445 \end{minipage}
446 },
447 {\includegraphics{expl3}}
448 }
449 \end{SideBySideExample}
450
451 \title{
452 \pkg{joinbox} package for Joinning Boxs or Figures
453 \rlap{\makebox[2.5cm][r]{
454 \normalsize $\Longrightarrow$ \color{red}
455 \protect\hyperlink{zh}{中文版本}
456 \protect\hypertarget{en}{}
457 }}
458 }
459 \author{Nan Geng \texttt{<[email protected]>}}
460 \date{\today\qquad \vers}
461 \maketitle
462
463 \section{Introduction}
464
465 \pkg{joinbox} is a box joinning package based on l3coffins developed with Expl3,
466 which provides the \cs{joinbox}, \cs{joinboxes} and \cs{joinfigs} macros for
467 vertical or horizontal joinning of boxes. The typout baseline, size and seperated
468 space can be set up with the options or \cs{joinset} macro.
469
470 Boxes can be joined vertically or horizontally. When using vertical joinning, all
471 boxes to be joined will keep same width, while when using horizontal joined, all
472 boxes to be joined will keep same height.
473
474 The \cs{joinbox}, \cs{joinboxes} and \cs{joinfigs} macros without star are used
475 for vertical joinning, while the \cs{joinbox*}, \cs{joinboxes*} and
476 \cs{joinfigs*} with star are used for horizontal joinning.
477
478 \section{Interfaces}
479
480 \subsection{\cs{joinbox} for Two Contents Joinning }
481
482 \begin{function}{\joinbox,\joinbox*}
483 \begin{syntax}
484 \cs{joinbox} \oarg{options} \marg{content1} \marg{content2}
485 \cs{joinbox*} \oarg{options} \marg{content1} \marg{content2}
486 \end{syntax}
487
488 \end{function}
489
490 Used to join two contents. It requires two arguments \marg{content1} and
491 \marg{content2} to specify the objects to be joined. The contents will
492 be placed in the coffin respectively and then joined.
493
494 \marg{content1} or \marg{content2} can be null, but both cannot be null at
495 the same time.
496
497 In the \oarg{options}, the typeout baseline, typeout size
498 (vertical joinning is width, horizontal joinning is height), and
499 joinning seperate spacing can be specified with \textit{key-value}.
500
501 \subsection{\cs{joinboxes} for Content Sets Joinning}
502
503 \begin{function}{\joinboxes,\joinboxes*}
504 \begin{syntax}
505 \cs{joinboxes} \oarg{options} \marg{content list}
506 \cs{joinboxes*} \oarg{options} \marg{content list}
507 \end{syntax}
508
509 \end{function}
510
511 Used for joinning multiple contents. This command requires a
512 argument\marg{content list} to specify the content to be joined.
513 They should be separated by commas, it should. Items which contain
514 either spaces or commas should be surrounded by braces.
515 At least one content is required.
516
517 In the \oarg{options}, the typeout baseline, typeout size
518 (vertical joinning is width, horizontal joinning is height), and
519 joinning seperate spacing can be specified with \textit{key-value}.
520
521 \subsection{\cs{joinfigs} for Figure Sets Joinning}
522
523 \begin{function}{\joinfigs,\joinfigs*}
524 \begin{syntax}
525 \cs{joinfigs} \oarg{options} \marg{namelist}
526 \cs{joinfigs*} \oarg{options} \marg{namelist}
527 \end{syntax}
528
529 \end{function}
530
531 Used for joinning multiple images. This command requires a argument\marg{namelist}
532 to specify the image to be joined. The file name can include a path,
533 and different file names should be separated by commas.
534 At least one image file name is required.
535
536 In the \oarg{options}, the typeout baseline, typeout size
537 (vertical joinning is width, horizontal joinning is height), and
538 joinning seperate spacing can be specified with \textit{key-value}.
539
540 \subsection{\cs{joinset} for Settings}
541 \begin{function}{\joinset}
542 \begin{syntax}
543 \cs{joinset} \marg{options}
544 \end{syntax}
545
546 \end{function}
547
548 Used to set the typeout baseline, typeout size
549 (vertical joinning is width, horizontal joinning is height), and
550 joinning seperate spacing with \textit{key-value}.
551
552 \section{Options}
553
554 \begin{option}{ opt = baseline, desc = {= \meta{t,vc,H,b}}, init=b }
555 Set typeout baseline, currently as follows:
556 \end{option}\\
557 \begin{Description}
558 \item |t|--- a pole running along the top edge of the bounding box of the coffin;
559 \item |vc|---a pole running horizontally through the centre of the coffin half-way between the
560 bottom and top edges of the bounding box (i.e. the “vertical centre”);
561 \item |H|---a pole running along the baseline of the typeset material contained in the coffin;
562 \item |b|---a pole running along the bottom edge of the bounding box of the coffin.
563 \end{Description}
564 \begin{noteen}
565 In most cases, you can omit the baseline key names and write only it's value.
566 But the value must be t, vc, H or b.
567 \end{noteen}
568
569 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
570 default->\fbox{
571 \joinbox{Hello \LaTeX}
572 {\LaTeX~Typesetting}
573 }
574
575 top->\fbox{
576 \joinbox[baseline=t]{Hello \LaTeX}
577 {\LaTeX~Typesetting}
578 }
579
580 omit baseline->\fbox{
581 \joinbox[vc]{Hello \LaTeX}
582 {\LaTeX~Typesetting}
583 }
584 \end{SideBySideExample}
585
586 \bigskip
587
588 \begin{option}{ opt = outlen, desc = {= \meta{dim}}, init=0pt }
589 Used to set typeout size, vertical joinning is width and horizontal joinning is height.
590
591 If $outlen\le 0$,then the typeout size is minimal size of all contents.
592 \end{option}\\
593 \begin{noteen}
594 In most cases, you can omit the outlen key names and write only it's value.
595 But the value must be dimension expression.
596
597 When omitting both the |baseline| key name and the |outlen| key name,
598 an error occurs if the key value is an unsupported |baseline| and
599 not |dim| or |dim| expression.
600 \end{noteen}
601
602 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
603 width: \fbox{
604 \joinbox[outlen=2cm]{Hello \LaTeX}
605 {\LaTeX~Typesetting}
606 }
607
608 height: \fbox{
609 \joinbox*[outlen=0.2cm]{Hello \LaTeX}
610 {\LaTeX~Typesetting}
611 }
612
613 omit outlen: \fbox{
614 \joinbox[2cm]{Hello \LaTeX}
615 {\LaTeX~Typesetting}
616 }
617 \end{SideBySideExample}
618
619 \bigskip
620
621 \begin{option}{ opt = sep, desc = {= \meta{dim}}, init=0pt }
622 Used to set joinning seperate spacing.
623 \end{option}\\
624 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
625 vertical sep: \fbox{
626 \joinbox[sep=5pt]{Hello \LaTeX}
627 {\LaTeX~Typesetting}
628 }
629
630 horizontal sep: \fbox{
631 \joinbox*[outlen=0.2cm,sep=5pt]
632 {Hello \LaTeX}
633 {\LaTeX~Typesetting}
634 }
635 \end{SideBySideExample}
636
637 \section{Multiple Joinning}
638
639 The \tn{joinboxes} can join multiple contents.
640
641 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
642 \joinboxes[sep=2pt]{%
643 {Hello, \LaTeX},
644 \LaTeX~Typesetting
645 }
646
647 \joinboxes*[0.2cm,sep=2pt]{%
648 {Hello, \LaTeX},
649 \LaTeX~Typesetting
650 }
651 \end{SideBySideExample}
652
653 \section{Nested Joinning}
654
655 The \tn{joinbox} \tn{joinboxes} can be nested to get complex joinning.
656
657 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
658 \joinbox*[outlen=0.04\textheight,sep=-5pt]
659 {
660 \joinbox[sep=5pt]{Hello \LaTeX}
661 {\qquad\LaTeX~Typesetting\qquad}
662 }{
663 \includegraphics[scale=0.2]{expl3}
664 }
665 \end{SideBySideExample}
666
667 \section{Figures Joinning}
668
669 \subsection{Original}
670
671 \begin{center}
672 \includegraphics[scale=0.4]{latexframe}\quad
673 \includegraphics[scale=0.4]{tl-lion}\quad
674 \includegraphics[scale=0.4]{expl3}
675 \end{center}
676
677 \subsection{Vertical Joinning}
678
679 When using vertical joinning, all boxes to be joined will keep same width.
680
681 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
682 \joinfigs[outlen=3cm, sep=5pt]
683 {latexframe, tl-lion, expl3}
684 \end{SideBySideExample}
685
686 \subsection{Horizontal Joinning}
687
688 When using horizontal joined, all boxes to be joined will keep same height.
689
690 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
691 \joinfigs*[outlen=1.3cm, sep=5pt]
692 {latexframe, tl-lion, expl3}
693 \end{SideBySideExample}
694
695 \subsection{Nested Joinning}
696
697 The\tn{joinbox}, \tn{joinboxes}, or \tn{joinfigs} macros
698 can be nested for complex image joinning.
699
700 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
701 \joinbox*[0.20\textheight, sep=5pt]
702 {
703 \joinfigs[0.25\textwidth]
704 {latexframe, tl-lion, expl3}
705 }{
706 \joinfigs[0.25\textwidth]
707 {expl3, tl-lion, latexframe}
708 }
709 \end{SideBySideExample}
710
711 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
712 \joinboxes*[0.15\textheight, sep=5pt]{%
713 {
714 \joinfigs[0.25\textwidth]
715 {latexframe, tl-lion, expl3}
716 },
717 {
718 \joinfigs[0.25\textwidth]
719 {tl-lion, latexframe,expl3}
720 },
721 {
722 \joinfigs[0.25\textwidth]
723 {expl3, tl-lion, latexframe}
724 }
725 }
726 \end{SideBySideExample}
727
728 \section{Single Joinning}
729
730 The \tn{joinbox}, \tn{joinboxes}, or \tn{joinfigs} macros can also be
731 used to ``pseudo-joinning'' only one object, in which case the baseline
732 and size of the output can be adjusted with the options.
733
734 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
735 \joinbox{Hello \LaTeX}{}
736
737 \joinbox[4cm]{}{Hello \LaTeX}
738
739 \joinboxes{Hello \LaTeX}
740 \end{SideBySideExample}
741
742 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
743 baseline->\joinfigs[vc,4cm]{latexframe}
744 \end{SideBySideExample}
745
746 \section{Vertical Box Joinning}
747
748 Since joinbox is realized by constructing two internal boxes based on
749 the \tn{hcoffin_set:Nn} Expl3 function, line breaking and new paragraph
750 macros such as |\\| and \tn{par}(including blank lines) in the content
751 to be joined will be invalid. In this case, you can first construct a
752 vertical box using commands such as \tn{parbox} or environments such as
753 |minipage|, and then join the constructed vertical box as an object.
754
755 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
756 \joinbox{
757 \parbox{8em}{
758 \centering
759 Hello \LaTeX
760
761 \LaTeX~Typesetting
762 }
763 }{\includegraphics{expl3}}
764 \end{SideBySideExample}
765
766 \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=2]
767 \joinboxes*{
768 {
769 \begin{minipage}{8em}
770 \centering
771 Hello \LaTeX
772
773 \LaTeX~Typesetting
774 \end{minipage}
775 },
776 {\includegraphics{expl3}}
777 }
778 \end{SideBySideExample}
779
780 \end{documentation}
781
782 \end{document}