diff --git a/packages/preview/barcala/0.1.5/LICENSE b/packages/preview/barcala/0.1.5/LICENSE new file mode 100644 index 0000000000..d0c4b03918 --- /dev/null +++ b/packages/preview/barcala/0.1.5/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Juan Martín Seery + +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, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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/barcala/0.1.5/README.md b/packages/preview/barcala/0.1.5/README.md new file mode 100644 index 0000000000..ac97de4f85 --- /dev/null +++ b/packages/preview/barcala/0.1.5/README.md @@ -0,0 +1,112 @@ +# barcala + +![](https://img.shields.io/badge/Typst-0.13.1-blue?style=flat-square&logo=typst&logoColor=white&labelColor=239DAD&color=555555) + + +A report template for UNLP students, specially for engineering. Not affiliated with the university. + +--- + +Plantilla de informe para estudiantes de la Universidad Nacional de La Plata, especialmente para ingeniería. No está afiliada a la universidad. + +

+ Documento de ejemplo, página 1 +        + Documento de ejemplo, página 2 +

+ +## Uso + +```typst +#import "@preview/barcala:0.1.5": informe + +#show: informe.with( + // parámetros del informe +) +``` + +- `institucion`: el logo de la institución del informe. + - `"unlp"`: Universidad Nacional de La Plata (por defecto) + - Si se desea usar un logo diferente, se puede pasar un `image("logo.png")` o cualquier otro contenido. Si el logo es muy grande, se puede cambiar su tamaño como `image("logo.png", height: 80%)`. +- `unidad-academica`: el logo de la unidad académica del informe. Opciones: + - `"informática"`: Facultad de Informática + - `"ingeniería"`: Facultad de Ingeniería + - Si se desea usar un logo diferente, se puede pasar un `image("logo.png")` o cualquier otro contenido. Si el logo es muy grande, se puede cambiar su tamaño como `image("logo.png", height: 80%)`. + - Si la unidad académica de la UNLP no está en la lista, [creá un reporte](https://github.com/JuanM04/barcala/issues/new) con el link al logo y lo agregamos a la plantilla. +- `asignatura`: el nombre de la asignatura (`str`). +- `titulo` (`content`, opcional): el título más formal del informe, como `[Trabajo Práctico Nº 3]`. +- `equipo` (`content`): el nombre del equipo, como `[Grupo 12]`. +- `autores` (`array`): los autores y autoras del proyecto. Cada autor/a tiene + - `nombre` (`str`): el nombre del autor/a con el formato `Apellido, Nombre`; + - `email` (`str`, opcional): un email; + - `legajo` (`str`, opcional): un legajo; + - `notas` (`array` o `str`, opcional): otras notas, como `"Autor responsable del informe"`. +- `titulo-descriptivo` (`str`): el título del proyecto en sí, como `"Análisis de un sistema fluvial"`. +- `resumen` (`content`, opcional): un resumen del lo que trata el informe o el objetivo del proyecto. Es un campo libre para escribir con el formato que se desee. +- `fecha` (`date` o `str`): la fecha de entrega del informe, se puede escribir como `"2023-10-01"` (1 de octubre de 2023). +- `formato` (`dict`, opcional): otras configuraciones del informe: + - `tipografia` (`str`, opcional): la tipografía del informe, _New Computer Modern_ por defecto; + - `columnas` (`int`, opcional): la cantidad de columnas, una por defecto; + - `margenes` (opcional): pueden ser + - `"simétricos"`: los mismo márgenes de cada lado (por defecto), + - `"anillado"`: márgenes más anchos donde iría el anillado. + + +### Apéndices + +Para agregar apéndices al informe, se puede usar el comando `apendice` en el lugar empiezan los apéndices. Por ejemplo: + +```typst +#import "@preview/barcala:0.1.5": informe, apendice + +#show: informe.with( + // parámetros del informe +) + +// ... contenido del informe + +#show: apendice + += Tablas de datos // Apéndice A +// ... + += Otra información // Apéndice B +// ... +``` + +### Tabla de símbolos + +Para agregar una tabla de símbolos/nomenclatura al informe, se puede usar el comando `nomenclatura` en el lugar donde empieza la tabla. Por ejemplo: + +```typst +#import "@preview/barcala:0.1.5": informe, nomenclatura + +#show: informe.with( + // parámetros del informe +) + +#nomenclatura( + ($S_1$, [Símbolo 1]), + ($S_2$, [Símbolo 2]), + ($S_3$, [Símbolo 3]), +) +``` + +## Desarrollo + +Para generar el documento `main.pdf` y la imagen `thumbnails/1.png` de la portada, se debe cambiar + +```diff +- #import "@preview/barcala:0.1.5": ... ++ #import "../src/lib.typ": ... +``` + +y utilizar los siguientes comandos: + +```bash +# Genera PDF +typst compile --root . --pdf-standard a-2b template/main.typ +# Genera thumbnail.png +typst compile --root . --format png template/main.typ "thumbnails/{p}.png" +oxipng -o 2 --strip safe thumbnails/*.png +``` \ No newline at end of file diff --git "a/packages/preview/barcala/0.1.5/src/images/inform\303\241tica.png" "b/packages/preview/barcala/0.1.5/src/images/inform\303\241tica.png" new file mode 100644 index 0000000000..11a94ca45d Binary files /dev/null and "b/packages/preview/barcala/0.1.5/src/images/inform\303\241tica.png" differ diff --git "a/packages/preview/barcala/0.1.5/src/images/ingenier\303\255a.png" "b/packages/preview/barcala/0.1.5/src/images/ingenier\303\255a.png" new file mode 100644 index 0000000000..3356ac65c5 Binary files /dev/null and "b/packages/preview/barcala/0.1.5/src/images/ingenier\303\255a.png" differ diff --git a/packages/preview/barcala/0.1.5/src/images/unlp.svg b/packages/preview/barcala/0.1.5/src/images/unlp.svg new file mode 100644 index 0000000000..751aa8c6aa --- /dev/null +++ b/packages/preview/barcala/0.1.5/src/images/unlp.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/barcala/0.1.5/src/lib.typ b/packages/preview/barcala/0.1.5/src/lib.typ new file mode 100644 index 0000000000..c349464ae5 --- /dev/null +++ b/packages/preview/barcala/0.1.5/src/lib.typ @@ -0,0 +1,269 @@ +#let informe( + institucion: none, + unidad-academica: none, + asignatura: none, + titulo: none, + equipo: none, + autores: none, + titulo-descriptivo: none, + resumen: none, + fecha: datetime.today(), + formato: (:), + body, +) = { + // Validación de los parámetros de entrada + import "types.typ": parse-options + let opts = parse-options(( + institucion: institucion, + unidad-academica: unidad-academica, + asignatura: asignatura, + titulo: titulo, + equipo: equipo, + autores: autores, + titulo-descriptivo: titulo-descriptivo, + resumen: resumen, + fecha: fecha, + formato: formato, + )) + + // Algunas constantes + let margen-top = 2.5cm + let interlineado = 0.65em + let emails-numering = "1" // numeración de los emails en la carátula + let notas-numering = "*" // numeración de las notas en la carátula + + // Autores - notas y referencias + let emails = (:) // key: dirección de email, value: array de usuarios + let notas = () // notas de los autores + for a in opts.autores { + if a.email != none { + if a.email.domain in emails { + emails.at(a.email.domain).push(a.email.user) + } else { + emails.insert(a.email.domain, (a.email.user,)) + } + } + if a.notas.len() > 0 { + for n in a.notas { + if not notas.contains(n) { + notas.push(n) + } + } + } + } + + // Propiedades del documento .pdf + set document( + title: opts.titulo-descriptivo, + author: opts.autores.map(a => a.apellido + ", " + a.nombre), + ) + + // Setup general de las páginas + set page( + paper: "a4", + margin: ( + // "simétricos": igual margen en todas las páginas + // "anillado": mayor margen donde se encuaderna + inside: if opts.formato.margenes == "simétricos" { 1.75cm } else { 2.5cm }, + outside: 1.75cm, + top: margen-top, + bottom: 2cm, + ), + header: context { + // Header en todas las páginas menos la primera + if (counter(page).get().at(0) != 1) { + set text(size: 10pt) + stack( + dir: ltr, + stack( + dir: ttb, + spacing: interlineado, + strong(opts.asignatura), + if opts.titulo != none { + opts.titulo + } else { + opts.titulo-descriptivo + }, + ), + h(1fr), + { + set align(right) + stack( + dir: ttb, + spacing: interlineado, + [Año #opts.fecha.year()], + smallcaps(if opts.equipo != none { + opts.equipo + } else { + opts.autores.map(a => a.apellido).join(", ") + }), + ) + }, + ) + line(length: 100%, stroke: 0.5pt) + } + }, + footer: context { + // Footer en todas las páginas + set text(size: 10pt) + set align(center) + counter(page).display("1 / 1", both: true) + }, + ) + + // Formato del texto + set text(font: opts.formato.tipografia, size: 11pt, lang: "es", region: "AR") + set par( + justify: true, + linebreaks: "optimized", + first-line-indent: (amount: 0.75cm, all: true), + ) + + // Títulos y subtítulos + set heading(numbering: "1.1.") + show heading.where(level: 1): it => { + set text(size: 14pt, weight: "bold") + v(0.35cm) + it + v(0.3cm) + } + show heading.where(level: 2): set text(size: 12pt, weight: "bold") + show heading.where(level: 3): set text(size: 11pt, weight: "bold") + + // Figuras + set figure(numbering: "1", supplement: [Figura]) + show figure.where(kind: table): set figure(supplement: [Tabla]) + show figure.where(kind: raw): set figure(supplement: [Código]) + show figure.caption: set text(size: 10pt) + + // Otros + set bibliography(style: "institute-of-electrical-and-electronics-engineers") + + // Logos + let institucion-logo = if opts.institucion == "unlp" { + image("images/unlp.svg", height: 100%) + } else { + opts.institucion + } + let unidad-academica-logo = if opts.unidad-academica == "informática" { + image("images/informática.png", height: 100%) + } else if opts.unidad-academica == "ingeniería" { + image("images/ingeniería.png", height: 100%) + } else { + opts.unidad-academica + } + + // Carátula + align(center)[ + #set par(spacing: 0pt) + #v(-margen-top + 0.5cm) + #block( + height: 1.4cm, + stack( + dir: ltr, + spacing: 1fr, + align(horizon, unidad-academica-logo), + align(horizon, institucion-logo), + ), + ) + #v(1em) + #text(size: 14pt, smallcaps(opts.asignatura)) + #if opts.titulo != none { + v(1em) + text(size: 12pt, opts.titulo) + } + #v(1.5em) + #par( + leading: 0.4em, + text(weight: "bold", size: 17pt, opts.titulo-descriptivo), + ) + #v(1.5em) + #if opts.equipo != none [ + #set text(size: 12pt) + #underline(opts.equipo) \ + ] + #for a in opts.autores [ + #set text(size: 12pt) + #let refs = () + #if a.email != none { + refs.push( + numbering( + emails-numering, + emails.keys().position(it => it == a.email.domain) + 1, + ), + ) + } + #if a.notas.len() > 0 { + for n in a.notas { + refs.push( + numbering( + notas-numering, + notas.position(it => it == n) + 1, + ), + ) + } + } + #(a.apellido), #(a.nombre)#super(refs.join("")) + #if a.legajo != none { + text(size: 0.8em)[(#a.legajo)] + } \ + ] + #v(1em) + #text(size: 11pt, opts.fecha.display("[day]/[month]/[year]")) + #if emails.len() > 0 or notas.len() > 0 { + set text(size: 10pt) + v(2em) + for (i, (domain, users)) in emails.pairs().enumerate() [ + #let options = users.join(",") + #if users.len() > 1 { + options = "{" + options + "}" + } + #super(numbering(emails-numering, i + 1))#raw(options + "@" + domain) \ + ] + for (i, nota) in notas.enumerate() [ + #super(numbering(notas-numering, i + 1))#nota \ + ] + } + ] + if opts.resumen != none { + v(0.5cm) + text(size: 10pt, opts.resumen) + } + v(0.5cm) + line(length: 100%, stroke: 0.5pt) + v(0.5cm) + + // Contenido del informe + body +} + +// Comienzo del apéndice +#let apendice(body) = { + counter(heading).update(0) + set heading(numbering: "A.1.") + set text(size: 10pt) + body +} + + +// Nomenclatura / símbolos +#let nomenclatura(..pairs) = { + heading(level: 2, numbering: none)[Nomenclatura] + pad(left: 3em)[ + #table( + align: (center, left), + columns: (auto, 1fr), + column-gutter: 1em, + inset: 5pt, + stroke: none, + ..pairs + .pos() + .map(sym => ( + [#sym.at(0)], + [#sym.at(1)], + )) + .flatten(), + ) + ] +} + diff --git a/packages/preview/barcala/0.1.5/src/types.typ b/packages/preview/barcala/0.1.5/src/types.typ new file mode 100644 index 0000000000..632aeaad9a --- /dev/null +++ b/packages/preview/barcala/0.1.5/src/types.typ @@ -0,0 +1,64 @@ +#import "@preview/valkyrie:0.2.2" as z + +#let autor-schema = z.dictionary( + ( + nombre: z.string( + assertions: ( + z.assert.matches( + regex("^[^,]+, [^,]+$"), + message: (self, it) => "El nombre debe tener el formato \"Apellido, Nombre\"", + ), + ), + ), + email: z.string( + optional: true, + assertions: ( + z.assert.matches( + regex("^[^@]+@[^@]+$"), // z.email() no acepta emails institucionales + message: (self, it) => "Email inválido", + ), + ), + post-transform: (self, it) => ( + user: it.split("@").at(0), + domain: it.split("@").at(1), + ), + ), + legajo: z.string(optional: true), + notas: z.array( + z.content(), + default: (), + pre-transform: z.coerce.array, + ), + ), + pre-transform: z.coerce.dictionary(it => (nombre: it)), + post-transform: (self, it) => ( + ..it, + nombre: it.nombre.split(", ").at(1), + apellido: it.nombre.split(", ").at(0), + ), +) + + +#let formato-schema = z.dictionary(( + tipografia: z.string(default: "New Computer Modern"), + margenes: z.choice(("simétricos", "anillado"), default: "simétricos"), +)) + +#let parse-options(options) = z.parse( + options, + z.dictionary(( + institucion: z.either(z.string(), z.content(), default: "unlp"), + unidad-academica: z.either(z.string(), z.content()), + asignatura: z.content(), + titulo: z.content(optional: true), + equipo: z.content(optional: true), + autores: z.array( + autor-schema, + pre-transform: z.coerce.array, + ), + titulo-descriptivo: z.string(), + resumen: z.content(optional: true), + fecha: z.date(pre-transform: z.coerce.date), + formato: formato-schema, + )), +) diff --git a/packages/preview/barcala/0.1.5/template/bibliografia.bib b/packages/preview/barcala/0.1.5/template/bibliografia.bib new file mode 100644 index 0000000000..84cf38b4e2 --- /dev/null +++ b/packages/preview/barcala/0.1.5/template/bibliografia.bib @@ -0,0 +1,24 @@ +@book{griffiths_electrodynamics_2017, + author = {David J. Griffiths}, + title = {Introduction to Electrodynamics}, + edition = {4th}, + publisher = {Pearson Education}, + year = {2017} +} + +@book{jackson_classical_1999, + author = {John David Jackson}, + title = {Classical Electrodynamics}, + edition = {3rd}, + publisher = {Wiley}, + year = {1999} +} + +@article{maxwell_dynamical_1865, + author = {James Clerk Maxwell}, + title = {A Dynamical Theory of the Electromagnetic Field}, + journal = {Philosophical Transactions of the Royal Society of London}, + volume = {155}, + pages = {459-512}, + year = {1865} +} diff --git a/packages/preview/barcala/0.1.5/template/main.typ b/packages/preview/barcala/0.1.5/template/main.typ new file mode 100644 index 0000000000..a845c8ad7d --- /dev/null +++ b/packages/preview/barcala/0.1.5/template/main.typ @@ -0,0 +1,123 @@ +#import "@preview/barcala:0.1.5": apendice, informe, nomenclatura +#import "@preview/lilaq:0.5.0" as lq // Paquete para gráficos, puede ser omitido +#import "@preview/physica:0.9.6": * // Paquete para matemática y física, puede ser omitido +#import "@preview/zero:0.5.0" // Paquete para números lindos y unidades de medida, puede ser omitido + +#show: informe.with( + unidad-academica: "ingeniería", + asignatura: "F0317 Física II", + titulo: "Informe de Laboratorio Nº 2", + equipo: "Grupo 3", + autores: ( + ( + nombre: "Kirchhoff, Gustav", + email: "gustav.kirchhoff@alu.ing.unlp.edu.ar", + legajo: "12345/6", + notas: "Autor responsable del informe", + ), + ( + nombre: "Maxwell, James C.", + email: "james.maxwll@alu.ing.unlp.edu.ar", + legajo: "12345/6", + ), + ( + nombre: "Faraday, Michael", + email: "mfaraday@alu.ing.unlp.edu.ar", + legajo: "12345/6", + ), + ), + + titulo-descriptivo: "Circuitos de corriente continua en estado transistorio", + resumen: [*_Objetivo_ --- determinación de las constantes de tiempo ($tau$) de carga y descarga de un circuito RC. Análisis de la dependencia de $tau$ en función de los valores de resistencia y capacidad que conforman el circuito.*], + + fecha: "2025-03-01", +) + +// Configuración de `zero` +#import zero: num, zi +#zero.set-num( + decimal-separator: ",", +) +#zero.set-group( + size: 3, + separator: ".", + threshold: (integer: 5, fractional: calc.inf), +) +#zero.set-unit( + fraction: "inline", +) + +// Bloques de matemática con números para citar +#set math.equation(numbering: "(1)") + +// Unidades +#let Vm = zi.declare("V/m") + +#nomenclatura( + ($q$, [Carga [#zi.coulomb()]]), + ($I$, [Corriente [#zi.ampere()]]), + ($U$, [Potencial eléctrico [#zi.volt()]]), + ($va(E)$, [Campo eléctrico [#Vm()]]), + ($va(B)$, [Campo magnético [#zi.tesla()]]), +) + += Introducción +Coloque aquí la introducción a su trabajo destacando el interés y los objetivos del mismo. + += Marco teórico +Si corresponde, describa aquí los fundamentos analíticos de su trabajo indicando las referencias consultadas para obtener la información en el formato adecuado. Por ejemplo, @griffiths_electrodynamics_2017, @jackson_classical_1999[p.~12], @maxwell_dynamical_1865. + +También se puede agregar ecuaciones matemáticas, como + +$ + integral.cont_(partial S) va(B) dot dd(va(l)) = mu_0 integral.double_S va(J) dot dd(va(A)). +$ + +Estas se pueden citar como @ley-de-ampere. Los números y unidades pueden ser escritos con `zero`. Un número se puede escribir como #num[12345.6789] y una unidad como #zi.volt() o #zi.newton(). Se pueden declar unidades personalizadas como #Vm() e incluso combinar con una magnitud como #zi.ohm[220]. + += Metodología +Si corresponde, describa aquí la metodología empleada para desarrollar su trabajo. Recuerde mencionar y detallar dentro del texto principal todas las tablas y figuras incluidas en el documento. + += Resultados +Utilice esta sección para presentar y analizar sus resultados. Incluya preferentemente gráficos vectoriales para garantizar la calidad de las imágenes. Recuerde mencionar y explicar el contenido de todas las figuras en el cuerpo principal del trabajo. + +#figure( + lq.diagram( + lq.boxplot( + (1, 3, 10), + stroke: luma(30%), + fill: yellow, + median: red, + ), + lq.boxplot( + (1.5, 3, 9), + x: 2, + whisker: blue, + cap: red, + cap-length: 0.7, + median: green, + ), + lq.boxplot( + lq.linspace(5.3, 6.2) + (2, 3, 7, 9.5), + x: 3, + outliers: "x", + ), + lq.boxplot( + lq.linspace(5.3, 6.2) + (2, 3, 7, 9.5), + x: 4, + outliers: none, + ), + ), + caption: [Boxplot genérico.], +) + += Conclusiones +Detalle aquí las conclusiones de su trabajo. + +// Sección de apéndices. Si no se usa, se puede comentar o borrar +#show: apendice + += Apéndice +Si corresponde, utilice uno o más apéndices para complementar la información del trabajo. + +#bibliography("bibliografia.bib") diff --git a/packages/preview/barcala/0.1.5/thumbnails/1.png b/packages/preview/barcala/0.1.5/thumbnails/1.png new file mode 100644 index 0000000000..75cf071027 Binary files /dev/null and b/packages/preview/barcala/0.1.5/thumbnails/1.png differ diff --git a/packages/preview/barcala/0.1.5/thumbnails/2.png b/packages/preview/barcala/0.1.5/thumbnails/2.png new file mode 100644 index 0000000000..4ca96224de Binary files /dev/null and b/packages/preview/barcala/0.1.5/thumbnails/2.png differ diff --git a/packages/preview/barcala/0.1.5/typst.toml b/packages/preview/barcala/0.1.5/typst.toml new file mode 100644 index 0000000000..03acabcedd --- /dev/null +++ b/packages/preview/barcala/0.1.5/typst.toml @@ -0,0 +1,18 @@ +[package] +name = "barcala" +version = "0.1.5" +compiler = "0.13.1" +authors = ["Juan Martín Seery "] +repository = "https://github.com/JuanM04/barcala" +license = "MIT" +description = "A report template for UNLP students, specially for engineering." +entrypoint = "src/lib.typ" +categories = ["report"] +disciplines = ["computer-science", "education", "engineering"] +keywords = ["report", "project", "informe", "proyecto", "ingenieria", "unlp"] +exclude = [".vscode", "template/main.pdf", "thumbnails", "CHANGELOG.md"] + +[template] +path = "template" +entrypoint = "main.typ" +thumbnail = "thumbnails/1.png"