1
0
Fork 0

Add MLA header, heading, and body

Ethan Reece 2024-09-26 16:24:03 -05:00
parent 3acd7087c9
commit 4473f9b84f
Signed by: me
GPG Key ID: 198E9EB433DB1B28
18 changed files with 181 additions and 5 deletions

View File

@ -1,6 +1,8 @@
# Guix Typst project template # Guix Typst MLA project template
1. Modify `./guix/modules/template-package.scm` (defines the project), `./channels.scm` (for project dependencies), and `./manifest.scm` (for development environment) to your requirements. Notice: Uses *Liberation Serif*, a free font compatible with *Times New Roman*.
1. Modify `./src/properties.typ` for the heading and related components and `./src/content.typ` for the body.
1. Install `just` by adding to your Guix Home configuration or running `guix install just`. 1. Install `just` by adding to your Guix Home configuration or running `guix install just`.

View File

@ -1,6 +1,7 @@
(add-to-load-path ".guix/modules") (add-to-load-path ".guix/modules")
(use-modules (template-package) (use-modules (template-package)
(saayix packages typst) (saayix packages typst)
(gnu packages fontutils)) (gnu packages fontutils)
(gnu packages fonts))
(packages->manifest (list typst fontconfig coreutils)) (packages->manifest (list typst font-liberation fontconfig coreutils))

View File

@ -0,0 +1,4 @@
#let base_grid(..items) = grid(
gutter: 2em,
..items
)

13
src/base/page.typ 100644
View File

@ -0,0 +1,13 @@
#let base_page(
header: [],
body
) = page(
paper: "us-letter",
margin: (
x: 1in,
y: 1in,
),
header: header,
header-ascent: 0in, // -8pt,
body
)

View File

@ -0,0 +1,6 @@
#let base_text(body) = text(
font: "Liberation Serif",
size: 12pt,
weight: "regular",
body
)

21
src/content.typ 100644
View File

