diff --git a/README.md b/README.md index 7d0a665..33e299b 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/manifest.scm b/manifest.scm index 5df8109..dde433d 100644 --- a/manifest.scm +++ b/manifest.scm @@ -1,6 +1,7 @@ (add-to-load-path ".guix/modules") (use-modules (template-package) (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)) diff --git a/src/base/grid.typ b/src/base/grid.typ new file mode 100644 index 0000000..85bf9d2 --- /dev/null +++ b/src/base/grid.typ @@ -0,0 +1,4 @@ +#let base_grid(..items) = grid( + gutter: 2em, + ..items +) diff --git a/src/base/page.typ b/src/base/page.typ new file mode 100644 index 0000000..c3734b2 --- /dev/null +++ b/src/base/page.typ @@ -0,0 +1,13 @@ +#let base_page( + header: [], + body +) = page( + paper: "us-letter", + margin: ( + x: 1in, + y: 1in, + ), + header: header, + header-ascent: 0in, + body +) diff --git a/src/base/text.typ b/src/base/text.typ new file mode 100644 index 0000000..de15ba6 --- /dev/null +++ b/src/base/text.typ @@ -0,0 +1,6 @@ +#let base_text(body) = text( + font: "Liberation Serif", + size: 12pt, + weight: "regular", + body +) diff --git a/src/content.typ b/src/content.typ new file mode 100644 index 0000000..521104d --- /dev/null +++ b/src/content.typ @@ -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. diff --git a/src/document.typ b/src/document.typ index f1e87ac..f93e561 100644 --- a/src/document.typ +++ b/src/document.typ @@ -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, + ) +} diff --git a/src/page/essay.typ b/src/page/essay.typ new file mode 100644 index 0000000..524c869 --- /dev/null +++ b/src/page/essay.typ @@ -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), + ) + ) + ) +} diff --git a/src/page/essay/body.typ b/src/page/essay/body.typ new file mode 100644 index 0000000..8db2ff5 --- /dev/null +++ b/src/page/essay/body.typ @@ -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 +} diff --git a/src/page/essay/header.typ b/src/page/essay/header.typ new file mode 100644 index 0000000..e2b0839 --- /dev/null +++ b/src/page/essay/header.typ @@ -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) + ) + ) +} diff --git a/src/page/essay/header/content.typ b/src/page/essay/header/content.typ new file mode 100644 index 0000000..58fbbaf --- /dev/null +++ b/src/page/essay/header/content.typ @@ -0,0 +1,5 @@ +#let page_essay_header_content(author_name_last: "") = { + author_name_last + " " + counter(page).display() +} diff --git a/src/page/essay/heading.typ b/src/page/essay/heading.typ new file mode 100644 index 0000000..d66d014 --- /dev/null +++ b/src/page/essay/heading.typ @@ -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(), + ) +} diff --git a/src/page/essay/heading/author.typ b/src/page/essay/heading/author.typ new file mode 100644 index 0000000..89984c4 --- /dev/null +++ b/src/page/essay/heading/author.typ @@ -0,0 +1,10 @@ +#let page_essay_heading_author( + name: ( + first: "", + last: "", + ) +) = { + name.first + " " + name.last +} diff --git a/src/page/essay/heading/class.typ b/src/page/essay/heading/class.typ new file mode 100644 index 0000000..e1f01f5 --- /dev/null +++ b/src/page/essay/heading/class.typ @@ -0,0 +1 @@ +#let page_essay_heading_class(identifier: "") = text(identifier) diff --git a/src/page/essay/heading/date.typ b/src/page/essay/heading/date.typ new file mode 100644 index 0000000..05ab1c4 --- /dev/null +++ b/src/page/essay/heading/date.typ @@ -0,0 +1,3 @@ +#let page_essay_heading_date() = datetime.today().display( + "[day] [month repr:long] [year repr:full]" +) diff --git a/src/page/essay/heading/instructor.typ b/src/page/essay/heading/instructor.typ new file mode 100644 index 0000000..ac55b4f --- /dev/null +++ b/src/page/essay/heading/instructor.typ @@ -0,0 +1 @@ +#let page_essay_heading_instructor(name: "") = text(name) diff --git a/src/page/essay/title.typ b/src/page/essay/title.typ new file mode 100644 index 0000000..8c0bc3f --- /dev/null +++ b/src/page/essay/title.typ @@ -0,0 +1,10 @@ +#let page_essay_title(title: "") = { + import "../../base/text.typ": base_text + + align( + center, + heading( + base_text(title) + ) + ) +} diff --git a/src/properties.typ b/src/properties.typ new file mode 100644 index 0000000..0ed0f4a --- /dev/null +++ b/src/properties.typ @@ -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", +)