diff --git a/packages/preview/tfguf/0.0.5/LICENSE b/packages/preview/tfguf/0.0.5/LICENSE new file mode 100644 index 0000000000..f19aaa6d09 --- /dev/null +++ b/packages/preview/tfguf/0.0.5/LICENSE @@ -0,0 +1,14 @@ +MIT No Attribution + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/preview/tfguf/0.0.5/README.md b/packages/preview/tfguf/0.0.5/README.md new file mode 100644 index 0000000000..e1731dbe2a --- /dev/null +++ b/packages/preview/tfguf/0.0.5/README.md @@ -0,0 +1,97 @@ + +# TFG UNIR Física +Esta plantilla sirve para preparar trabajos de fin de grado del [grado en Física](https://bit.ly/unirfisica) de la Universidad Internacional de La Rioja ([UNIR](https://unir.net)). + +![Lema del grado en Física de UNIR](https://p.ipic.vip/vbt7pt.jpg) + +## Contexto + +Esta plantilla está pensada para estudiantes del [Grado en Física de UNIR](https://bit.ly/unirfisica). Está mantenida por Alberto Corbi (UNIR). + +Otros TFG relacionados: + +- [TFG de Kenia Aranda](https://tinyurl.com/tfgkeniaaranda) +- [TFG de Abel Río](https://tinyurl.com/tfgabelrio) +- [TFG de Patricia Urquía](https://tinyurl.com/tfgurquia) +- [TFG grupal de Alberto Calatayud y Jorge Martínez](https://typst.app/project/r2Mhv06ZsN9dO2VxPB5BR3) +- [TFG de Luis Fernando (PER 10372)](https://typst.app/project/rZ9FnjxyF0P1u3pIQkNoZ6) + +## Inicio rápido +Importa el paquete y aplica la regla `show` principal: + +```typst +#import "@local/tfguf:0.0.5": * + +#show: unirfisica.with( + titulo: "Mi trabajo de fin de grado", + alumno: "Nombre del estudiante", + director: "Nombre del director", + resumen: [Resumen del trabajo en castellano.], + abstract: [English abstract of the thesis.], + pclave: ("física", "simulación", "datos"), + kwords: ("physics", "simulation", "data"), +) +``` + +Si no tienes la **familia tipográfica Calibri**, puedes descargarla desde [aquí](https://www.rmtweb.co.uk/calibri-and-cambria-fonts-for-mac). Después, sube los archivos `Calibri*.ttf` al directorio de tu proyecto. + +## Datos del TFG + +La plantilla acepta uno o varios autores y directores. Usa una cadena de texto para una sola persona o un array para varias. + +```typst +#show: unirfisica.with( + titulo: "Dinámica de un oscilador cuántico acoplado", + alumno: ("Ana García", "Luis Pérez"), + director: ("Dra. Marta López", "Dr. Javier Ruiz"), + resumen: [ + Este trabajo estudia la evolución temporal de un oscilador cuántico + acoplado mediante métodos numéricos. + ], + abstract: [ + This thesis studies the time evolution of a coupled quantum oscillator + using numerical methods. + ], + pclave: ("mecánica cuántica", "oscilador", "simulación numérica"), + kwords: ("quantum mechanics", "oscillator", "numerical simulation"), +) +``` + +## Figuras + +Usa la función `figure` de Typst y la función auxiliar `caption` de la plantilla. El primer argumento de `caption` es el título que se muestra sobre la figura; el segundo argumento opcional es la fuente que se muestra debajo. + +```typst +#figure( + image("figuras/espectro.png", width: 80%), + caption: caption[ + Espectro de emisión de la muestra analizada. + ][ + Elaboración propia. + ], +) + +Como se observa en la @fig:espectro, ... +``` + +El mismo patrón sirve para tablas: + +```typst +#figure( + table( + columns: 3, + table.header[Magnitud][Valor][Unidad], + [$E$], [1.2], [eV], + [$T$], [300], [K], + ), + caption: caption[ + Parámetros físicos usados en la simulación. + ][ + Elaboración propia. + ], +) +``` + +

+ Logo de UNIR +

