GithubHelp home page GithubHelp logo

talal / ilm Goto Github PK

View Code? Open in Web Editor NEW
36.0 2.0 5.0 1.34 MB

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

License: MIT No Attribution

Typst 97.57% TeX 2.43%
book notes package report template typst typst-package typst-template

ilm's Introduction

‘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.

This template uses the Iosevka font for raw text. 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 the default "Fira Mono" font.

Configuration

This template exports the ilm function with the following named arguments:

Argument Default Value Type Description
title Your Title content The title for your work.
author Author content A string to specify the author's name
paper-size a4 string Specify a paper size string to change the page size.
date none datetime The date that will be displayed on the cover page.
date-format [month repr:long] [day padding:zero], [year repr:full] string 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 none content A brief summary/description of your work. This is shown on the cover page.
preface none content The preface for your work. The preface content is shown on its own separate page after the cover.
table-of-contents outline() content The result of a call to the outline function or none. Setting this to none will disable the table of contents.
bibliography none content The result of a call to the bibliography function or none. Specifying this will configure numeric, IEEE-style citations.
chapter-pagebreak true bool Setting this to false will prevent chapters from starting on a new page.
figure-index (enabled: false, title: "Index of Figures") dictionary Setting this to true will display a index of image figures at the end of the document.
table-index (enabled: false, title: "Index of Tables") dictionary Setting this to true will display a index of table figures at the end of the document.
listing-index (enabled: false, title: "Index of Listings") dictionary Setting this to true will display a index of listing (code block) figures at the end of the document.

Note

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.

The function also accepts a single, positional argument for the body.

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:1.1.2": *

#show: ilm.with(
  title: [Your Title],
  author: "Max Mustermann",
  date: datetime(year: 2024, month: 03, day: 19),
  abstract: [],
  preface: [],
  bibliography: bibliography("refs.bib"),
  figure-index: (enabled: true),
  table-index: (enabled: true),
  listing-index: (enabled: true)
)

// Your content goes below.

ilm's People

Contributors

talal avatar youwen5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ilm's Issues

Toggle Equation Numbering

Hi, I found configuration options to turn off indices for figures, tables, etc. Could you please help me find a way to turn off numbering for math equations as well? In my case, they're not necessary and are affecting the flow of the content. Thanks!

Support for other languages

First of all: thanks for this fantastic template! I've already used it in a few documents. One feature request I have, though, would be to support other languages apart from English (currently, things like the date format and headings "force" English in some areas). From a brief look at the template, it looks like this should be relatively easy to achieve, apart from one area:

Trivial Cases

Here, hard-coded values could simply become parameters with default values:

ilm/lib.typ

Lines 93 to 94 in ea4413d

// Display date as MMMM DD, YYYY
text(date.display("[month repr:long] [day padding:zero], [year repr:full]"))

ilm/lib.typ

Lines 129 to 130 in ea4413d

// Display table of contents.
outline(title: "Contents")

ilm/lib.typ

Lines 236 to 238 in ea4413d

if imgs { outline(title: "Index of Figures", target: fig-t(image)) }
if tbls { outline(title: "Index of Tables", target: fig-t(table)) }
if lsts { outline(title: "Index of Listings", target: fig-t(raw)) }

Non-trivial Case

ilm/lib.typ

Lines 137 to 139 in ea4413d

if not txt.starts-with("Index of") and txt != "Bibliography" {
pagebreak()
}

Here, it isn't quite as easy, since the title of the bibliography currently isn't managed by the lib.typ. While, as a short-term solution, this variable could be introduced (and at least set as a default using a #set expression), I don't think this is a great long-term solution 🤔. A more stable solution could be to scope that chapter pagebreak show rule to only the body, with the bibliography and outlines being outside the affected scope.

Next steps

I'd be willing to work on / create a PR for this. Would you accept such a change to the project? And if so: what's your preferred solution on the non-trivial case?

Thanks!

Page break after title page

Thanks you for creating such a clean and nice looking template for typst. I wonder if you had mind to control via a parameter if there is a blank page after the title - for web this may be unneccessary - I would gladly use a parameter like title-pagebreak = false. Thanks for considering.

Included files

When working with included files, the page number doesn't show in them.

Cannot use page function with headings

Really like this template I'm running into issues using the page function with inner headings.

Code

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

#show: ilm.with(
  title: [Process Design - G11],
  author: "",
  abstract: [],
  bibliography: bibliography("refs.bib"),
  figure-index: (enabled: true),
  table-index: (enabled: true),
  listing-index: (enabled: true)
)

#page(flipped: true)[
  = PID
#figure(
  align(center)[#image("PID.svg", width: 100%)],
  caption: [A figure to show the PID for the plant],
) 
#table(
  columns: 5,
  [Gross numbers]
)
]

Error

Pagebreaks are not allowed inside of containers line (failed in package "@preview/ilm:1.1.1")

Thanks!

Locale

The language is harcoded to English (ie. the word "Contents").
It would be nice to change it according to language settings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.