blob: 8c2bc33281affe02b49faa241494c57501c050d9 (
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass{article}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{environ}
\usepackage[showframe=true]{geometry}
\newsavebox{\vabox}
\NewEnviron{verticallyaligned}{%
% temporarily set \vamaxheight to nothing during the measurements
\let\vamaxheight\relax
% measure the height of the body
\begin{lrbox}{\vabox}
\BODY%
\end{lrbox}%
% set the height of the minipage box
\newlength{\vamaxheight}
\setlength{\vamaxheight}{\ht\vabox}
% output the body, which now contains the new height :)
\noindent\makebox[\linewidth][c]{\mbox{}\hfill\BODY\hfill\mbox{}}%
}
\begin{document}
\sbox{\vabox}{%
\begin{minipage}[b][][b]{.10\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-a}
\end{minipage}%
\begin{minipage}[b][][t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-b}
\end{minipage}%
\begin{minipage}[b][][t]{.20\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-c}
\end{minipage}%
\begin{minipage}[b][][c]{.10\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image}
\end{minipage}%
\begin{minipage}[b][][t]{.20\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image}
\end{minipage}%
}%
\noindent
\begin{minipage}[b][\ht\vabox][b]{.10\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-a}
\end{minipage}%
\hfill
\begin{minipage}[b][\ht\vabox][t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-b}
\end{minipage}%
\hfill
\begin{minipage}[b][\ht\vabox][t]{.20\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-c}
\end{minipage}%
\hfill
\begin{minipage}[b][\ht\vabox][c]{.10\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image}
\end{minipage}%
\hfill
\begin{minipage}[b][\ht\vabox][t]{.20\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image}
\end{minipage}%
\par\lipsum
\begin{verticallyaligned}
\noindent\begin{minipage}[b][\vamaxheight][b]{.30\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-a}
\end{minipage}%
\hfill
\begin{minipage}[b][\vamaxheight][t]{.10\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-b}
\end{minipage}%
\hfill
\begin{minipage}[b][\vamaxheight][t]{.20\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-c}
\end{minipage}%
\hfill
\begin{minipage}[b][\vamaxheight][c]{.20\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image}
\end{minipage}%
\hfill
\begin{minipage}[b][\vamaxheight][t]{.20\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image}
\end{minipage}%
\end{verticallyaligned}
\lipsum[1]
\begin{figure}
\begin{verticallyaligned}
\noindent\begin{minipage}[b][\vamaxheight][c]{.50\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image}
\caption{}
\end{minipage}%
\hfill
\begin{minipage}[b][\vamaxheight][t]{.40\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image}
\caption{}
\end{minipage}%
\end{verticallyaligned}
\caption{}
\end{figure}
\end{document}
|