Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/preview/texst/0.1.0/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

## 0.1.0 - 2026-02-11

- Initial public release.
- Added `paper(...)` document wrapper with a LaTeX-like layout.
- Added theorem/proof environments via `ctheorems`.
- Added caption and equation helper utilities.
- Added package template and minimal example.
21 changes: 21 additions & 0 deletions packages/preview/texst/0.1.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Shusuke Ioku

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.
106 changes: 106 additions & 0 deletions packages/preview/texst/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# texst

`texst` is a Typst package for LaTeX-like academic paper formatting.

## Start Here

Use one of these two paths:

1. Published package (Typst Universe):

```typst
#import "@preview/texst:0.1.0": paper
```

2. Local repository checkout (before/without publication):

```typst
#import "./src/lib.typ": paper

Check warning on line 18 in packages/preview/texst/0.1.0/README.md

View check run for this annotation

Typst package check / @preview/texst:0.1.0

packages/preview/texst/0.1.0/README.md#L18

This import should use the package specification, not a relative path.
```

## Fastest Way to Use It

Copy this into your `main.typ`:

```typst
#import "@preview/texst:0.1.0": paper

#show: doc => paper(
title: [Paper Title],
subtitle: [Optional Subtitle],
authors: (
(name: [Author One]),
(name: [Author Two]),
),
date: datetime.today().display("[month repr:long] [day], [year]"),
abstract: [Write a concise abstract here.],
doc,
)

#heading(level: 1, outlined: false)[Introduction]

Start writing your paper.
```

## Initialize a Template Project

```bash
typst init @preview/texst:0.1.0
```

This generates a starter project from `template/main.typ`.

## What `paper(...)` Does

`paper(...)` applies:
- page layout and numbering
- typography defaults
- heading style and spacing
- table/figure alignment and numbering
- equation and reference behavior
- title block and abstract formatting

Your document content is passed through `doc`.

## Public API

- `paper(title:, subtitle:, authors:, date:, abstract:, style:, doc)`
- `nneq(eq)` (unnumbered display equation)
- `caption_note(body)`
- `caption_with_note(title, note)`
- `table_note(body)`
- `theorem`, `proof`, `prop`, `lem`, `rem`, `asp`

## Style Overrides

Pass a `style` dictionary to override defaults:

```typst
#show: doc => paper(
title: [Styled Paper],
style: (
body_font: "Libertinus Serif",
page_margin: (x: 1in, y: 1in),
heading_numbering: "1.",
accent_main: rgb(20, 40, 120),
),
doc,
)
```

Common keys include:
- `page_margin`, `page_numbering`
- `body_font`, `body_size`
- `paragraph_leading`, `paragraph_indent`
- `heading_numbering`, `heading_size`, `heading_weight`
- `footnote_numbering`, `accent_main`

## Local Development

- `examples/minimal.typ` is the local smoke test.
- `template/main.typ` is the package template entrypoint.
- Compile locally:

```bash
typst compile --root . examples/minimal.typ /tmp/minimal.pdf
```
1 change: 1 addition & 0 deletions packages/preview/texst/0.1.0/aesthetics.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#import "./src/lib.typ": *

Check warning on line 1 in packages/preview/texst/0.1.0/aesthetics.typ

View check run for this annotation

Typst package check / @preview/texst:0.1.0

packages/preview/texst/0.1.0/aesthetics.typ#L1

This import should use the package specification, not a relative path.
32 changes: 32 additions & 0 deletions packages/preview/texst/0.1.0/examples/minimal.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#import "../src/lib.typ": paper, theorem, proof, nneq

Check warning on line 1 in packages/preview/texst/0.1.0/examples/minimal.typ

View check run for this annotation

Typst package check / @preview/texst:0.1.0

packages/preview/texst/0.1.0/examples/minimal.typ#L1

This import should use the package specification, not a relative path.

#show: doc => paper(
title: [A Minimal Academic Paper],
subtitle: [Demonstration of the texst Package],
authors: (
(name: [First Author]),
(name: [Second Author]),
),
date: datetime.today().display("[month repr:long] [day], [year]"),
abstract: [
This is a minimal, generic example that demonstrates the package layout and
theorem environments.
],
doc,
)

#heading(level: 1, outlined: false)[Introduction]

This sample keeps content intentionally generic.

#heading(level: 1, outlined: false)[A Theorem]

#theorem[
For any real numbers $a$ and $b$, if $a = b$, then $a + 1 = b + 1$.
]

#proof[
Add 1 to both sides.
]

#nneq($x^2 + y^2 = z^2$)
49 changes: 49 additions & 0 deletions packages/preview/texst/0.1.0/paper.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#import "./src/lib.typ": paper, theorem, proof, caption_with_note, nneq

Check warning on line 1 in packages/preview/texst/0.1.0/paper.typ

View check run for this annotation

Typst package check / @preview/texst:0.1.0

packages/preview/texst/0.1.0/paper.typ#L1

This import should use the package specification, not a relative path.

#show: doc => paper(
title: [A Generic Research Paper],
subtitle: [A LaTeX-Like Typst Template Demo],
authors: (
(name: [First Author]),
(name: [Second Author]),
),
date: datetime.today().display("[month repr:long] [day], [year]"),
abstract: [
This document demonstrates the texst package with neutral placeholder content.
It is intentionally free of project-specific or personal information.
],
doc,
)

#heading(level: 1, outlined: false)[Introduction]

This sample illustrates how to structure an academic manuscript.

#heading(level: 2, outlined: false)[Equation Example]

#nneq($
f(x) = alpha + beta x + epsilon
$)

#heading(level: 2, outlined: false)[Theorem Example]

#theorem[
If two quantities are equal, adding the same constant to each preserves equality.
]

#proof[
Suppose $a=b$. For any constant $c$, adding $c$ to both sides gives $a+c=b+c$.
]

#figure(
table(
columns: 3,
[Variable], [Estimate], [Std. Error],
[Intercept], [0.42], [0.11],
[Treatment], [0.18], [0.07],
),
caption: caption_with_note(
[Illustrative Regression Output],
[Values are placeholders for demonstration only.],
),
)
Loading
Loading