Ah yes I didn’t notice you were the one who linked it!
No they shot it down because it was not technically the solution they wanted. And as a side remark they complained that the PR included non-open-source code extracted from the website.
Ah yes I didn’t notice you were the one who linked it!
No they shot it down because it was not technically the solution they wanted. And as a side remark they complained that the PR included non-open-source code extracted from the website.
It’s funny that Typst is yet to become important (or referenced) enough to earn its place in Wikipedia.
What would be the recommended typst package for slides? Kind of like beamer in LaTeX.
(For now, a simple 5 page presentation in 20 minutes with some math and code, no interaction, linear structure. Being able to customize colors and insert a logo would be nice.)
I’ve tried polylux and it was quite simple!
It’s not hard to create your own theme from scratch, but you can also start from or directly use existing ones (such as basic-polylux – Typst Universe or metropolis-polylux – Typst Universe).
I think touying – Typst Universe is currently the foremost slides package. It is based on polylux, but is more actively developed (though polylux also seems to be worked on.)
Thanks for the tips, touying worked well for my purposes.
My kvetching above about the docs may come across as negative, so here are some things I like about typst:
#import extensions, even lets you specify the versions. no need to download packagestouying does not include a header, footer, nav buttons, and other items in the kitchen sink by default in the “simple” style (cf beamer, where I have to start disabling a lot of stuff to get clean look)rgb(#whatever), in contrast to the tikz madness of A!blend!B which was always driving me crazylet and parentheses and similar.For these simple requirements you could as well roll your own “slide system” ![]()
// Paper can also be presentation-16-9
#set page(paper:"presentation-4-3", numbering: "1", number-align: right)
// Base text size
#set text(24pt)
// New slide for each level 1 heading
#show heading.where(level: 1): it => pagebreak(weak: true) + it
// More space under headings
#show heading: set block(below: 1em)
// Fancy color for headings
#show heading: set text(rgb("#006699"))
= Slide title
#lorem(20)
$
a^2 + b^2 = c^2
$
#lorem(10)
= Another slide title
#lorem(20)
(For the logo it depends if you want it on a title page or on every slide.)
I spent the last 5–6 weeks trying to use Typst exclusively (except where I collaborate on existing documents with coauthors). I decided to go back to LaTeX for now.
Typst has a great promise and I will return to explore it in the future, but for now I am much more productive in LaTeX because I know my way around. Whenever I want to solve something in Typst, I search for a solution, about 60% of the time it is already available (and usually extremely elegant and well-designed), 40% of the time I ask on the forum, where there is this person (the same person) who shows up within 15 minutes and makes comments that are irrelevant, until someone shows up who actually understands the question which, by now, has 5 replies that are just noise. About half the time I run into an open issue which has no solution yet (if there is an open issue, it has a discussion clarifying that it will be done the Right Way
, just be patient), half the time the problem is solved.
This is interesting and exciting, as learning new things usually is, but a huge distraction. I have a perfectly fine workflow in LaTeX, which is adequate for my needs, so the incentives to switch are not that large.
But back in LaTeX, I miss the cleanliness of the Typst source syntax. All those extra \s and line noise are grating, even though I have them supressed with gray in Emacs.
Reading this thread is like reading a vi vs. emacs debate, without the flames.
I started a book project in June, using the publisher’s LaTeX template and by the time I completed the first draft the workarounds that I had needed would probably have rendered the manuscript unacceptable to the publisher. I turned to Typst, ascended the relatively gentle learning curve and was able to fix all that had ailed me. Margins, pagination (especially keeping tables and figures reasonably close together), code blocks, margin notes, glossary, page references and index became tractable. Error messages became tractable, and rendering was Julia-grade quick.
Sorry for resurrecting the old discussion, but it happens that I need to publish a technical document after a long while I did this the last time using latex. I searched the web about what changed in publishing tools since then, and after a quick research, I figured that you don’t need to use latex directly anymore (or whatever typesetting system is positioned to replace the latex) unless you have very strict requirements to document appearance. For a wide range of document types, it is more practical to use markdown with conversion tools like Quarto/Pandoc, which in turn can use latex or typst engines for the backend depending on what output do you need. This gives you a lot of flexibility with a lot of simplicity. You can convert markdown to html, pdf and a bunch of other formats straightforward, and you can insert html/css/latex/typst blocks inline for flexible markup.
I’d like to hear opinion of julia community about Markdown → Quarto/Pandoc approach instead of using the latex or typst directly before I make my own (possibly wrong) choice.
Can you give more details on how this works? E.g., how can you label equations and reference them? What about bibliography?
From their documentation:
Black-Scholes (@eq-black-scholes) is a mathematical model that seeks to explain the behavior of financial derivatives, most commonly options:
$$
\frac{\partial \mathrm C}{ \partial \mathrm t } + \frac{1}{2}\sigma^{2} \mathrm S^{2}
\frac{\partial^{2} \mathrm C}{\partial \mathrm S^2}
+ \mathrm r \mathrm S \frac{\partial \mathrm C}{\partial \mathrm S}\ =
\mathrm r \mathrm C
$$ {#eq-black-scholes}
The following template was generated by claude for me to demonstrate quatro markdown features. You need to run
quarto render report.qmd
to generate PDF and HTML. The the content of report.qmd:
---
title: "Technical Report: System Analysis and Implementation"
subtitle: "A Comprehensive Study"
author:
- name: "Your Name"
affiliation: "Your Institution"
date: "2025-10-05"
abstract: |
This template demonstrates a complete technical report setup using Quarto.
It includes sections, subsections, mathematical formulas, figures, tables,
code snippets, cross-references, and a table of contents. The same source
generates both beautiful HTML and PDF outputs.
format:
html:
toc: true
toc-depth: 3
number-sections: true
code-fold: false
theme: cosmo
css: custom.css
pdf:
toc: true
toc-depth: 3
number-sections: true
colorlinks: true
geometry:
- margin=1in
keep-tex: false
bibliography: references.bib
---
# Introduction
This document serves as a template for technical reports. It demonstrates how to structure content, include various elements, and produce professional output in multiple formats.
## Background
Technical documentation requires careful organization and clear presentation of complex information. This template shows best practices for:
- Hierarchical document structure
- Mathematical notation and equations
- Code examples with syntax highlighting
- Figures and tables with captions
- Cross-referencing throughout the document
## Objectives
The main objectives of this template are:
1. Demonstrate Quarto's capabilities for technical writing
2. Provide reusable patterns for common documentation needs
3. Show how to maintain a single source for multiple output formats
# Methodology
## Mathematical Formulas
### Inline Mathematics
You can include inline math like $E = mc^2$ or $\alpha + \beta = \gamma$ within your text seamlessly.
### Display Mathematics
For more complex equations, use display mode:
$$
\frac{\partial f}{\partial x} = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}
$$ {#eq-derivative}
Multiple equations can be aligned:
$$
\begin{aligned}
x &= \frac{-b \pm \sqrt{b^2-4ac}}{2a} \\
y &= mx + c \\
z &= \int_0^\infty e^{-t^2} dt
\end{aligned}
$$ {#eq-system}
As shown in @eq-derivative, the derivative definition follows from first principles. The system in @eq-system demonstrates alignment.
## Code Examples
### Python Code
```{python}
#| label: fig-python-plot
#| fig-cap: "Sample data visualization using Python"
#| echo: true
#| warning: false
import numpy as np
import matplotlib.pyplot as plt
# Generate sample data
x = np.linspace(0, 10, 100)
y = np.sin(x) * np.exp(-x/10)
# Create plot
plt.figure(figsize=(8, 4))
plt.plot(x, y, 'b-', linewidth=2)
plt.xlabel('Time (s)')
plt.ylabel('Amplitude')
plt.title('Damped Oscillation')
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
```
### Static Code Snippets
Here's an example of non-executable code with syntax highlighting:
```javascript
// JavaScript example
function calculateFibonacci(n) {
if (n <= 1) return n;
return calculateFibonacci(n - 1) + calculateFibonacci(n - 2);
}
const result = calculateFibonacci(10);
console.log(`Fibonacci(10) = ${result}`);
```
```rust
// Rust example
fn main() {
let numbers: Vec<i32> = (1..=10).collect();
let sum: i32 = numbers.iter().sum();
println!("Sum of 1 to 10: {}", sum);
}
```
## Tables
### Simple Table
| Algorithm | Time Complexity | Space Complexity |
|-----------|-----------------|------------------|
| Binary Search | $O(\log n)$ | $O(1)$ |
| Quick Sort | $O(n \log n)$ | $O(\log n)$ |
| Merge Sort | $O(n \log n)$ | $O(n)$ |
| Hash Table | $O(1)$ average | $O(n)$ |
: Comparison of algorithm complexities {#tbl-complexity}
As shown in @tbl-complexity, different algorithms have different performance characteristics.
### Advanced Table with Code
```{python}
#| label: tbl-results
#| tbl-cap: "Experimental results from simulation"
#| echo: false
import pandas as pd
data = {
'Experiment': ['A', 'B', 'C', 'D'],
'Mean': [4.52, 3.89, 5.12, 4.67],
'Std Dev': [0.23, 0.31, 0.19, 0.28],
'Sample Size': [100, 120, 95, 110]
}
df = pd.DataFrame(data)
print(df.to_markdown(index=False))
```
# Results
## Figures and Images
You can include static images with captions:
{#fig-architecture}
The architecture shown in @fig-architecture illustrates the main components of our system.
## Format-Specific Content
::: {.content-visible when-format="html"}
### Interactive Content (Web Only)
This section only appears in the HTML version. You could include:
- Interactive visualizations
- Embedded videos
- Live demos
<div style="padding: 20px; background-color: #e3f2fd; border-left: 4px solid #2196f3; margin: 20px 0;">
<strong>💡 Web-Only Note:</strong> This styled callout only appears in the web version.
</div>
:::
::: {.content-visible when-format="pdf"}
### Print-Optimized Content (PDF Only)
This section only appears in the PDF version. Useful for:
- High-resolution static images
- Print-specific formatting
- Appendix materials better suited for paper
:::
## Cross-References
Throughout this document, we've demonstrated cross-referencing:
- Equations: See @eq-derivative and @eq-system
- Figures: Refer to @fig-python-plot and @fig-architecture
- Tables: Compare data in @tbl-complexity and @tbl-results
- Sections: As discussed in @sec-discussion
# Discussion {#sec-discussion}
## Key Findings
The template demonstrates several important capabilities:
1. **Unified Source**: Single markdown file generates multiple outputs
2. **Rich Content**: Math, code, figures, and tables all supported
3. **Professional Typography**: Automatic formatting in both HTML and PDF
4. **Cross-References**: Automatic numbering and linking
## Limitations
Some considerations when using this approach:
- Complex layouts may require format-specific adjustments
- Very large documents might benefit from splitting into multiple files
- Some advanced LaTeX features may need raw LaTeX blocks
## Raw LaTeX Example
For PDF-specific advanced formatting, you can include raw LaTeX:
```{=latex}
\begin{equation}
\boxed{
\oint_C \mathbf{E} \cdot d\mathbf{l} = -\frac{d\Phi_B}{dt}
}
\end{equation}
```
# Conclusion
This template provides a solid foundation for technical reports that need both web and PDF distribution. The combination of Markdown's simplicity with Quarto's power offers an excellent balance of ease-of-use and capability.
## Future Work
Potential extensions include:
- Integration with citation management tools
- Custom styling and branding
- Automated report generation from data pipelines
- Multi-language support
# References {.unnumbered}
::: {#refs}
:::
---
## Appendix A: Setup Instructions {.unnumbered}
To use this template:
1. Install Quarto: https://quarto.org/docs/get-started/
2. Save this file as `report.qmd`
3. Render to HTML: `quarto render report.qmd --to html`
4. Render to PDF: `quarto render report.qmd --to pdf`
5. Render both: `quarto render report.qmd`
## Appendix B: Additional Configuration {.unnumbered}
Create a `custom.css` file for HTML styling:
```css
/* Custom styles for HTML output */
.custom-callout {
padding: 15px;
margin: 20px 0;
border-left: 4px solid #2196f3;
background-color: #e3f2fd;
}
```
Create a `references.bib` file for citations:
```bibtex
@article{example2024,
title={Example Article Title},
author={Author, A. and Author, B.},
journal={Journal Name},
year={2024},
volume={10},
pages={1--20}
}
```
This looks like legit markdown with yaml head to me.
I’d argue that your requirements don’t have to be that strict to go beyond what quarto can handle easily. If all you need to do is display text and figures and code in a document, then yeah, it’s fine. But if you need any amount of control, it gets very complicated.
For example, I just finished writing a grant that had specific requirements for font, margins etc - that stuff can be handled by quarto no problem. The bigger thing was that it had to be no more than 6 pages, which meant I had to fight for every line.
One thing I did was compress a table quite aggressively - shrank the padding in the cells, made the table text smaller, etc. Then I put it to the side in a column that was only 30% of the width of the page, with text in the other 70%, but to make it clear I put a light gray box around the table and its legend. This kind of things might be possible with quarto, but given my experience I don’t think it would be straightforward.
I have been using Quarto on a daily basis for some two years. I have based web pages for my courses on Quarto (and Julia): you may want to have a look at B(E)3M35ORR – Optimal and Robust Control. Or perhaps jump directly to one particular lecture that show references to equations, citations of literature, and even including a Julia source code and its graphical outputs: Discrete-time LQR on a finite horizon – B(E)3M35ORR – Optimal and Robust Control (and you can consult the corresponding source orr/lectures/discr_indir_LQR_fin_horizon.qmd at main · hurak/orr · GitHub).
The example, which I cited above, does not just display text, figures and code. It does a lot of things actually, pretty much everything typical technical document needs. I agree that in the edge case, like yours, you probably need to use latex directly for precise control of document appearance. And still, I would argue that even in this case, it could be easier to focus on content first, making draft in markdown, then convert it to latex and make sure your requirements are met, than typing the entire document in latex. This is arguable of course.
This has been my appproach for years: Pandoc Markdown converted to PDF, LaTeX, Typst (more recently), HTML, various plain text formats, and docx, as needed by various publishers. You give up nothing, as you can interpolate raw LaTeX, HTML, etc. as needed, and keep everything in a single source document. Finally, you can write filters to customize and develop your personal extensions to Pandoc Markdown.
You give up nothing
Except the simplicity. My previous approach was similar to yours but I now see it as clunky.
Simplicity in code organization and languages: I used to have a combination of quarto Markdown, YAML configuration, Lua filters, LaTeX template. Now it’s just Typst.
Simplicity in syntax: the math syntax in particular feels much lighter than LaTeX (and Markdown since it uses LaTeX math). But any customization is also much lighter in Typst. For example I have bilingual documents that used to look like this in quarto/Markdown:
[French version]{lang=fr}
[German version]{lang=de}
$$ some equation shared by the French and German version $$
or for block-level content:
::: {lang=fr}
French version
:::
::: {lang=de}
German version
:::
This relies on configuration in the YAML file for the project that enables filters written in Lua files that discard the spans and divs of the “wrong” language for the current compilation.
Now in Typst it looks like this:
#f[French version] // can also include block-level content
#g[German Version]
The definitions of the functions f and g can be Typst one-liners at the top of the Typst file. The whole document is just a Typst file, not a multi-directory software project like the quarto version.
(Also: quarto/Markdown doesn’t have proper comments, at least last time I checked.)
I should add that this doesn’t diminish two great advantages of quarto, which are probably the whole point of that project: 1) that you can execute code blocks and embed the result in the document and 2) that you can produce beautiful interactive websites with almost zero effort. Though for the first point I don’t miss it too much since I have written a package in Typst to embed cell sources and cell outputs from Jupyter notebooks.
This is actually a huge reason I’ve switched to typst. Typst in the simple case is a markup language. And then you can layer on the complexity as you need it.
I agree that writing directly in latex is miserable.
I agree that code block generation and web sites are the two great strengths of Quarto, compared to Typst and that Typst has nearly the flexibility of LaTeX at a fraction of the syntax pain. Margins, running headers, TOC, indexing, glossaries, TODOs, custom highlighter blocks, code block styling are all straightforward. Equations are no trouble. One of the most welcome features is that it is easy to keep figures and tables closer to the accompanying text.