-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconf.typ
169 lines (155 loc) · 5.48 KB
/
conf.typ
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#let logos = (
escudo: "imagenes/institucion/escudoU2014.svg",
fcfm: "imagenes/institucion/fcfm.svg",
dcc: "imagenes/institucion/dcc.svg",
)
#let pronombre = (
el: (titulo: "O", guia: ""),
ella: (titulo: "A", guia: "a"),
elle: (titulo: "E", guia: "e"),
)
#let guia(visible: true, body) = if visible [
#set rect(width: 100%, stroke: black)
#set par(justify: true, first-line-indent: 0pt)
#block(breakable: false)[#stack(dir: ttb,
rect(fill: black, radius: (top: 5pt, bottom: 0pt), text(fill: white, "Guía (deshabilitar antes de entregar)")),
rect(fill: luma(230), radius: (top: 0pt, bottom: 5pt), body)
)]] else []
#let conf(
titulo: none, // Título de la práctica
autor: none, // diccionario con nombre y pronombre, (nombre: "", pronombre: pronombre.<el/ella/elle>)
practica: 1, // puede ser práctica 1 o 2
codigo: "CC4901", // CC4901 para práctica I, CC5901 para práctica II
ingenieria: "Ingeniería civil en Computación", // Nombre de la carrera
correo: "example@example.com", // Correo de autor
telefono: "+56 9 8765 4321", // Número de teléfono de autor
periodo: "Enero - Febrero 2024", // Periodo en que se realizó la práctica
empresa: "Empre S.A.", // Nombre de la empresa
supervisor: none, // (nombre: "nombre apellido", pronombre: pronombre.<el/ella/elle>)
correo-supervisor: "example@example.com", // Correo de supervisor
telefono-supervisor: "+56 9 8765 4321", // Número de teléfono de supervisor
fecha: none, // si no se especifica, se usa la fecha de hoy
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.
doc,
) = {
let header = [
#set text(size: 9pt)
#stack(dir: ttb,
stack(dir: ltr, spacing: 15pt,
align(bottom+left,
stack(dir: ttb, spacing: 5pt,
text("UNIVERSIDAD DE CHILE"),
text("FACULTAD DE CIENCIAS FÍSICAS Y MATEMÁTICAS"),
text("DEPARTAMENTO DE CIENCIAS DE LA COMPUTACIÓN"),
),
),
align(bottom+right, box(width: 5cm, image(logos.dcc))),
),
5pt,
line(length: 100%)
)
]
// Formato de página
set page(
paper: "us-letter",
number-align: center,
numbering: none,
header: header,
header-ascent: 10%,
margin: (top: 3cm),
)
// Formato de texto
set text(
lang: "es",
font: "New Computer Modern",
size: 12pt,
)
// Formato de headings
set heading(numbering: "1.")
let _informe = [#set text(weight: "bold", size: 24pt)
Informe de Práctica Profesional #numbering("I", practica)]
let _ingenieria = text(size: 16pt, ingenieria)
let _supervisor(gen: pronombre.el) = [Supervisor#gen.guia]
let _fecha = if fecha != none [#fecha] else [
// Workaround para traducir meses
#show "January": "Enero"
#show "February": "Febrero"
#show "March": "Marzo"
#show "April": "Abril"
#show "May": "Mayo"
#show "June": "Junio"
#show "July": "Julio"
#show "August": "Agosto"
#show "September": "Septiembre"
#show "October": "Octubre"
#show "November": "Noviembre"
#show "December": "Diciembre"
#datetime.today().display("[day] de [month repr:long] de [year]")
]
let portada = align(center)[
#stack(dir: ttb, spacing: 1fr,
espaciado_titulo,
_informe,
0.2fr,
text(size: 20pt, titulo),
espaciado_titulo,
text(size: 24pt, smallcaps(autor.nombre)),
0.2fr,
_ingenieria,
espaciado_titulo,
[
#set terms(separator: ": ")
/ Correo: #correo
/ Teléfono: #telefono
/ Empresa: #empresa
/ Periodo de realización: #periodo \ \
/ #_supervisor(gen: supervisor.pronombre): #supervisor.nombre
/ Correo: #correo-supervisor
/ Teléfono: #telefono-supervisor \ \
#codigo Práctica Profesional #numbering("I", practica) \
/ Fecha de entrega: #_fecha
],
)
]
// Portada
portada
// Comienza el pre-documento, en página i
set page(
numbering: "i",
margin: (top: 3cm, rest: 2.5cm),
) // Activar numeración de páginas y márgenes
set par(
justify: true,
first-line-indent: 15pt,
) // Formato de párrafos
show par: set block(spacing: 2em) // Espacio entre párrafos
set cite(style: "council-of-science-editors") // esto deja las citas contiguas como [1, 2] o [1-3]
pagebreak(weak: true) // Salto de página
counter(page).update(1) // Reestablecer el contador de páginas
let numbering-indent = 2em
let page-num-indent = 1.2em
show bibliography: set heading(numbering: "1.")
show selector(outline.entry): it => {
let num = if it.body.has("children") [#it.body.children.first()] else []
box(width: numbering-indent, num)
if it.body.has("children") [
#link(it.element.location())[#for i in it.body.children.slice(1) {i}]
] else [#link(it.element.location())[ #it.element.body]]
box(width: 1fr, repeat[.])
box(width: page-num-indent, align(right, it.page))
}
show selector(outline.entry.where(level: 1)): strong // Negrita para los títulos de nivel 1
[ \ ]
outline(
depth: 2,
indent: none,
)
show heading: it => {
it
par(text(size:0.35em, h(0.0em)))
} // Workaround para que se aplique la indentación al primer párrafo luego de un heading
set page(numbering: "1", margin: (top: 3cm, bottom: 2cm, rest: 2.5cm))
pagebreak(weak: true) // Salto de página
counter(page).update(1) // Reestablecer el contador de páginas
doc
}