|
1 | 1 | % Template: Control LaTeX |
2 | 2 | % Documento: Funciones para insertar imágenes |
3 | | -% Versión: 5.0.3 (23/11/2021) |
| 3 | +% Versión: 5.0.4 (26/11/2021) |
4 | 4 | % Codificación: UTF-8 |
5 | 5 | % |
6 | 6 | % Autor: Pablo Pizarro R. |
|
10 | 10 | % Licencia MIT: [https://opensource.org/licenses/MIT] |
11 | 11 |
|
12 | 12 | \global\def\GLOBALimagelink {} % Almacena el link de la imagen |
| 13 | +\global\def\GLOBALimagenextmarginv {0 cm} % Almacena el margen vertical de las imágenes |
13 | 14 |
|
14 | 15 | % Calcula largo hspace |
15 | 16 | % Regresión entre 35,46446->9 y 52,68402->13,5 |
|
41 | 42 | }{}% |
42 | 43 | \ifthenelse{\equal{#5}{}}{ % Sin label |
43 | 44 | \ifthenelse{\equal{\GLOBALimagelink}{}}{ % Sin link |
44 | | - \fbox{\includegraphics[#3]{#2}}% |
| 45 | + \raisebox{\GLOBALimagenextmarginv}{% |
| 46 | + \fbox{\includegraphics[#3]{#2}} |
| 47 | + }% |
45 | 48 | }{ % Con link |
46 | | - \fbox{\href{\GLOBALimagelink}{\includegraphics[#3]{#2}}}% |
| 49 | + \raisebox{\GLOBALimagenextmarginv}{% |
| 50 | + \fbox{\href{\GLOBALimagelink}{\includegraphics[#3]{#2}}}% |
| 51 | + }% |
47 | 52 | }% |
48 | 53 | }{ % Con label |
49 | 54 | \ifthenelse{\equal{\GLOBALimagelink}{}}{ % Sin link |
50 | 55 | \subfloat[#5]{% |
51 | | - \fbox{\includegraphics[#3]{#2}}#1% |
| 56 | + \raisebox{\GLOBALimagenextmarginv}{% |
| 57 | + \fbox{\includegraphics[#3]{#2}}#1% |
| 58 | + }% |
52 | 59 | }% |
53 | 60 | }{ % Con link |
54 | 61 | \subfloat[#5]{% |
55 | | - \fbox{\href{\GLOBALimagelink}{\includegraphics[#3]{#2}}#1}% |
| 62 | + \raisebox{\GLOBALimagenextmarginv}{% |
| 63 | + \fbox{\href{\GLOBALimagelink}{\includegraphics[#3]{#2}}#1}% |
| 64 | + }% |
56 | 65 | }% |
57 | 66 | }% |
58 | 67 | }% |
59 | 68 | \endgroup% |
60 | 69 | \global\def\GLOBALenvimageadded {true}% |
| 70 | + \global\def\GLOBALimagenextmarginv {0 cm}% |
61 | 71 | } |
62 | 72 |
|
63 | 73 | % Añade una imagen a un env "image" con borde sin leyenda |
|
105 | 115 | \ifthenelse{\equal{#7}{}}{ % Sin label |
106 | 116 | \ifthenelse{\equal{\animatedimageloop}{true}}{ % Con loop |
107 | 117 | \ifthenelse{\equal{\animatedimageautoplay}{true}}{ % Con autoplay |
108 | | - \fbox{\animategraphics[loop,autoplay,#3]{#4}{#2-}{0}{#5}}% |
| 118 | + \raisebox{\GLOBALimagenextmarginv}{% |
| 119 | + \fbox{\animategraphics[loop,autoplay,#3]{#4}{#2-}{0}{#5}}% |
| 120 | + }% |
109 | 121 | }{ % Sin autoplay |
110 | | - \fbox{\animategraphics[loop,#3]{#4}{#2-}{0}{#5}}% |
| 122 | + \raisebox{\GLOBALimagenextmarginv}{% |
| 123 | + \fbox{\animategraphics[loop,#3]{#4}{#2-}{0}{#5}}% |
| 124 | + }% |
111 | 125 | }% |
112 | 126 | }{ % Sin loop |
113 | 127 | \ifthenelse{\equal{\animatedimageautoplay}{true}}{ % Con autoplay |
114 | | - \fbox{\animategraphics[autoplay,#3]{#4}{#2-}{0}{#5}}% |
| 128 | + \raisebox{\GLOBALimagenextmarginv}{% |
| 129 | + \fbox{\animategraphics[autoplay,#3]{#4}{#2-}{0}{#5}}% |
| 130 | + }% |
115 | 131 | }{ % Sin autoplay |
116 | | - \fbox{\animategraphics[#3]{#4}{#2-}{0}{#5}}% |
| 132 | + \raisebox{\GLOBALimagenextmarginv}{% |
| 133 | + \fbox{\animategraphics[#3]{#4}{#2-}{0}{#5}}% |
| 134 | + }% |
117 | 135 | }% |
118 | 136 | }% |
119 | 137 | }{ % Con label |
120 | 138 | \subfloat[#7]{% |
121 | 139 | \ifthenelse{\equal{\animatedimageloop}{true}}{ % Con loop |
122 | 140 | \ifthenelse{\equal{\animatedimageautoplay}{true}}{ % Con autoplay |
123 | | - \fbox{\animategraphics[loop,autoplay,#3]{#4}{#2-}{0}{#5}#1}% |
| 141 | + \raisebox{\GLOBALimagenextmarginv}{% |
| 142 | + \fbox{\animategraphics[loop,autoplay,#3]{#4}{#2-}{0}{#5}#1}% |
| 143 | + }% |
124 | 144 | }{ % Sin autoplay |
125 | | - \fbox{\animategraphics[loop,#3]{#4}{#2-}{0}{#5}#1}% |
| 145 | + \raisebox{\GLOBALimagenextmarginv}{% |
| 146 | + \fbox{\animategraphics[loop,#3]{#4}{#2-}{0}{#5}#1}% |
| 147 | + }% |
126 | 148 | }% |
127 | 149 | }{ % Sin loop |
128 | 150 | \ifthenelse{\equal{\animatedimageautoplay}{true}}{ % Con autoplay |
129 | | - \fbox{\animategraphics[autoplay,#3]{#4}{#2-}{0}{#5}#1}% |
| 151 | + \raisebox{\GLOBALimagenextmarginv}{% |
| 152 | + \fbox{\animategraphics[autoplay,#3]{#4}{#2-}{0}{#5}#1}% |
| 153 | + }% |
130 | 154 | }{ % Sin autoplay |
131 | | - \fbox{\animategraphics[#3]{#4}{#2-}{0}{#5}#1}% |
| 155 | + \raisebox{\GLOBALimagenextmarginv}{% |
| 156 | + \fbox{\animategraphics[#3]{#4}{#2-}{0}{#5}#1}% |
| 157 | + }% |
132 | 158 | }% |
133 | 159 | }% |
134 | 160 | }% |
135 | 161 | }% |
136 | 162 | \endgroup% |
137 | 163 | \global\def\GLOBALenvimageadded {true}% |
| 164 | + \global\def\GLOBALimagenextmarginv {0 cm}% |
138 | 165 | } |
139 | 166 |
|
140 | 167 | % Añade una imagen a un env "image" con borde sin leyenda animada |
|
220 | 247 | ~ \\ \vspace*{#1}% |
221 | 248 | } |
222 | 249 |
|
| 250 | +% Establece el margen vertical de la siguiente imagen |
| 251 | +% #1 Margen vertical |
| 252 | +\newcommand{\setnextimagevmargin}[1]{% |
| 253 | + \emptyvarerr{\setimagesvmargin}{#1}{Tamaño del margen}% |
| 254 | + \global\def\GLOBALimagenextmarginv {#1}% |
| 255 | +} |
| 256 | + |
223 | 257 | % Insertar una imagen |
224 | 258 | % #1 Label (opcional) |
225 | 259 | % #2 Dirección de la imagen |
|
0 commit comments