|
1 | | -#let logos = ( |
2 | | - escudo: "imagenes/institucion/escudoU2014.svg", |
3 | | - fcfm: "imagenes/institucion/fcfm.svg", |
4 | | - dcc: "imagenes/institucion/dcc.svg", |
5 | | -) |
| 1 | +#import "constants.typ": * |
6 | 2 |
|
7 | | -#let pronombre = ( |
8 | | - el: (titulo: "O", guia: ""), |
9 | | - ella: (titulo: "A", guia: "a"), |
10 | | - elle: (titulo: "E", guia: "e"), |
11 | | -) |
12 | | - |
13 | | -#let guia(visible: true, body) = if visible [ |
14 | | - #set rect(width: 100%, stroke: black) |
15 | | - #set par(justify: true, first-line-indent: 0pt) |
16 | | - #block(breakable: false)[#stack(dir: ttb, |
17 | | - rect(fill: black, radius: (top: 5pt, bottom: 0pt), text(fill: white, "Guía (deshabilitar antes de entregar)")), |
18 | | - rect(fill: luma(230), radius: (top: 0pt, bottom: 5pt), body) |
19 | | - )]] else [] |
20 | | - |
21 | 3 | #let conf( |
22 | | - titulo: none, // Título de la práctica |
23 | | - autor: none, // diccionario con nombre y pronombre, (nombre: "", pronombre: pronombre.<el/ella/elle>) |
24 | | - practica: 1, // puede ser práctica 1 o 2 |
25 | | - codigo: "CC4901", // CC4901 para práctica I, CC5901 para práctica II |
26 | | - ingenieria: "Ingeniería civil en Computación", // Nombre de la carrera |
27 | | - correo: "example@example.com", // Correo de autor |
28 | | - telefono: "+56 9 8765 4321", // Número de teléfono de autor |
29 | | - periodo: "Enero - Febrero 2024", // Periodo en que se realizó la práctica |
30 | | - empresa: "Empre S.A.", // Nombre de la empresa |
31 | | - supervisor: none, // (nombre: "nombre apellido", pronombre: pronombre.<el/ella/elle>) |
32 | | - correo-supervisor: "example@example.com", // Correo de supervisor |
33 | | - telefono-supervisor: "+56 9 8765 4321", // Número de teléfono de supervisor |
34 | | - fecha: none, // si no se especifica, se usa la fecha de hoy |
35 | | - espaciado_titulo: 1fr, // espacio extra que rodea al título y al nombre en la portada, 1fr es lo mismo que el resto de espacios, 2fr es el doble, etc. |
| 4 | + metadata: (:), // metadata del documento |
36 | 5 | doc, |
37 | 6 | ) = { |
38 | 7 | let header = [ |
|
74 | 43 |
|
75 | 44 |
|
76 | 45 | let _informe = [#set text(weight: "bold", size: 24pt) |
77 | | - Informe de Práctica Profesional #numbering("I", practica)] |
78 | | - let _ingenieria = text(size: 16pt, ingenieria) |
| 46 | + Informe de Práctica Profesional #numbering("I", metadata.practica.numero)] |
| 47 | + let _ingenieria = text(size: 16pt, metadata.practica.carrera) |
79 | 48 | let _supervisor(gen: pronombre.el) = [Supervisor#gen.guia] |
80 | | - let _fecha = if fecha != none [#fecha] else [ |
| 49 | + let _fecha = if metadata.fecha != none [#fecha] else [ |
81 | 50 | // Workaround para traducir meses |
82 | 51 | #show "January": "Enero" |
83 | 52 | #show "February": "Febrero" |
|
92 | 61 | #show "November": "Noviembre" |
93 | 62 | #show "December": "Diciembre" |
94 | 63 | #datetime.today().display("[day] de [month repr:long] de [year]") |
95 | | - ] |
| 64 | + ] |
96 | 65 |
|
97 | 66 | let portada = align(center)[ |
98 | | - |
99 | 67 | #stack(dir: ttb, spacing: 1fr, |
100 | | - espaciado_titulo, |
| 68 | + metadata.espaciado-titulo, |
101 | 69 | _informe, |
102 | 70 | 0.2fr, |
103 | | - text(size: 20pt, titulo), |
104 | | - espaciado_titulo, |
105 | | - text(size: 24pt, smallcaps(autor.nombre)), |
| 71 | + text(size: 20pt, metadata.titulo), |
| 72 | + metadata.espaciado-titulo, |
| 73 | + text(size: 24pt, smallcaps(metadata.autoria.nombre)), |
106 | 74 | 0.2fr, |
107 | 75 | _ingenieria, |
108 | | - espaciado_titulo, |
109 | | - |
| 76 | + metadata.espaciado-titulo, |
110 | 77 | [ |
111 | 78 | #set terms(separator: ": ") |
112 | | - / Correo: #correo |
113 | | - / Teléfono: #telefono |
114 | | - / Empresa: #empresa |
115 | | - / Periodo de realización: #periodo \ \ |
116 | | - / #_supervisor(gen: supervisor.pronombre): #supervisor.nombre |
117 | | - / Correo: #correo-supervisor |
118 | | - / Teléfono: #telefono-supervisor \ \ |
119 | | - #codigo Práctica Profesional #numbering("I", practica) \ |
| 79 | + / Correo: #metadata.autoria.correo |
| 80 | + / Teléfono: #metadata.autoria.telefono |
| 81 | + / Empresa: #metadata.practica.empresa |
| 82 | + / Periodo de realización: #metadata.practica.periodo \ \ |
| 83 | + / #_supervisor(gen: metadata.supervision.pronombre): #metadata.supervision.nombre |
| 84 | + / Correo: #metadata.supervision.correo |
| 85 | + / Teléfono: #metadata.supervision.telefono \ \ |
| 86 | + #metadata.practica.codigo Práctica Profesional #numbering("I", metadata.practica.numero) \ |
120 | 87 | / Fecha de entrega: #_fecha |
121 | 88 | ], |
122 | 89 | ) |
|
131 | 98 | set par( |
132 | 99 | justify: true, |
133 | 100 | first-line-indent: 15pt, |
| 101 | + spacing: 2em, // Espacio entre párrafos |
134 | 102 | ) // Formato de párrafos |
135 | | - show par: set block(spacing: 2em) // Espacio entre párrafos |
136 | 103 | set cite(style: "council-of-science-editors") // esto deja las citas contiguas como [1, 2] o [1-3] |
137 | 104 | pagebreak(weak: true) // Salto de página |
138 | 105 | counter(page).update(1) // Reestablecer el contador de páginas |
139 | 106 |
|
140 | 107 | let numbering-indent = 2em |
141 | 108 | let page-num-indent = 1.2em |
142 | 109 | show bibliography: set heading(numbering: "1.") |
143 | | - show selector(outline.entry): it => { |
144 | | - let num = if it.body.has("children") [#it.body.children.first()] else [] |
145 | | - box(width: numbering-indent, num) |
146 | | - if it.body.has("children") [ |
147 | | - #link(it.element.location())[#for i in it.body.children.slice(1) {i}] |
148 | | - ] else [#link(it.element.location())[ #it.element.body]] |
149 | | - box(width: 1fr, repeat[.]) |
150 | | - box(width: page-num-indent, align(right, it.page)) |
151 | | - } |
152 | | - |
153 | | - show selector(outline.entry.where(level: 1)): strong // Negrita para los títulos de nivel 1 |
| 110 | + set outline.entry(fill: none) |
| 111 | + show outline.entry.where(level: 1): it => box(height: 20pt, align(bottom, strong(it))) |
| 112 | + show outline.entry.where(level: 2): it => box(height: 10pt, h(15pt) + it) |
154 | 113 |
|
155 | 114 | [ \ ] |
156 | | - outline( |
157 | | - depth: 2, |
158 | | - indent: none, |
159 | | - ) |
| 115 | + outline(depth: 2) |
160 | 116 |
|
161 | | - show heading: it => { |
162 | | - it |
163 | | - par(text(size:0.35em, h(0.0em))) |
164 | | - } // Workaround para que se aplique la indentación al primer párrafo luego de un heading |
165 | | - set page(numbering: "1", margin: (top: 3cm, bottom: 2cm, rest: 2.5cm)) |
| 117 | + set page( |
| 118 | + numbering: "1", |
| 119 | + margin: (top: 3cm, bottom: 2cm, rest: 2.5cm) |
| 120 | + ) |
166 | 121 | pagebreak(weak: true) // Salto de página |
167 | 122 | counter(page).update(1) // Reestablecer el contador de páginas |
168 | 123 | doc |
|
0 commit comments