# Quarto + Typst (+ tdf ) save your eyes from reading documents

**URL:** <https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587>\
**Category:** Tooling\
**Tags:** visualization\
**Created:** [December 8, 2024, 10:04am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587 "2024-12-08T10:04:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [December 8, 2024, 10:04am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/1 "2024-12-08T10:04:15Z")

</div>

Do you know the Riemann zeta function?

\zeta(s) = \sum\_{n=1}^\infty \frac{1}{n^s}

Especially, for s=2 we have \zeta(2) = \pi^2/6. The \zeta(s) is implemented in SpecialFunctions.jl. Indeed,

```julia
julia> using SpecialFunctions
julia> ? # switch to help mode.
help?> zeta
search: zeta Meta eta beta lbeta ncbeta let get! detach zero

  zeta(s, z)

  Generalized zeta function defined by

  \zeta(s, z)=\sum_{k=0}^\infty \frac{1}{((k+z)^2)^{s/2}},

  where any term with k+z=0 is excluded. For \Re z > 0,
  this definition is equivalent to the Hurwitz zeta
  function \sum_{k=0}^\infty (k+z)^{-s}.

  The Riemann zeta function is recovered as
  \zeta(s)=\zeta(s,1).

  External links: Riemann zeta function
  (https://en.wikipedia.org/wiki/Riemann_zeta_function),
  Hurwitz zeta function
  (https://en.wikipedia.org/wiki/Hurwitz_zeta_function)

  ─────────────────────────────────────────────────────────

  zeta(s)

  Riemann zeta function

  \zeta(s)=\sum_{n=1}^\infty \frac{1}{n^s}\quad\text{for}\quad s\in\mathbb{C}.

  External links: Wikipedia
  (https://en.wikipedia.org/wiki/Riemann_zeta_function)

julia>

```

Yeah, the LaTeX syntax

```julia-auto
  \zeta(s)=\sum_{n=1}^\infty \frac{1}{n^s}\quad\text{for}\quad s\in\mathbb{C}.

```

corresponds to the formula.

\zeta(s) = \sum\_{n=1}^\infty \frac{1}{n^s}

Since many people in the scientific domain have a LaTeX parser in their eyes or their brains, “we don’t say we can’t understand it,” but it is less readable.

If we want to see these docstrings more intuitively, we need to navigate the following page, which requires an internet connection.

[https://specialfunctions.juliamath.org/stable/functions\_list/#SpecialFunctions.zeta-Tuple{Number}](https://specialfunctions.juliamath.org/stable/functions_list/#SpecialFunctions.zeta-Tuple%7BNumber%7D)

Is there any more intuitive way to visualize docstrings, including equations written in LaTeX? Let’s find out.

* * *

# Quarto + Typst → PDF

Let’s consider the following script:

````julia-auto
import REPL # This requires to allow us to collect all docstring related to zeta
using Markdown

using SpecialFunctions
using quarto_jll

run(`rm -f example.pdf example.qmd`)

frontmatter = """
---
format:
  typst:
    keep-typ: false
    margin:
      x: 1cm
      y: 1cm
    mainfont: "Hiragino Mincho ProN"
    fontsize: "24pt"
---
"""

md = Markdown.MD(@doc zeta).content[begin]

io = IOBuffer()
println(io, frontmatter)

for t in md.content
    println(io, t)
end

str = String(take!(io))
output_text = replace(str, r"```math\s*(.*?)\s*```"m => s"$$\1$$", r"``(.*?)``" => s"$\1$")
write("example.qmd", output_text)

run(`$(quarto()) render example.qmd --to typst`)

````

Here, we used `quarto_jll.quarto()`, which provides the `quarto` command. Quarto is an open-source scientific and technical publishing system. [https://quarto.org/](https://quarto.org/)

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/5/95cf3bd773b3d8a1f9cf2d4c97c325bd18815632.png)

The Typst allows to generate PDF fast compared to pandoc.

Bang!!! 🎉 We could render a PDF containing Julia docstrings that explain the `zeta` function. Are you satisfied?

* * *

## PDF + tdf + Terminal (supports Sixel Graphics) → 😄

We are greedy. Do we want to display the generated PDF nicely on your terminal? So, how do we do that?

Recently, [GitHub - itsjunetime/tdf: A tui-based PDF viewer](https://github.com/itsjunetime/tdf) is released. A tui-based PDF viewer written in Rust. Le’ts compile it using `cargo`:

```sh
git clone https://github.com/itsjunetime/tdf.git
cd tdf
cargo build --release

```

These commands will create a binary `target/release/tdf`. The `tdf` binary is self-contained. We can move or install it to your preferred directory. For instance, since I installed Julia using juliaup, the environment variable PATH should contain `~/.juliaup/bin`.

So, I decided to run the `mv` command:

```sh
mv target/release/tdf ~/.juliaup/bin

```

(Maybe we should have run `cargo insatll --git https://github.com/itsjunetime/tdf.git` ???)

```sh
$ tdf --help
Usage: <file> [-r <r_to_l>] [-m <max_wide>] [-h]
Arguments:
  <file> PDF file to read

Options:
  -r, --r-to-l <r_to_l> Display the pdf with the pages starting at the right hand size and moving left and
adjust input keys to match
  -m, --max-wide <max_wide> The maximum number of pages to display together, horizontally, at a time
  -h, --help Prints help

Commands:
  help Print this message or the help of the given subcommand(s)

```

Let’s run the following command:

```sh
$ tdf example.pdf

```

If your terminal supports sixel graphics, the `tdf` will convert the PDF as an image and display it on your terminal nicely 🕶 .

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/6/967b1835908aaa75c382315302cc44627b59afc2.png)

## Conclusion

We used Julia, and the Rust ecosystem to enable intuitive visualisation.

````julia-auto
import REPL # allow us collect all docstring related to zeta
using Markdown

using SpecialFunctions
using quarto_jll

run(`rm -f example.pdf example.qmd`)

frontmatter = """
---
format:
  typst:
    keep-typ: false
    margin:
      x: 1cm
      y: 1cm
    mainfont: "Hiragino Mincho ProN"
    fontsize: "24pt"
---
"""

md = Markdown.MD(@doc zeta).content[begin]

io = IOBuffer()
println(io, frontmatter)

for t in md.content
    println(io, t)
end

str = String(take!(io))
output_text = replace(str, r"```math\s*(.*?)\s*```"m => s"$$\1$$", r"``(.*?)``" => s"$\1$")
write("example.qmd", output_text)

run(`$(quarto()) render example.qmd --to typst`)

#=
git clone https://github.com/itsjunetime/tdf.git
cd tdf
cargo build --release
mv target/release/tdf ~/.juliaup/bin
=#

run(`tdf example.pdf`)

````

Your feedback is highly appreciated.

Have a nice Julian day!

---

<div class="post-metadata">

**Author:** ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)\
**Post date:** [December 8, 2024, 1:10pm UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/2 "2024-12-08T13:10:27Z")

</div>

Julia encourages the use of Unicode, falling back on LaTeX constructs only when absolutely necessary. See point 7 in [Writing Documentation](https://docs.julialang.org/en/v1/manual/documentation/#Writing-Documentation). The resulting mix of Unicode and LaTeX tends to be extremely readable as plain text.

I think you underestimate how much variation there is in the contexts where docstrings enter. Keep it simple! (Not that Quarto isn’t a nice piece of software)

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [December 8, 2024, 2:40pm UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/3 "2024-12-08T14:40:22Z")

</div>

> See point 7 in [Writing Documentation](https://docs.julialang.org/en/v1/manual/documentation/#Writing-Documentation)

I know this feature.

> I think you underestimate how much variation there is in the contexts where docstrings enter. Keep it simple!

Could you explain more specific?

I agree that writing symbols in Unicode improves readability. Not all docstrings in packages that have existed for a long time actively use Unicode. That’s why I posted this post … 🤔

Other than SpecialFunctions.jl, there are other packages that make heavy use of LaTeX syntax, such as Distributions.jl.

The attahced image in the L.H.S is the output of docstring of `Distributions.Gamma`.

 ![Screenshot 2024-12-08 at 23.23.42](https://global.discourse-cdn.com/julialang/original/3X/4/c/4cf6b62699e3808ac77ff8a320909b8172fc02b2.jpeg)

The R.H.S is generated by my script as shown above in my post.

At least the method I have proposed does not lose readability for the parts written in Unicode and improves readability for the parts written in LaTeX.

Keep It Simple! is easy to say. I think we can have a more constructive discussion by giving concrete examples … I have already provided at least two examples …

---

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [December 8, 2024, 8:24pm UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/4 "2024-12-08T20:24:16Z")

</div>

How about this?  
The author may include both unicode and typst (or latex for antiquarians) in the doc string, labeled with some kind of markup. The command you use to render it will choose what to do when it encounters one or the other or both. For example the REPL help interface would continue to prefer unicode.  
This requires more labor.

Having readable math (you can’t get this just through unicode) in the terminal would be great.

---

<div class="post-metadata">

**Author:** ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Post date:** [December 8, 2024, 10:14pm UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/5 "2024-12-08T22:14:20Z")

</div>

> [@jlapeyre](#):
>
> labeled with some kind of markup

You could do it like following

```julia
"""
   function foo(x)

general docs
$(isdefined(Main, :MathRenderingPackage) ? 
"here latexified 

or typst docs"
:
"here unicode docs"
)
"""
function foo(x)
    return x
end

```

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [December 8, 2024, 10:43pm UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/6 "2024-12-08T22:43:14Z")

</div>

Note that Typst works as a backend for generating PDF. It’s similar to GR.jl inside Plots.jl to plot something. We do not have to learn new syntax related to Typst. The auto generated `example.qmd` is just a Markdown file with an optional fromtmatter:

````julia
---
format:
  typst:
    keep-typ: false
    margin:
      x: 1cm
      y: 1cm
    mainfont: "Hiragino Mincho ProN"
    fontsize: "24pt"
---

```
Gamma(α,θ)
```

The *Gamma distribution* with shape parameter `α` and scale `θ` has probability density function

$$
f(x; \alpha, \theta) = \frac{x^{\alpha-1} e^{-x/\theta}}{\Gamma(\alpha) \theta^\alpha},
\quad x > 0
$$

```julia
Gamma() # Gamma distribution with unit shape and unit scale, i.e. Gamma(1, 1)
Gamma(α) # Gamma distribution with shape α and unit scale, i.e. Gamma(α, 1)
Gamma(α, θ) # Gamma distribution with shape α and scale θ

params(d) # Get the parameters, i.e. (α, θ)
shape(d) # Get the shape parameter, i.e. α
scale(d) # Get the scale parameter, i.e. θ
```

External links

  * [Gamma distribution on Wikipedia](http://en.wikipedia.org/wiki/Gamma_distribution)

````

I should have added more comments, sorry for the confusion everyone 🙇‍♂️

````julia
import REPL # This allows us to collect all docstring related to zeta
md = Markdown.MD(@doc Gamma).content[begin]

# Dump docstrings as Markdown
begin
  io = IOBuffer()
  println(io, frontmatter)

  for t in md.content
      println(io, t)
  end

  str = String(take!(io))
  output_text = replace(str, r"```math\s*(.*?)\s*```"m => s"$$\1$$", r"``(.*?)``" => s"$\1$")
  write("sample.qmd", output_text)
end

# Geenerate PDF using Quarto
# The `--to typst` tells quarto to make PDF using typst.
# We do not have to learn about typst.
# We can ommit `--to typst`
run(`$(quarto()) render sample.qmd --to typst`)

````

---

<div class="post-metadata">

**Author:** ![tecosaur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tecosaur/32/23206_2.png) [@tecosaur](https://discourse.julialang.org/u/tecosaur)\
**Post date:** [December 9, 2024, 1:46am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/7 "2024-12-09T01:46:58Z")

</div>

> [@terasakisatoshi](#):
>
> the LaTeX syntax
> 
> ```julia
> \zeta(s)=\sum_{n=1}^\infty \frac{1}{n^s}\quad\text{for}\quad s\in\mathbb{C}.
> 
> ```
> 
> corresponds to the formula.

I think we can make a solid improvement here by introducing rough Unicode LaTeX rendering:

```plaintext
ζ(s) = ∑ₙ₌₁^∞ 1 / nˢ for s ∈ ℂ.

```

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [December 9, 2024, 4:21am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/8 "2024-12-09T04:21:03Z")

</div>

> I think we can make a solid improvement here

How do we make it in JuliaLang? Could you share your code?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [December 9, 2024, 5:58am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/9 "2024-12-09T05:58:08Z")

</div>

Typst can also render directly to png in which case you don’t need tdf. Not sure how to invoke quarto to get png though, maybe you’d need to render to a typst file first and invoke typst yourself.

One could also take each math bit and render it to a small, tightly cropped png directly with Typst, then place that png in the normal printed text using sixels. Then you don’t need to typeset the whole text.

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [December 9, 2024, 7:18am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/10 "2024-12-09T07:18:04Z")

</div>

> [@jules](#):
>
> render directly to png

Good to know, I will check this. Thank you!!!

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [December 9, 2024, 8:45am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/11 "2024-12-09T08:45:30Z")

</div>

````julia
using TerminalPager
using Sixel
using TerminalGat
using FileIO, ImageIO
using Markdown
using SpecialFunctions
using quarto_jll

run(`rm -f sample.pdf sample.qmd`)

frontmatter = """
---
format:
  typst:
    keep-typ: true
    margin:
      x: 2cm
      y: 2cm
    mainfont: "Hiragino Mincho ProN"
    fontsize: "24pt"
---
"""

import REPL # allow us collect all docstring related to zeta
md = Markdown.MD(@doc zeta).content[begin]

io = IOBuffer()
println(io, frontmatter)

for t in md.content
    println(io, t)
end

str = String(take!(io))
output_text = replace(str, r"```math\s*(.*?)\s*```"m => s"$$\1$$", r"``(.*?)``" => s"$\1$")
write("sample.qmd", output_text)

run(`$(quarto()) render sample.qmd --to typst`)
@assert isfile("sample.typ")
run(`$(quarto()) typst compile sample.typ sample_\{n\}.png`)

imgs = filter(readdir(".")) do f
  pattern = r"^sample_[0-9]+\.png$"
  m = match(pattern, f)
  !isnothing(m)
end .|> load

for c in Iterators.partition(imgs, 2)
  Sixel.sixel_encode(hcat(c...))
end

````

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/e/9ec3cd53675298883f6afcb758df910304651d47.jpeg)

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [December 9, 2024, 8:46am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/12 "2024-12-09T08:46:48Z")

</div>

Since tdf implements pager, I still want the tdf command.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [December 9, 2024, 9:00am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/13 "2024-12-09T09:00:59Z")

</div>

> [@tecosaur](#):
>
> > [@terasakisatoshi](#):
> >
> > the LaTeX syntax
> > 
> > ```julia
> > \zeta(s)=\sum_{n=1}^\infty \frac{1}{n^s}\quad\text{for}\quad s\in\mathbb{C}.
> > 
> > ```
> > 
> > corresponds to the formula.
> 
> I think we can make a solid improvement here by introducing rough Unicode LaTeX rendering:
> 
> ```julia
> ζ(s) = ∑ₙ₌₁^∞ 1 / nˢ for s ∈ ℂ.
> 
> ```

Or we could write it directly with typst syntax as

```julia
ζ(s) = ∑_(n=1)^∞ 1 / n^s " for " s ∈ ℂ

```

(Yes, typst renders that exactly like the latex above.)

If you want to see it yourself, run

```julia
using Typstry
render(typst"""$ζ(s) = ∑_(n=1)^∞ 1 / n^s " for " s ∈ ℂ$""");

```

---

<div class="post-metadata">

**Author:** ![tecosaur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tecosaur/32/23206_2.png) [@tecosaur](https://discourse.julialang.org/u/tecosaur)\
**Post date:** [December 9, 2024, 9:23am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/14 "2024-12-09T09:23:08Z")

</div>

> [@GunnarFarneback](#):
>
> Or we could write it directly with typst syntax as

Sure, but Julia Markdown explicitly states that the contents of ```...``` is LaTeX, and I don’t think you’d have much luck (at this stage at least) campaining for a new Typst-specific syntax extension.

---

<div class="post-metadata">

**Author:** ![jakobjpeters](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jakobjpeters/32/207797_2.png) [@jakobjpeters](https://discourse.julialang.org/u/jakobjpeters)\
**Post date:** [December 9, 2024, 9:57am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/15 "2024-12-09T09:57:33Z")

</div>

> [@jules](#):
>
> One could also take each math bit and render it to a small, tightly cropped png

If I recall correctly, MakieTeX.jl does something similar!

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [December 9, 2024, 10:01am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/16 "2024-12-09T10:01:07Z")

</div>

> [@tecosaur](#):
>
> Sure, but Julia Markdown explicitly states that the contents of `...` is LaTeX, and I don’t think you’d have much luck (at this stage at least) campaining for a new Typst-specific syntax extension.

Yeah, I mostly wanted to point out that there’s something roundabout about asking quarto to call pandoc to convert latex to typst, so quarto then can call typst to render it to png. Instead it could have been much more readable in the source and required far less tooling to make a png or pdf.

---

<div class="post-metadata">

**Author:** ![tecosaur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tecosaur/32/23206_2.png) [@tecosaur](https://discourse.julialang.org/u/tecosaur)\
**Post date:** [December 9, 2024, 10:04am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/17 "2024-12-09T10:04:27Z")

</div>

Right. There’s an alternative here though, that’s LaTeX → Unicode.

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [February 8, 2025, 4:37am UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/18 "2025-02-08T04:37:00Z")

</div>

BTW, I released DocstringAsImage.jl

> **[GitHub - AtelierArith/DocstringAsImage.jl: This package visualizes Julia docstrings for...](https://github.com/AtelierArith/DocstringAsImage.jl)**
>
> This package visualizes Julia docstrings for functions with images

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/7/57326da8454adcfbfeb1a13a0aecd5fbcf65bdcf.jpeg)

---

<div class="post-metadata">

**Author:** ![tecosaur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tecosaur/32/23206_2.png) [@tecosaur](https://discourse.julialang.org/u/tecosaur)\
**Post date:** [February 8, 2025, 4:16pm UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/19 "2025-02-08T16:16:59Z")

</div>

Is there a reason why you don’t match the terminal background colour?

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [February 8, 2025, 11:54pm UTC](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587/20 "2025-02-08T23:54:49Z")

</div>

Because it just renders images that has black color background. How do I capture the RGB color of terminal in Julia?

[Next page](https://discourse.julialang.org/t/quarto-typst-tdf-save-your-eyes-from-reading-documents/123587.md?page=2)