diff --git a/packages/preview/tfguf/0.0.5/portada.png b/packages/preview/tfguf/0.0.5/portada.png new file mode 100644 index 0000000000..5325cef11e Binary files /dev/null and b/packages/preview/tfguf/0.0.5/portada.png differ diff --git a/packages/preview/tfguf/0.0.5/template/bibliografia.bib b/packages/preview/tfguf/0.0.5/template/bibliografia.bib new file mode 100644 index 0000000000..5e98ddf96d --- /dev/null +++ b/packages/preview/tfguf/0.0.5/template/bibliografia.bib @@ -0,0 +1,246 @@ +%% This BibTeX bibliography file was created using BibDesk. +%% https://bibdesk.sourceforge.io/ + +%% Created for Alberto Corbi Bellot at 2024-03-20 18:04:53 +0100 + + +%% Saved with string encoding Unicode (UTF-8) + + +@comment{jabref-meta: databaseType:bibtex;} + + + +@article{org, + author = {Schulte, Eric and Davison, Dan}, + date-added = {2024-03-11 10:00:15 +0100}, + date-modified = {2024-03-11 10:01:04 +0100}, + journal = {Computing in Science \& Engineering}, + number = {3}, + pages = {66--73}, + publisher = {Citeseer}, + title = {{Active documents with Org Mode}}, + volume = {13}, + year = {2011}} + +@article{docker, + author = {Boettiger, Carl}, + date-added = {2024-03-11 09:53:32 +0100}, + date-modified = {2024-03-11 10:45:22 +0100}, + journal = {ACM SIGOPS Operating Systems Review}, + number = {1}, + pages = {71--79}, + publisher = {ACM New York, NY, USA}, + title = {{An introduction to Docker for reproducible research}}, + volume = {49}, + year = {2015}} + +@article{rust, + author = {Matsakis, Nicholas D and Klock, Felix S}, + date-added = {2024-03-08 12:10:22 +0100}, + date-modified = {2024-03-08 12:10:41 +0100}, + journal = {ACM SIGAda Ada Letters}, + number = {3}, + pages = {103--104}, + publisher = {ACM New York, NY, USA}, + title = {{The Rust language}}, + volume = {34}, + year = {2014}} + +@book{make, + author = {Mecklenburg, Robert}, + date-added = {2024-03-07 18:41:30 +0100}, + date-modified = {2024-03-11 10:44:47 +0100}, + publisher = {O'Reilly Media, Inc.}, + title = {{Managing Projects with GNU Make}}, + year = {2004}} + +@book{javascript, + author = {Brooks, David R}, + date-added = {2024-02-09 10:44:01 +0100}, + date-modified = {2024-02-09 10:44:08 +0100}, + publisher = {Springer Science \& Business Media}, + title = {an Introduction to HTML and JavaScript: for Scientists and Engineers}, + year = {2007}} + +@book{wolfram, + author = {Wolfram, Stephen}, + date-added = {2024-02-09 10:41:58 +0100}, + date-modified = {2024-02-09 13:16:09 +0100}, + publisher = {Wolfram Research, Inc.}, + title = {{The Mathematica book}}, + volume = {1}, + year = {2003}} + +@article{xetex, + author = {Kew, Jonathan}, + date-added = {2024-02-08 12:17:00 +0100}, + date-modified = {2024-02-09 13:18:08 +0100}, + journal = {University of Utah}, + title = {{About XeTeX}}, + volume = {5}, + year = {2005}} + +@online{typst-bibliography, + author = {{Typst GmbH}}, + title = {Bibliography Function}, + url = {https://typst.app/docs/reference/model/bibliography/}, + date = {2026}, + urldate = {2026-06-11} +} + +@phdthesis{haug, + author = {Haug, Martin E}, + date-added = {2024-02-08 12:15:20 +0100}, + date-modified = {2024-02-09 13:14:25 +0100}, + school = {TU-Berlin}, + title = {Fast Typesetting with Incremental Compilation}, + year = {2022}} + +@phdthesis{madje, + author = {M{\"a}dje, Laurenz}, + date-added = {2024-02-08 12:14:49 +0100}, + date-modified = {2024-02-09 13:14:22 +0100}, + school = {TU-Berlin}, + title = {A Programmable Markup Language for Typesetting}, + year = {2022}} + +@article{pandoc, + author = {Mailund, Thomas}, + date-added = {2024-02-08 11:38:54 +0100}, + date-modified = {2024-02-09 13:15:49 +0100}, + journal = {Berkeley, CA: Apress}, + publisher = {Springer}, + title = {{Introducing Markdown and Pandoc}}, + volume = {1}, + year = {2019}} + +@article{observable, + author = {Jeffrey M. Perkel}, + date-added = {2024-02-08 11:35:57 +0100}, + date-modified = {2024-02-08 11:36:39 +0100}, + journal = {Nature}, + title = {Reactive, reproducible, collaborative: computational notebooks evolve}, + volume = {593}, + year = {2021}} + +@inproceedings{victor, + author = {Victor, Bret}, + booktitle = {Proceedings of the companion publication of the 2014 ACM SIGPLAN conference on Systems, Programming, and Applications: Software for Humanity}, + date-added = {2024-02-08 11:25:34 +0100}, + date-modified = {2024-02-08 11:25:38 +0100}, + pages = {5--5}, + title = {Humane representation of thought: a trail map for the 21st century}, + year = {2014}} + +@article{quarto, + author = {Mati, Sagiru and Civcir, Irfan and Abba, SI}, + date-added = {2024-02-08 11:20:53 +0100}, + date-modified = {2024-02-09 13:15:22 +0100}, + journal = {R Journal}, + number = {2}, + title = {{EviewsR: an R Package for Dynamic and Reproducible Research Using EViews, R, R Markdown and Quarto}}, + volume = {15}, + year = {2023}} + +@incollection{knitr, + author = {Xie, Yihui}, + booktitle = {Implementing reproducible research}, + date-added = {2024-02-08 11:18:50 +0100}, + date-modified = {2024-02-09 13:15:07 +0100}, + pages = {3--31}, + publisher = {Chapman and Hall/CRC}, + title = {{knitr: a comprehensive tool for reproducible research in R}}, + year = {2018}} + +@article{corbi, + author = {Corbi, Alberto and Burgos, Daniel and P{\'e}rez, Antonio Mar{\'\i}a}, + date-added = {2024-02-08 11:17:37 +0100}, + date-modified = {2024-02-08 11:17:40 +0100}, + journal = {IEEE Transactions on Learning Technologies}, + publisher = {IEEE}, + title = {Cloud-Operated Open Literate Educational Resources: the case of the MyBinder}, + year = {2023}} + +@article{scientific, + author = {Somers, James}, + date-added = {2024-02-08 11:16:19 +0100}, + date-modified = {2024-02-08 11:16:27 +0100}, + journal = {The Atlantic}, + title = {The scientific paper is obsolete}, + volume = {4}, + year = {2018}} + +@article{literate, + author = {Knuth, Donald Ervin}, + date-added = {2024-02-08 11:14:00 +0100}, + date-modified = {2024-02-09 13:16:27 +0100}, + journal = {The Computer journal}, + number = {2}, + pages = {97--111}, + publisher = {Oxford University Press}, + title = {Literate programming}, + volume = {27}, + year = {1984}} + +@book{texbook, + author = {Donald Knuth}, + date-added = {2024-02-07 12:32:51 +0100}, + date-modified = {2024-02-07 12:34:24 +0100}, + publisher = {Addison-Wesley Reading, MA}, + title = {{The TeXbook}}, + year = {1986}} + +@article{miner, + author = {Miner, Robert}, + date-modified = {2024-03-07 17:02:47 +0100}, + journal = {Notices of the AMS}, + number = {5}, + pages = {532--538}, + title = {{The importance of MathML to mathematics communication}}, + volume = {52}, + year = {2005}} + +@article{Ferreira, + author = {Ferreira, Helder and Freitas, Diamantino}, + journal = {XATA05}, + publisher = {Citeseer}, + title = {AudioMath: using MathML for speaking mathematics}, + year = {2005}} + +@inproceedings{mathjax, + author = {Cervone, Davide and Krautzberger, Peter and Sorge, Volker}, + booktitle = {Proceedings of the 13th International Web for All Conference}, + pages = {1--4}, + title = {{Towards universal rendering in MathJax}}, + year = {2016}} + +@article{mybinder, + author = {Beg, Marijan and Taka, Juliette and Kluyver, Thomas and Konovalov, Alexander and Ragan-Kelley, Min and Thi{\'e}ry, Nicolas M and Fangohr, Hans}, + journal = {Computing in Science \& Engineering}, + number = {2}, + pages = {36--46}, + publisher = {IEEE}, + title = {{Using Jupyter for reproducible scientific workflows}}, + volume = {23}, + year = {2021}} + +@inproceedings{octave, + author = {Z{\'u}{\~n}iga-L{\'o}pez, Arturo and Avil{\'e}s-Cruz, Carlos and Ferreyra-Ram{\'\i}rez, Andr{\'e}s and Rodr{\'\i}guez-Mart{\'\i}nez, Eduardo}, + booktitle = {Intelligent Computing: Proceedings of the 2020 Computing Conference, Volume 1}, + date-modified = {2024-03-11 10:43:41 +0100}, + organization = {Springer}, + pages = {774--784}, + title = {{Jupyter-notebook: a digital signal processing course enriched through the Octave Programming Language}}, + year = {2020}} + +@article{lyx, + author = {Quill, Ulrich}, + date-modified = {2024-03-20 18:04:53 +0100}, + journal = {Linux Journal}, + number = {57es}, + pages = {6--es}, + publisher = {Belltown Media Houston, TX}, + title = {{Introduction to LyX: Make working with LaTeX easier using the WYSIWYG editor LyX}}, + volume = {1999}, + year = {1999}} diff --git a/packages/preview/tfguf/0.0.5/template/tfg.typ b/packages/preview/tfguf/0.0.5/template/tfg.typ new file mode 100644 index 0000000000..b309a1f6c9 --- /dev/null +++ b/packages/preview/tfguf/0.0.5/template/tfg.typ @@ -0,0 +1,169 @@ + +#import "@preview/tfguf:0.0.5": * +//#import "../unirfisica.typ": * +#let longitud-abstract = 150 +#show: unirfisica.with( + titulo: "Mi trabajo de fin de grado", + alumno: ("Alumno 1", "Alumno 2", "Alumno 3"), + director: "Director 1 y Director 2", + agradecimientos: quote(attribution: "Yo", block: true)[_A mis padres_], + abstract: lorem(longitud-abstract), + resumen: lorem(longitud-abstract), + pclave: ("Una", "Dos", "Otra"), + kwords: ("Some", "Key", "Words"), +) + +// Esto es para que la aplicación web reconozca el texto como en español y haga mejor detección de sintaxis. +#set text(lang: "es") + +// Esto es el estilo de una tabla de ejemplo. +#show table.cell.where(y: 0): set text(weight: "bold") + += Introducción +#lorem(120).trim(".") @xetex . + +#figure( + [Contenido figura], + caption: caption[Un afigura sencilla con un elemento math llamado $ket(psi) = cos(theta\/2) ket(0) + e^(i phi) sin(theta\/2) ket(1)$ ][La he hecho yooo], +) + +La distancia que separa dos torres en un tendido eléctrico en una vía de tren es +de #qty(60, "m"). Obtén el tiempo que emplea una cabeza locomotora en recorrer +dicha distancia si su velocidad es de #qty(72, "kilo meter per hour"). Expresa +dicho tiempo en el Sistema Internacional. +$ + curl (grad f), tensor(T, -mu, +nu), pdv(f, x, y, [1,2]) , +$ + + +Como se puede derivar desde la @eq:tensor… + +$ + f(x, y) := cases( + 1 "if" (x dot y)/2 <= 0, + 2 "if" x "is even", + 3 "if" x in NN, + 4 "else", + ) +$ + += Estado del arte +El nombre de esta sección es opcional. #link("https://unir.net")[Aquí] tenemos un enlace y una nota al pie #footnote([Ejemplo de pie de página]). + += Material y métodos + += Resultados y discusión + +Como podemos ver en la @tabla:ejemplo… + +#figure( + table( + columns: 4, + stroke: none, + + table.header[Test Item][Specification][Test Result][Compliance], + [Voltage], [220V ± 5%], [218V], [Pass], + [Current], [5A ± 0.5A], [4.2A], [Fail], + ), + caption: caption[Hola imagen 3][https://typst.app], +) + +#lorem(10) + + +#figure( + kind: image, + rect( + height: 3cm, + [Los pies de figura o tabla deben de tener un punto final (de lo contrario no compila), ser de una única frase y para indicar la fuente tenéis que usar la notación de: `Título figura. Fuente: mi fuente.`. Las fuentes también pueden ser una referencia bibliográfica.], + ), + caption: caption[Hola.][una fuente], +) +#lorem(10) +#figure(kind: image, [Contenido imagen 2], caption: caption[Hola.][@docker]) +#import "@preview/mmdr:0.2.2": mermaid +#lorem(10) +#let mi-diagrama = mermaid("graph LR; A-->B;") +//#let mi-diagrama = rect(width: 35%, height: 30pt) + +#figure(kind: image, mi-diagrama, caption: caption[Hola.][una fuente]) +#figure(kind: image, mi-diagrama, caption: [Hola esto es una figura $1/2$ x.]) + + +#let cdu(name) = ([CDU], table.cell(fill: black, text(fill: white, name))) +#let spd(name) = ([SPD], table.cell(fill: red, text(fill: white, name))) +#let fdp(name) = ([FDP], table.cell(fill: yellow, name)) + +Veamos la @tab:datos + +#figure( + table( + columns: (auto, auto, 1fr), + stroke: (x: none), + + table.header[Tenure][Party][President], + [1949-1959], ..fdp[Theodor Heuss], + [1959-1969], ..cdu[Heinrich Lübke], + [1969-1974], ..spd[Gustav Heinemann], + [1974-1979], ..fdp[Walter Scheel], + [1979-1984], ..cdu[Karl Carstens], + [1984-1994], ..cdu[Richard von Weizsäcker], + [1994-1999], ..cdu[Roman Herzog], + [1999-2004], ..spd[Johannes Rau], + [2004-2010], ..cdu[Horst Köhler], + [2010-2012], ..cdu[Christian Wulff], + [2012-2017], [n/a], [Joachim Gauck], + [2017-], ..spd[Frank-Walter-Steinmeier], + ), + caption: caption[Probe results for design A.][fuente de los datos.], +) + +#lorem(10) + +#import "@preview/tablem:0.3.0": tablem, three-line-table + +#show table.cell: set par(leading: 0.3cm) +#figure( + three-line-table[ + | System | Category | Compilation model | Unicode support | Font handling | + | -------- | ------------------------------- | ----------------- | ---------------- | ------------------------ | + | TeX | Typesetting engine | DVI → PDF | Limited | METAFONT | + | pdfTeX | TeX engine | Direct PDF | Partial | Type1 / limited OpenType | + | XeTeX | TeX engine | Direct PDF | Full | OpenType / system fonts | + | LuaTeX | TeX engine | Direct PDF | Full | OpenType | + | LaTeX | Macro system | Engine-dependent | Engine-dependent | Engine-dependent | + | ConTeXt | TeX macro system | Engine-dependent | Full (LuaTeX) | OpenType | + | Typst | Markup typesetting system | Direct PDF | Full | Modern font system | + | Pandoc | Document converter | Multi-format | Full | Delegated to backend | + | Quarto | Scientific publishing framework | Multi-format | Full | Delegated to backend | + | LyX | Visual LaTeX editor | LaTeX backend | Engine-dependent | Engine-dependent | + | Overleaf | Collaborative platform | LaTeX backend | Engine-dependent | Engine-dependent | + | Typst | Markup typesetting system | Direct PDF | Full | Modern font system | + | Pandoc | Document converter | Multi-format | Full | Delegated to backend | + ], + caption: caption[Comparative overview of major scientific document composition systems.][Yo mismico.], +) + + + +== Una subsección + +#lorem(100) asdasdfdf + +#link("http://apple.com")[apple] + +#link("http://apple.com") apple + +== Otra subsección +#lorem(100) + += Conclusiones +Unas conclusiones que concuerdan con @typst-bibliography. + + +#bibliography("bibliografia.bib") + +#show: anejos + += Encuentas realizadas +Unas encuestas. diff --git a/packages/preview/tfguf/0.0.5/typst.toml b/packages/preview/tfguf/0.0.5/typst.toml new file mode 100644 index 0000000000..1e474046e7 --- /dev/null +++ b/packages/preview/tfguf/0.0.5/typst.toml @@ -0,0 +1,14 @@ +[package] +name = "tfguf" +version = "0.0.5" +entrypoint = "unirfisica.typ" +authors = ["Alberto Corbi (UNIR)"] +license = "MIT" +description = "Plantilla para hacer TFGs en el Grado en Física de UNIR" +repository = "https://github.com/pammacdotnet/TFGUF" +categories = ["thesis"] + +[template] +path = "template" +entrypoint = "tfg.typ" +thumbnail = "portada.png" diff --git a/packages/preview/tfguf/0.0.5/unir logo.svg b/packages/preview/tfguf/0.0.5/unir logo.svg new file mode 100644 index 0000000000..7e3510b65a --- /dev/null +++ b/packages/preview/tfguf/0.0.5/unir logo.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/tfguf/0.0.5/unirfisica.typ b/packages/preview/tfguf/0.0.5/unirfisica.typ new file mode 100644 index 0000000000..46508820a1 --- /dev/null +++ b/packages/preview/tfguf/0.0.5/unirfisica.typ @@ -0,0 +1,281 @@ +#import "@preview/unify:0.8.1": num, numrange, qty, qtyrange +#import "@preview/physica:0.9.8": * +#import "@preview/t4t:0.4.3": get, is-arr, is-func, is-str +#set text(lang: "es") +#let longitud-abstract = 150 +#let longitud-abstract-caracteres = 1100 + + +// Adds period at the end if not already present. +#let plain-text(body) = get.text(get.text(body)) +#let with-period(body) = { + let body-text = plain-text(body).trim() + body + if body-text.ends-with(".") { [] } else [.] +} + +#let caption-emph(body) = { + let sequence = [].func() + if type(body) == content and body.func() == math.equation { + show math.op: it => math.upright(plain-text(it.text)) + body + } else if type(body) == content and body.func() == sequence { + for child in body.children { + caption-emph(child) + } + } else { + text(style: "italic", body) + } +} + +// Reimplements `figure` caption with custom styling. +#let new-caption(it, body) = block({ + strong(it.supplement) + if it.numbering != none { [~] + it.counter.display(it.numbering) } + it.separator + caption-emph(body) +}) + +// Returns (caption data, true), or (`otherwise` content, false). +#let get-caption-data(it, otherwise) = { + let sequence = [].func() + if type(otherwise) != function { otherwise = it => otherwise } + if it.body.func() != sequence or it.body.children.len() == 0 { + return (otherwise(it), false) + } + let data = it.body.children.last() + if data.func() != metadata { return (otherwise(it), false) } + return (data.value, true) +} + +// `figure` caption with optional `source` argument. +#let caption(description, ..source) = { + if source.pos().len() == 0 { return description } + source = source.pos().first() + source = [Fuente: #source] + description + [ ] + metadata(( + description: with-period(description), + source: with-period(source), + )) +} +#let azulunir = rgb("#0098cd") +#let anejos(body) = { + pagebreak() + set heading(numbering: "A.1", supplement: [Anejo]) + counter(heading).update(0) + show heading: it => { + assert.eq(it.level, 1, message: "Un anejo no debe tener estructura!") + v(20%) + set text(azulunir, weight: "light", size: 20pt) + [#it.supplement #counter(heading).display():] + h(0.3em) + it.body + linebreak() + } + body +} + +#let unirfisica( + titulo: "Título de mi TFG", + alumno: "Mi nombre", + director: "Nombre de mi director", + resumen: lorem(longitud-abstract), + abstract: lorem(longitud-abstract), + pclave: lorem(6).replace(" ", ", ").replace(",,", ","), + kwords: lorem(6).replace(" ", ", ").replace(",,", ","), + logo: image("unir logo.svg", width: 60%), + agradecimientos: quote(attribution: [Plato], block: true)[#lorem(20)], + doc, +) = { + assert(get.text(resumen).len() <= longitud-abstract-caracteres, message: "Resumen demasiado largo!") + assert(get.text(abstract).len() <= longitud-abstract-caracteres, message: "Abstract demasiado largo!") + assert(get.text(titulo).len() > 0, message: "Falt el título del TFG!") + if is-arr(alumno) { alumno = alumno.join(", ").rev().replace(" ,", " y ", count: 1).rev() } + if is-arr(director) { director = director.join(", ").rev().replace(" ,", " y ", count: 1).rev() } + assert(get.text(alumno).len() > 0, message: "Falta tu nombre!") + assert(get.text(director).len() > 0, message: "Falta el director!") + + if is-arr(pclave) { pclave = pclave.join(", ") + "." } + if is-arr(kwords) { kwords = kwords.join(", ") + "." } + + set page( + paper: "a4", + margin: (left: 3cm, right: 2cm), + footer: none, + ) + set text(font: "calibri", size: 12.5pt, lang: "es") + set par(linebreaks: "optimized", justify: true, spacing: 1.8em, leading: 1.2em) + + + show link: it => { + if not (it.body.text.contains(it.dest)) { + text(fill: azulunir, underline(it)) + } else { text(fill: azulunir, font: "IBM Plex Mono", size: 10pt, underline(it), tracking: -.4pt) } + } + + /* + * Estilo de los captions de las figuras/tablas flotantes + */ + show table.cell: set par(leading: 0.2cm) + show figure: set figure(placement: none) + show figure: set figure.caption(separator: ". ") + show figure: set figure(gap: 1em) + show figure.where(kind: table): set block(breakable: true) + show figure: it => { + let sequence = [].func() + { + set block(below: it.gap, sticky: true) + show figure.caption: set align(left) + show figure.caption: it => { + let (result, ok) = get-caption-data.with(it)( + it => new-caption(it, with-period(it.body)), + ) + if not ok { return result } + new-caption(it, result.description) + } + it.caption + } + show figure.caption: set text(black.lighten(30%)) + show figure.caption: it => { + let (result, ok) = get-caption-data(it, none) + if not ok { return result } + set par(leading: 0.2cm) + block(result.source) + } + it + } + + set math.equation(numbering: "(1)") + + show math.equation.where(block: true): it => { + show regex("\.$"): $thin #text(font: "Calibri")[.]$ + show regex(",$"): $thin #text(font: "Calibri")[,]$ + it + } + + + show math.equation: it => { + set text(font: "Fira Math", size: 11.25pt) + show regex("\d"): digit => text(font: "Calibri", size: 12pt, digit) + it + } + + + let sequence = [].func() + let space = [ ].func() + let styled = text(red)[].func() + let symbol-func = $.$.body.func() + let context-func = (context {}).func() + + + /* + Estilo de los títulos de cabecera de nivel 1 (sección ) + */ + set heading(numbering: "1.") + + show heading.where(level: 1): it => { + pagebreak() + v(20%) + set text(azulunir, weight: "light", size: 20pt) + it + } + show heading.where(level: 2): set text(azulunir, weight: "light", size: 15pt) + show heading.where(level: 3): it => { + set text(weight: "light", style: "normal", size: 12.5pt) + it + v(.3cm) + } + show heading: it => { + if it.level > 3 { panic("No se permiten títulos de sección de 4o nivel!") } + set block(above: 3em, below: 1em, sticky: true) + set par(leading: 0.6em) + assert(get.text(it).ends-with(regex("[^\.]")), message: "Los títulos de sección no deben acabar en punto!") + it + } + + /* + Definición de la portada + */ + + align(center)[ + #logo + + #text(font: "calibri", size: 24pt)[Universidad Internacional de La Rioja (UNIR) + ] + + #v(-10pt) + #text(font: "calibri", size: 20pt)[Escuela Superior de Ingeniería y Tecnología] + + /* + Nombre del estudio y título del trabajo + */ + #align(center + horizon)[ + #text(size: 18pt)[Grado en Física] + #v(-10pt) + #text(size: 26pt, fill: azulunir, weight: "bold")[#titulo] + ] + + #let fecha = datetime.today() + + /* + Tabla inferior con los datos del TFG + */ + #align(center + bottom)[ + #set table.cell(align: horizon) + #table( + columns: (1fr, 1fr), + stroke: 0.1pt, + align: left, + table.header[Trabajo de fin de estudio presentado por: ][#alumno], + [Director/a/es:], [#director], + [Fecha:], [#fecha.display()], + ) + ] + ] + + if (agradecimientos != none) { + if ( + agradecimientos.func() == quote and agradecimientos.has("attribution") and agradecimientos.attribution == [Plato] + ) [] else [ + #pagebreak() + #align(center + horizon, text(size: 18pt, [#agradecimientos])) + ] + } + + pagebreak() + + align(top)[ + #text(fill: azulunir, size: 18pt, weight: "regular", font: "calibri")[Resumen] + #linebreak() + #resumen #linebreak() + #text(weight: "bold")[Palabras clave:] + #pclave + ] + align(bottom)[ + #text(fill: azulunir, size: 18pt)[Abstract] + #linebreak() + #abstract #linebreak() + #text(weight: "bold")[Keywords]: + #kwords + ] + + + outline(title: "Índice de contenidos") + set page( + footer: context [ + #set align(right) + #text(13pt, fill: gray.darken(30%))[#counter(page).display()] + ], + header: [ + #set text(size: 10pt, weight: "extralight", fill: gray.darken(30%)) + #align(right)[ + #alumno + #v(-1.2em) + #titulo + ] + ], + ) + counter(page).update(1) + doc +}