@ -0,0 +1,21 @@
#{ "" }
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce congue elit ac rhoncus interdum. Morbi faucibus eros vitae suscipit pellentesque. Nam sit amet pharetra est, sed mattis magna. Aliquam sodales magna non auctor scelerisque. Donec ultricies ut magna vitae posuere. Aenean pellentesque ligula tortor, ac facilisis nibh accumsan ut. Quisque ullamcorper velit non dui varius, in tempor metus mattis. Sed in neque risus. Nullam pulvinar dolor eleifend ligula elementum mattis. Fusce nec metus id orci fermentum consectetur. Morbi placerat, urna nec posuere iaculis, nibh nisl consequat odio, nec commodo magna lacus vitae ante. Mauris ut pretium dui. Phasellus lacinia justo eu diam rutrum porttitor.
Nullam et tellus nec lorem interdum luctus. Phasellus id purus a massa bibendum gravida vel ac lorem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vivamus metus tortor, congue eget dui non, pretium tempus arcu. Aliquam nulla diam, fermentum non finibus at, eleifend non orci. Aliquam enim lectus, laoreet nec euismod vel, bibendum non dui. Cras fermentum imperdiet dolor a eleifend. Nulla faucibus, nulla in feugiat dignissim, felis elit malesuada nisl, et interdum augue augue quis lorem. Nulla sagittis scelerisque tristique. Sed id euismod lectus. Etiam efficitur bibendum eros ut tempor. Sed lacinia elit lacus, molestie tempor risus euismod eu. Sed eu ullamcorper elit. Fusce iaculis, massa non ullamcorper hendrerit, dolor magna blandit eros, et rutrum lectus felis eget enim.
Cras a felis non arcu varius aliquam. Donec in orci risus. Nulla sit amet eros quis metus sollicitudin consectetur. Aliquam sagittis metus at odio imperdiet, tincidunt accumsan dui accumsan. Nunc at sem tempor, imperdiet risus at, placerat elit. Vestibulum neque metus, placerat ut lectus posuere, cursus ullamcorper nisi. Quisque eu pulvinar nibh. Cras non mauris nec urna congue tempus. Curabitur varius urna nisi, non finibus tellus laoreet eget.
Vestibulum consequat faucibus nisl ut condimentum. Integer convallis turpis a sollicitudin finibus. Aenean at ligula quis diam ullamcorper eleifend. Curabitur gravida faucibus nisl in sagittis. Pellentesque fermentum at enim sed dictum. Maecenas at risus sed lacus facilisis commodo. Vestibulum id erat gravida, volutpat urna a, gravida enim.
Pellentesque semper pretium odio nec vehicula. Praesent sed mi non odio vestibulum consequat sit amet et purus. Pellentesque efficitur turpis congue arcu euismod, lobortis ornare risus mollis. Curabitur vel suscipit leo. Sed pharetra, libero et eleifend tempor, ipsum enim pellentesque mauris, sit amet placerat lacus mi eget ligula. Donec id eros nec dui mattis feugiat malesuada et nulla. Donec posuere felis vitae faucibus luctus. Vivamus sed fringilla velit, sed laoreet nisl. Praesent a ex ante. Suspendisse cursus dolor at auctor convallis. Curabitur at nunc nunc.
Sed ullamcorper vel massa ac varius. Aenean est sapien, porttitor et ligula sed, laoreet mattis massa. Cras non ex non justo laoreet venenatis. Proin elementum quis lacus in molestie. Sed sit amet ornare mauris. Morbi accumsan sollicitudin lobortis. Pellentesque et odio vel lectus fermentum vestibulum in nec sapien. Duis ut urna aliquam, consequat velit non, iaculis erat. Aenean consequat rhoncus enim, at efficitur lectus volutpat non. Aenean eu augue non risus sagittis interdum a sit amet nisl. Mauris ex sapien, venenatis sit amet euismod sed, faucibus nec tortor. Vivamus tincidunt sagittis diam, rutrum convallis velit maximus et.
Quisque sed est at justo scelerisque vehicula quis at mi. Mauris tincidunt euismod consequat. Donec sit amet nibh eu dolor vulputate convallis at quis sapien. Donec ipsum tortor, ullamcorper mollis ligula sed, auctor molestie nisi. Proin congue, enim consectetur sagittis condimentum, nibh nunc congue erat, ut volutpat tortor nisi luctus quam. Nunc id leo vel odio sagittis dapibus. Duis imperdiet molestie ligula vitae ornare. Phasellus pharetra felis nunc, vitae aliquam metus feugiat sit amet. Curabitur non pulvinar elit, et vulputate massa. Maecenas lacinia nunc sem, sed hendrerit est dignissim id. Duis in aliquet est. Etiam at turpis augue. Fusce rutrum augue vitae tortor feugiat consequat. Nulla condimentum tempus est non blandit. Nullam dignissim commodo turpis ac volutpat.
In auctor pellentesque dapibus. Quisque scelerisque leo pretium finibus sagittis. Aliquam tincidunt augue a ornare pretium. Etiam maximus ornare purus, non pharetra felis ullamcorper in. Nulla id ornare nisi, ut semper lacus. Vivamus malesuada pellentesque sem vel venenatis. Vivamus sit amet accumsan erat, non porttitor elit. Mauris pellentesque erat vitae velit vehicula tincidunt. Pellentesque ac ornare eros.
Suspendisse id diam aliquam, volutpat velit sit amet, aliquam neque. Praesent aliquam nunc in pretium pulvinar. Aenean vitae nisl id erat fringilla scelerisque. Nullam tempor, elit et tristique mollis, risus massa tincidunt augue, sit amet lobortis mi turpis et orci. Sed euismod sed est eu tempor. In rutrum dictum sagittis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Praesent dui massa, faucibus placerat mattis vel, mollis quis sem. Pellentesque faucibus ante non quam varius iaculis. Nam lobortis accumsan maximus. Ut gravida molestie sodales.
Phasellus non hendrerit quam. Morbi ac mauris ipsum. Curabitur aliquam dui in leo pellentesque, quis vestibulum turpis cursus. Phasellus ornare lacus dignissim laoreet mattis. Nullam accumsan, sapien id accumsan dapibus, lacus ligula sagittis est, vel eleifend ligula ante id urna. Proin rhoncus aliquet quam, quis fermentum neque eleifend a. Nunc dapibus sollicitudin tempus. Cras feugiat est odio, vitae cursus quam scelerisque eu. Aliquam scelerisque ultrices pellentesque. Phasellus nibh ex, accumsan et egestas cursus, ultrices at lorem. Etiam finibus rutrum sapien sit amet aliquam. Ut pretium nisl pulvinar lectus eleifend, efficitur commodo lacus sollicitudin. Praesent a ligula sit amet nulla malesuada convallis eget sed odio. Integer arcu arcu, scelerisque a nibh a, faucibus molestie arcu. Etiam pulvinar arcu et erat fermentum, sit amet molestie leo finibus. Aliquam lacus ex, iaculis eu libero fringilla, varius rhoncus arcu.

