All skills
apcamargo avatar

/touying-author

@433372a

Author, refactor, and troubleshoot Typst slide decks built with Touying

Use this Skill: https://skilld.dev/gh/apcamargo/typst-skills/touying-author

This session only. Nothing lands on disk.

docscode-styles.md

≈1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Code Style

Simple Style

If we just need to use it simply, we can directly input content under the title, just like writing a normal Typst document. The titles here serve to separate pages, and we can also normally use commands like #pause to achieve animation effects.

#import "@preview/touying:0.6.1": *
#import themes.simple: *

#show: simple-theme.with(aspect-ratio: "16-9")

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!

image

And you can use an empty title == <touying:hidden> to create a new page, which is also helpful to clear the continued application of the previous title.

If we need to maintain the current title and just want to add a new page, we can use #pagebreak(), or directly use --- to split the page, the latter is parsed as #pagebreak() in Touying.

#import "@preview/touying:0.6.1": *
#import themes.simple: *

#show: simple-theme.with(aspect-ratio: "16-9")

= Title

== First Slide

Hello, Touying!

---

Hello, Typst!

image

Block Style

Many times, using only the simple style cannot achieve all the functions we need. For more powerful functions and clearer structure, we can also use the block style in the form of #slide[...].

For example, the above example can be transformed into

#import "@preview/touying:0.6.1": *
#import themes.simple: *

#show: simple-theme.with(aspect-ratio: "16-9")

= Title

== First Slide

#slide[
  Hello, Touying!

  #pause

  Hello, Typst!
]

And #empty-slide[] can create an empty Slide without a header and footer.

There are many benefits to doing this:

  1. Many times, we need more than the default #slide[...], we also need special slide functions like #focus-slide[...];
  2. The #slide[...] function of different themes may have more parameters than the default, for example, the #slide[...] function of the metropolis theme will have an align parameter that can set the alignment;
  3. Only slide functions can use callback-style content blocks to use #only and #uncover functions to achieve complex animation effects.
  4. It can have a clearer structure, by identifying #slide[...] blocks, we can easily distinguish the specific pagination effects of slides.

Convention Over Configuration

You may have noticed that when using the simple theme, using a first-level title automatically creates a section slide. This is because the simple theme registers a config-common(slide-fn: slide, new-section-slide-fn: new-section-slide) function, so Touying will call this function by default.

If we do not want it to automatically create such a section slide, we can remove this method:

#import "@preview/touying:0.6.1": *
#import themes.simple: *

#show: simple-theme.with(
  aspect-ratio: "16-9",
  config-common(new-section-slide-fn: none),
)

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!

image

As you can see, this will only result in two pages, and the default section slide will disappear.

Similarly, we can also register a new section slide:

#import "@preview/touying:0.6.1": *
#import themes.simple: *

#show: simple-theme.with(
  aspect-ratio: "16-9",
  config-common(new-section-slide-fn: section => {
    touying-slide-wrapper(self => {
      touying-slide(
        self: self,
        {
          set align(center + horizon)
          set text(size: 2em, fill: self.colors.primary, style: "italic", weight: "bold")
          utils.display-current-heading(level: 1)
        },
      )
    })
  }),
)

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!

image

Source: SKILL.md on GitHub

1 warning17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    This skill provides a set of instructions and documentation for authoring Typst slide decks using the Touying library. It involves processing and refactoring Typst code, which presents a standard indirect prompt injection surface typical of code-centric skills.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    44/44 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 433372a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 3 weeks ago

README badge

README badge for apcamargo/typst-skills/touying-author