Skip to content

talal/ilm

Repository files navigation

‘Ilm

‘Ilm (Urdu: عِلْم) is the Urdu term for knowledge. It is pronounced as /ə.ləm/.

A versatile, clean and minimal template for non-fiction writing. The template is ideal for class notes, reports, and books.

It contains a title page, a table of contents, and indices for different types of figures; images, tables, code blocks.

Dynamic running footer contains the title of the chapter (top-level heading).

See the example.pdf file to see how it looks.

Usage

You can use this template in the Typst web app by clicking "Start from template" on the dashboard and searching for ilm.

Alternatively, you can use the CLI to kick this project off using the command:

typst init @preview/ilm

Typst will create a new directory with all the files needed to get you started.

The template will initialize your package with a sample call to the ilm function in a show rule. If you, however, want to change an existing project to use this template, you can add a show rule like this at the top of your file:

#import "@preview/ilm:2.1.0": *

#set text(lang: "en")

#show: ilm.with(
  title: [Your Title],
  authors: "Max Mustermann",
  abstract: [#lorem(30)],
  bibliography: bibliography("refs.bib"),
  figure-index: (enabled: true),
  table-index: (enabled: true),
  listing-index: (enabled: true)
)

// Your content goes here.

This template uses the Iosevka font for raw text (inline code and code blocks). In order to use Iosevka, the font must be installed on your computer. In case Iosevka is not installed, as will be the case for Typst Web App, then the template will fall back to "DejaVu Sans Mono" font which is available on Typst Web App.

Configuration

The template exports the ilm function with several named arguments (read: options). This function also accepts a single, positional argument for the body.

The language setting for text (lang parameter of text function) should be defined before the ilm function so that headings such as table of contents and bibliography will be defined as per the text language. See example above.

Options

The list below shows a brief description for each option. For a detailed explanation of these options, see the example.pdf file.

  • cover-page
    type: string, content, or none
    default: "use-ilm-default"
    description: Cover page customization. Set to "use-ilm-default" for the default cover page, none to skip the cover page, or provide custom content to create your own cover page.

  • title
    type: content
    default: Your Title
    description: The title for your work.

  • authors
    type: string or [array]
    default: none
    description: The author(s) of your work. Can be a string for a single author or an array of strings for multiple authors. Multiple authors will be displayed on separate lines with font size automatically scaled.

  • paper-size
    type: string
    default: a4
    description: Specify a paper size string to change the page size.

  • date
    type: datetime or none
    default: datetime.today()
    description: The date that will be displayed on the cover page. Set to none to disable date.

  • date-format
    type: string
    default: [month repr:long] [day padding:zero], [year repr:full]
    description: The format for the date that will be displayed on the cover page. By default, the date will be displayed as MMMM DD, YYYY.

  • abstract
    type: content or none
    default: none
    description: A brief summary/description of your work. This is shown on the cover page. Set to none to disable.

  • preface
    type: content
    default: none
    description: The preface for your work. The preface content is shown on its own separate page after the cover.

  • chapter-pagebreak
    type: bool
    default: true
    description: Setting this to false will prevent chapters from starting on a new page.

  • external-link-circle
    type: bool
    default: true
    description: Setting this to false will disable the maroon circle that is shown next to external links.

  • footer
    type: string or none
    default: "page-number-alternate-with-chapter"
    description: Footer style for page numbering. Set to none to disable footer entirely. Available styles: "page-number-alternate-with-chapter" (alternating sides with chapter name), "page-number-left-with-chapter", "page-number-right-with-chapter", "page-number-center", "page-number-left", "page-number-right".

  • raw-text
    type: string or dictionary
    default: (font: ("Iosevka", "DejaVu Sans Mono"), size: 9pt)
    description: Customize raw text (code) styling. Set to "use-typst-default" to use Typst's default formatting, or provide a dictionary with font and size keys to customize.

  • table-of-contents
    type: content
    default: outline()
    description: The result of a call to the outline function or none. Setting this to none will disable the table of contents.

  • appendix
    type: dictionary
    default: (enabled: false, title: "Appendix", heading-numbering-format: "A.1.1.", body: none)
    description: Setting enabled to true and defining your content in body will display the appendix after the main body of your document and before the bibliography.

  • bibliography
    type: content
    default: none
    description: The result of a call to the bibliography function or none. Specifying this will configure numeric, IEEE-style citations.

  • figure-index
    type: dictionary
    default: (enabled: false, title: "Index of Figures")
    description: Setting this to true will display an index of image figures at the end of the document.

  • table-index
    type: dictionary
    default: (enabled: false, title: "Index of Tables")
    description: Setting this to true will display an index of table figures at the end of the document.

  • listing-index
    type: dictionary
    default: (enabled: false, title: "Index of Listings")
    description: Setting this to true will display an index of listing (code block) figures at the end of the document.

About

A versatile, clean and minimal template for non-fiction writing. Ideal for class notes, reports, and books.

Topics

Resources

License

Stars

Watchers

Forks

Contributors