View File

@ -1 +1,16 @@
This document is located in `src/document.typ`. #{
import "properties.typ": properties
import "page/essay.typ": page_essay
let content = include "content.typ"
set document(
title: properties.title,
author: properties.author_name.first + " " + properties.author_name.last,
)
page_essay(
..properties,
content,
)
}

33
src/page/essay.typ 100644
View File

@ -0,0 +1,33 @@
#let page_essay(
title: "",
author_name: (
first: "",
last: "",
),
instructor_name: "",
class: "",
content
) = {
import "../base/text.typ": base_text
import "../base/page.typ": base_page
import "../base/grid.typ": base_grid
import "essay/header.typ": page_essay_header
import "essay/heading.typ": page_essay_heading
import "essay/title.typ": page_essay_title
import "essay/body.typ": page_essay_body
base_text(
base_page(
header: page_essay_header(author_name_last: author_name.last),
base_grid(
page_essay_heading(
author_name: author_name,
instructor_name: instructor_name,
class: class,
),
page_essay_title(title: title),
page_essay_body(content),
)
)
)
}

View File

@ -0,0 +1,9 @@
#let page_essay_body(content) = {
set par(
leading: 2em,
first-line-indent: 0.5in,
)
show par: set block(spacing: 2em)
content
}

View File

@ -0,0 +1,12 @@
#let page_essay_header(author_name_last: "") = {
import "header/content.typ": page_essay_header_content
block(
width: 100%,
height: 0.5in,
align(
right + top,
page_essay_header_content(author_name_last: author_name_last)
)
)
}

View File

@ -0,0 +1,5 @@
#let page_essay_header_content(author_name_last: "") = {
author_name_last
" "
counter(page).display()
}

View File

@ -0,0 +1,21 @@
#let page_essay_heading(
author_name: (
first: "",
last: "",
),
instructor_name: "",
class: "",
) = {
import "../../base/grid.typ": base_grid
import "heading/author.typ": page_essay_heading_author
import "heading/instructor.typ": page_essay_heading_instructor
import "heading/class.typ": page_essay_heading_class
import "heading/date.typ": page_essay_heading_date
base_grid(
page_essay_heading_author(name: author_name),
page_essay_heading_instructor(name: instructor_name),
page_essay_heading_class(identifier: class),
page_essay_heading_date(),
)
}

View File

@ -0,0 +1,10 @@
#let page_essay_heading_author(
name: (
first: "",
last: "",
)
) = {
name.first
" "
name.last
}

View File

@ -0,0 +1 @@
#let page_essay_heading_class(identifier: "") = text(identifier)

View File

@ -0,0 +1,3 @@
#let page_essay_heading_date() = datetime.today().display(
"[day] [month repr:long] [year repr:full]"
)

View File

@ -0,0 +1 @@
#let page_essay_heading_instructor(name: "") = text(name)

View File

@ -0,0 +1,10 @@
#let page_essay_title(title: "") = {
import "../../base/text.typ": base_text
align(
center,
heading(
base_text(title)
)
)
}

View File

@ -0,0 +1,9 @@
#let properties = (
title: "Guix Typst MLA Template",
author_name: (
first: "John",
last: "Doe",
),
instructor_name: "Professor Jane Doe",
class: "CS XXXX.XXX",
)