#Touying
282 messages · Page 1 of 1 (latest)
Thanks!
Touying is a powerful package for creating presentation slides in Typst.
https://github.com/touying-typ/touying
https://touying-typ.github.io/
It's really awesome. I am writing slides for local academic workshop in Japan.
Thank you for working on this actively.
Thanks for liking it.
Thanks for this fantastic package!
Is it possible to edit the page configuration for the first page of a section?
I am trying to put the heading body in the page header only for the first page of the section. The problem is, I need to make the top margin bigger for those pages and I can't find a way.
I could also use the subslide-preamble parameter but it is not in the page header and therefore not as optimal (for instance, I'd like to benefit for the 0-margin header to display a colored block)
@stiff talon What's your first page of the section? If you're referring to new-section-slide-fn, just configure it. and #slide(config: config-page())[xxx] can also modify the configuration temporarily.
I was referring to the slide that contains the second level heading == for instance.
I want to display it in a special manner in the header only for the first slide of this subsection.
The new-subsection-slide-fn is not suitable because with it you can make a slide that contains only the subsection name, whereas I want my slide to have the subsection name plus the content of the subsection
Right now I'm using subslide-preamble with negative padding and all, it's kind of working but ugly code
Is there an easy way to configure the background color and/or background image of title slide and normal slide? I do see an option for focus-slide in the theme file. Tried something like #set page(fill: gray) in the .typ document, but it did not change anything.
#slide(config: config-page(fill: gray))[XXX]
Thanks! This works on a single regular slide. Any way to do a global change? If not, how to make changes to title and section-title slides?
Have you looked at the documentation?
https://touying-typ.github.io/docs/next/layout#page-management should be what you're looking for
I did but not find what I was looking for
#show: touying-set-config.with(config-page(fill: gray))
Um, is this intentional that triple minus creates a page break instead of em dash?
Same for the sym.dash.em, but — works.
Another unwanted behavior that I found when using any of the hack from https://github.com/touying-typ/touying/issues/10, is that the full list on the last subslide will be shown at the correct position, but for all previous subslides it will show the list slightly move above.
This creates the artifact of noticeably moved list on the last subslide.
Oh, I've noticed that it works fine with the simple theme, but not with metropolis.
[0m[35m#import[0m [0m[32m"@preview/touying:0.5.3"[0m: themes[0m[31m.[0mmetropolis, pause
[0m[35m#show[0m: [0m[3m[34mmetropolis[0m.[0m[3m[34mmetropolis-theme[0m
[0m[1m[36m==[0m Slide
[0m[36m-[0m one
[0m[37m#pause[0m
[0m[36m-[0m two
[0m[37m#pause[0m
[0m[36m-[0m three
[0m[37m#pause[0m
[0m[36m-[0m four
You can disable it by config-common(horizontal-line-to-pagebreak: false)
You don't actually need these hacks anymore at 0.5.3, just
- one #pause
- two #pause
- three
Ohhh, at the end....
Yeah, I've noticed that the hacks are working by themselves, but this still doesn't fix the whole list shift.
I don't know if you know about this, can make an issue.
I've also noticed that with the latest update not only metropolis top-level headings now much bigger (for which I had to override the function), but also that now I have to insert a manual #pagebreak() after = Heading and before any content (from the implicit next page). Is this intentional, or is this a bug? I guess the nice part is that I can easily add stuff to that slide without using heading([name] + place()) or anything crazy like that.
How am I supposed to resize text with Touying?
I want to add smaller text on the title slide but it ends up on the next slide if I use text(size: ...)
I suppose it works better with an explicit #title-slide[]
After 0.5.x,#title-slide[] is all explicit.
Could you describe the thing you want in more detail?
I tried changing the font size of text after a title header (= title) but it broke out to a separate slide
after wrapping the whole thing in #title-slide the error didn't occur
A minimally reproducible example? Or an issue in github?
?r Really just what I said
#import "@preview/touying:0.5.3": *
#import themes.simple: *
#show: simple-theme
= Title
#text(size: 11pt)[text]
I think this is a bug, but you can work around it with ---.
?r
#import "@preview/touying:0.5.3": *
#import themes.simple: *
#show: simple-theme
= Title
---
#text(size: 11pt)[text]
this is still two slides?
doesn't --- break into a new slide, anyways?
Then maybe I'll have to look into what exactly is causing the bug.😂
Is it normal that fit-to-height just doesn't show anything?
It's only buggy when shrink: true
Or does it not work on text?
utils.fit-to-height no longer working on typst 0.12
https://github.com/touying-typ/touying/issues/109
I finally figured out the problem:
[0m[35m#import[0m [0m[32m"@preview/touying:0.5.5"[0m: [0m[36m*[0m
[0m[30m// Not affected:[0m
[0m[30m// #show: themes.simple.simple-theme[0m
[0m[30m// #show: themes.university.university-theme[0m
[0m[30m// #show: themes.aqua.aqua-theme[0m
[0m[30m// #show: themes.dewdrop.dewdrop-theme[0m
[0m[30m// #show: themes.default.default-theme[0m
[0m[30m// Affected:[0m
[0m[30m// #show: themes.stargazer.stargazer-theme[0m
[0m[35m#show[0m: [0m[3m[34mthemes[0m.[0m[3m[34mmetropolis[0m.[0m[3m[34mmetropolis-theme[0m
[0m[1m[36m==[0m That
[0m[30m// #lorem(20)[0m
[0m[36m-[0m one [0m[37m#pause[0m
[0m[36m-[0m two [0m[37m#pause[0m
[0m[36m-[0m three
these 2 themes shift the whole content of the slide, which is why the list items move.
MRE
[0m[35m#import[0m [0m[32m"@preview/touying:0.5.5"[0m: [0m[36m*[0m
[0m[35m#let[0m [0m[3m[34mslide[0m(setting: body [0m[36m=>[0m body, [0m[36m..[0mbodies) [0m[36m=[0m [0m[3m[34mtouying-slide-wrapper[0m(self [0m[36m=>[0m {
[0m[35mlet[0m new-setting [0m[36m=[0m body [0m[36m=>[0m {
[0m[35mshow[0m: std.align.[0m[3m[34mwith[0m(self.store.align)
body
}
[0m[3m[34mtouying-slide[0m(self: self, setting: new-setting, [0m[36m..[0mbodies)
})
[0m[35m#let[0m [0m[3m[34mmetropolis-theme[0m(align: horizon, [0m[36m..[0margs, body) [0m[36m=[0m {
[0m[35mshow[0m: touying-slides.[0m[3m[34mwith[0m(
[0m[3m[34mconfig-common[0m(slide-fn: slide),
[0m[3m[34mconfig-store[0m(align: align),
[0m[36m..[0margs,
)
body
}
[0m[35m#show[0m: [0m[3m[34mmetropolis-theme[0m
[0m[1m[36m==[0m Section
[0m[3m[34m#lorem[0m([0m[33m20[0m):
[0m[36m-[0m one [0m[37m#pause[0m
[0m[36m-[0m two [0m[37m#pause[0m
[0m[36m-[0m three [0m[37m#pause[0m
[0m[36m-[0m four
so it's indeed only because of hozion alignment...
I was not able to figure out why show hide: set list(marker: [anything]) hides the marker if it was previously hidden. But it looks like if the marker is not hidden, then everything stays in place. So the only issue is how to make marker not visible but also still present, so the layout does not shift.
https://github.com/touying-typ/touying/issues/136 Seems to be the same issue @earnest birch
yeah, I think so, it's just that it has been closed
so I thought then it must be a different issue
[0m[35mshow[0m [0m[3m[34mhide[0m: it [0m[36m=>[0m {
[0m[35mshow[0m [0m[3m[34mlist[0m: l [0m[36m=>[0m {
[0m[35mlet[0m marker [0m[36m=[0m []
[0m[35mlet[0m marker [0m[36m=[0m [[0m[3m[34m#v[0m([0m[33m5em[0m)]
[0m[35mif[0m l.marker [0m[36m!=[0m marker {
[0m[35mlet[0m fields [0m[36m=[0m l.[0m[3m[34mfields[0m()
[0m[35mlet[0m _ [0m[36m=[0m fields.[0m[3m[34mremove[0m([0m[32m"marker"[0m)
[0m[35mlet[0m children [0m[36m=[0m fields.[0m[3m[34mremove[0m([0m[32m"children"[0m)
[0m[35mreturn[0m [0m[3m[34mlist[0m(marker: marker, [0m[36m..[0mfields,tight: [0m[35mfalse[0m, [0m[36m..[0mchildren)
}
l
}
it
}
This does increase vertical spacing, but I can't use negative one or pad().
And just by adding show list: l => l the marker is gone
I solved it via
set list(marker: (level) => {
text("•")
}, spacing: 48pt)
// Prevent misaligned bullet points with pause
show: par.with(spacing: 48pt)
or are you trying to get the new hide mode working with lists?
[0m[3m[34mconfig-methods[0m(
cover: (self: [0m[35mnone[0m, x) [0m[36m=>[0m {
[0m[35mlet[0m s [0m[36m=[0m [0m[33m15pt[0m
[0m[35mshow[0m [0m[3m[34mhide[0m: it [0m[36m=>[0m {
[0m[35mset[0m [0m[3m[34mlist[0m(
marker: level [0m[36m=>[0m {
[0m[3m[34mtext[0m([0m[32m"•"[0m)
},
spacing: s,
)
[0m[30m// Prevent misaligned bullet points with pause[0m
[0m[35mshow[0m: par.[0m[3m[34mwith[0m(spacing: s)
it
}
[0m[3m[34mhide[0m(x)
},
)[0m[31m,[0m
it doesn't fix it
what is a new hide mode?
look at the issue, I thought you tried to work around the bullet points not being hidden
Idk too much about typst but I don't understand why you are doing it so complicated. Just add the five lines i posted in the let new-setting = body => { HERE } of your slide template
It wasn't clear where I should put that, so I figured this is an override for the cover function.
[0m[35mlet[0m s [0m[36m=[0m [0m[33m0.65em[0m
[0m[35mset[0m [0m[3m[34mlist[0m(spacing: s)
[0m[35mset[0m [0m[3m[34mpar[0m(spacing: s)
so the problem was just with spacing?
It's nice, but now I'm stuck at this constraint
The list now takes more space, so I'll have to see if it will look good for all slides.
thanks
I've fixed one of my previous presentations by adding this:
[0m[3m[34mconfig-common[0m(
slide-fn: slide.[0m[3m[34mwith[0m(
setting: body [0m[36m=>[0m {
[0m[35mset[0m [0m[3m[34mpar[0m(spacing: spacing) [0m[35mif[0m fix-pause
[0m[35mset[0m [0m[3m[34mlist[0m(spacing: spacing) [0m[35mif[0m fix-pause
body
},
),
)[0m[31m,[0m
There was only 1 place with list + par, so there I just added a #v(1em). That's a great bargain for that particular presentation.
I've searched for "spacing" on the issue page... Yeah, I completely missed this.
For wide lists, adding this other fix, completely removes all issues (movements).
https://github.com/typst/typst/issues/5472#issuecomment-2501199025
What would be the best way to animate 2 columns, divided by a line, while showing the headers from the start?
I'm struggling with this so much... First I tried grid, but it is pretty limiting, then I switched to stack.
I want to preserve the unity of the data so it's easy to read and edit it:
[0m[35m#let[0m custom-columns [0m[36m=[0m (
[0m[3m[34mcolumn[0m[Работодатель [0m[37m#pause[0m][
[0m[36m-[0m высокая эффективность и производительность труда [0m[37m#pause[0m [0m[3m[34m#h[0m([0m[33m1fr[0m)
[0m[36m-[0m соблюдение дисциплины и установленных стандартов [0m[37m#pause[0m
[0m[36m-[0m инициатива [0m[37m#pause[0m
[0m[36m-[0m лояльность, неконфликтность [0m[37m#pause[0m
[0m[36m-[0m участие в делах компании [0m[37m#pause[0m
[0m[36m-[0m высокая трудовая мотивация [0m[37m#pause[0m
[0m[36m-[0m способность и готовность к обучению и развитию
],
[0m[3m[34mcolumn[0m[Работник][
[0m[36m-[0m хорошая зарплата [0m[37m#pause[0m [0m[3m[34m#h[0m([0m[33m1fr[0m)
[0m[36m-[0m стабильность [0m[37m#pause[0m
[0m[36m-[0m интересная работа [0m[37m#pause[0m
[0m[36m-[0m уважение [0m[37m#pause[0m
[0m[36m-[0m профессиональный и карьерный рост [0m[37m#pause[0m
[0m[36m-[0m возможность проявить себя, чего-то достичь [0m[37m#pause[0m
[0m[36m-[0m признание заслуг [0m[37m#pause[0m
[0m[36m-[0m баланс работы и личной жизни
],
)
Working, but messy:
[0m[35m#let[0m column(header, list) = (strong(header), list)
[0m[35m#let[0m custom-columns = (
column[Работодатель][
[0m[36m-[0m высокая эффективность и производительность #h([0m[33m1fr[0m)
[0m[36m-[0m соблюдение дисциплины
[0m[36m-[0m инициатива
[0m[36m-[0m лояльность, неконфликтность
[0m[36m-[0m участие в делах компании
[0m[36m-[0m высокая трудовая мотивация
[0m[36m-[0m способность и готовность к обучению
],
column[Работник][
[0m[36m-[0m хорошая зарплата #h([0m[33m1fr[0m)
[0m[36m-[0m стабильность
[0m[36m-[0m интересная работа
[0m[36m-[0m уважение
[0m[36m-[0m профессиональный и карьерный рост
[0m[36m-[0m возможность проявить себя, чего-то достичь
[0m[36m-[0m признание заслуг
[0m[36m-[0m баланс работы и личной жизни
],
)
[0m[35m#let[0m common-line = line(angle: [0m[33m90deg[0m, length: [0m[33m90%[0m)
[0m[35m#let[0m common-slide(..args) = fix-list-pause-slide({
[0m[35mset[0m text([0m[33m0.92em[0m)
[0m[35mlet[0m (left, line, right) = args.pos()
[0m[35mlet[0m (left, right) = (left, right).map(block.with(width: [0m[33m48%[0m))
stack(dir: ltr, spacing: [0m[33m0.5em[0m, left, line, right)
})
#common-slide(
custom-columns
.first()
.enumerate()
.map(((i, x)) => [0m[35mif[0m i == [0m[33m0[0m { x + pause } [0m[35melse[0m {
x.children.filter(x => x != [ ]).intersperse(pause).join()
})
.join(),
[#meanwhile#common-line],
custom-columns
.last()
.enumerate()
.map(((i, x)) => [0m[35mif[0m i == [0m[33m1[0m { hide(x) } [0m[35melse[0m { x })
.join(),
)
#common-slide(
custom-columns.first().join(),
common-line,
custom-columns
.last()
.enumerate()
.map(((i, x)) => [0m[35mif[0m i == [0m[33m0[0m { x } [0m[35melse[0m {
x.children.filter(x => x != [ ]).intersperse(pause).join()
})
.join(),
)
I guess by drawing the line separately I can do this:
[0m[3m[34m#fix-list-pause-slide[0m({
[0m[35mset[0m [0m[3m[34mtext[0m([0m[33m0.9em[0m)
[0m[3m[34mplace[0m(center [0m[36m+[0m horizon, [0m[3m[34mline[0m(angle: [0m[33m90deg[0m, length: [0m[33m90%[0m))
[0m[3m[34mgrid[0m(
columns: [0m[33m2[0m,
align: top,
row-gutter: [0m[33m1em[0m,
column-gutter: [0m[33m2em[0m,
[0m[36m..[0marray.[0m[3m[34mzip[0m([0m[36m..[0mcustom-columns).[0m[3m[34mflatten[0m(),
)
})
The annoying thing is that the vline isn't drawn in the center, but to the right. I may be able to hack it via grid.cell, but idk if it will be a better solution.
I think I got it:
[0m[35m#let[0m column(header, list) = (strong(header), list)
[0m[35m#let[0m grid(..arg) = std.grid(..arg.named(), ..array.zip(..arg.pos()).flatten())
#fix-list-pause-slide({
[0m[35mset[0m text([0m[33m0.9em[0m)
place(center + horizon, line(angle: [0m[33m90deg[0m, length: [0m[33m90%[0m))
grid(
columns: [0m[33m2[0m,
align: top,
row-gutter: [0m[33m1em[0m,
column-gutter: [0m[33m2em[0m,
column[Работодатель][#pause
[0m[36m-[0m высокая эффективность и производительность труда #pause #h([0m[33m1fr[0m)
[0m[36m-[0m соблюдение дисциплины и установленных стандартов #pause
[0m[36m-[0m инициатива #pause
[0m[36m-[0m лояльность, неконфликтность #pause
[0m[36m-[0m участие в делах компании #pause
[0m[36m-[0m высокая трудовая мотивация #pause
[0m[36m-[0m способность и готовность к обучению и развитию
],
column[Работник][#pause
[0m[36m-[0m хорошая зарплата #pause #h([0m[33m1fr[0m)
[0m[36m-[0m стабильность #pause
[0m[36m-[0m интересная работа #pause
[0m[36m-[0m уважение #pause
[0m[36m-[0m профессиональный и карьерный рост #pause
[0m[36m-[0m возможность проявить себя, чего-то достичь #pause
[0m[36m-[0m признание заслуг #pause
[0m[36m-[0m баланс работы и личной жизни
],
)
})
In nested lists, I had to also add set par(leading: s).
Hi, with touying's sub-slide #pause function, is it possible to hide footnotes until the relevant part is uncovered?
Is there an easy way to get ToC before each section, with the upcoming section highlighted in Touying? With Beamer, it can be achieved with \tableofcontents[currentsection]. Below is a random example I found online
You can look at touying's dewdrop theme
@deft pier How to use the function #slide() with the University theme?
When I try to use:
#slide(
title: "The Scientific Method",
)[
Foobar
#speaker-note[Speaker note here]
]
I get:
error: assertion failed: unexpected named arguments:("title",)
┌─ @preview/touying:0.5.5/src/core.typ:1682:2
│
1682 │ assert(bodies.named().len() == 0, message: "unexpected named arguments:" + repr(bodies.named().keys()))
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: error occurred in this call of function `touying-slide`
┌─ src/presa/theme/university.typ:86:2
│
86 │ touying-slide(self: self, config: config, repeat: repeat, setting: new-setting, composer: composer, ..bodies)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: error occurred in this function call
┌─ @preview/touying:0.5.5/src/core.typ:167:6
│
167 │ slide-fn(self)
│ ^^^^^^^^^^^^^^
help: error occurred in this call of function `call-slide-fn-and-reset`
┌─ @preview/touying:0.5.5/src/core.typ:223:89
│
223 │ (cont, recaller-map, current-headings, current-slide, new-start, is-first-slide) = call-slide-fn-and-reset(
│ ╭──────────────────────────────────────────────────────────────────────────────────────────^
224 │ │ self + (headings: current-headings, is-first-slide: is-first-slide),
225 │ │ already-slide-wrapper: true,
226 │ │ child.value.fn,
227 │ │ none,
228 │ │ recaller-map,
229 │ │ )
│ ╰───────^
Another question, how to enable the speaker note on focus-slide ? https://github.com/touying-typ/touying/blob/6316aa90553f5d5d719150709aec1396e750da63/themes/university.typ#L215
Ignore the second question, I succeeded to make the changes to get it working 🙂
The slide function no longer has a title parameter, you should just use heading
Oh interesting. OK
Is touying following the (standard?) that templates are separate?
I see polylux is now releasing the templates split from the package.
there are some templates that are separate, IIRC
I thought those were external so to speak, which is fine generally. But polylux is doing it with all templates.
idk, it is nice to have a few built-in so you can start right away. But also, since you can make them separate, I don't think it's great idea to bloat the library with different templates.
I prefer to keep the built-in themes, which are easy to use and remember, and more guaranteed for timely and synchronized maintenance.
I wish I could have speaker-note on title-slide, for university theme. If you have a clue on how to do ... let me know
You mean like this?
https://typst.app/universe/package/dashy-todo
title-slide normally has an extra parameter? Or add it to the title/subtitle parameter. Even rewrite title-slide
I will submit a PR to fix it, I fixed it locally already.
Hi, I asked this Touying question about speakernote in forum and hope to get a hand: https://forum.typst.app/t/touying-how-to-have-different-speaker-notes-for-one-slide-with-pause/3064
thanks
I think it's achievable, but I haven't had time to implement it yet. But maybe you can try callback-style #only("2-", speaker-note[])
It works but only in callback style as you mentioned Thanks
I still this solution is still nice. Hope it could be included in docuement
I notice this workaround does not fit well with the case of Page Columnization: https://touying-typ.github.io/docs/layout#page-columnization
Becaues I could not do Page Columnization inside callback-stype. At least not so trivial
Just use callback function for each collum #slide(self => {}, self => {})
Yes I can get it work. The repeat need also be specified as I am combing column with pause (is indeed complex )
I think it should be a typo that {} shoud be []? is it?
Yes, just use []
With touying, how can I create a slide that does not belong to any section and does not show in outline?
Use: I want an arbitrary slide that is only relevant in slide show, and disappears in handout mode.
So it would be like
#if handout {
slide(some-config)[ relavent-meme ]
}
hello, I've been trying to have a nice "item by item" animation in touying for lists, and beyond manual "pause" after each item, it's a mess, impossible to put anything in show rules, with warnings about marks in context expressions
I've tried using the item-by-item and one-by-one functions from polylux, and manually calling them works, but not when using them in show rules
Can you elaborate?
so, I first tried having
#show list.item: it => [#it #pause]
- item 1
- item 2
this fails
error: panicked with: "Unsupported mark `touying-pause` at page 3. You can't use it inside some functions like `context`. You may want to use the callback-style `uncover` function instead."
┌─ @preview/touying:0.6.1/src/configs.typ:49:8
│
49 │ panic("Unsupported mark `" + kind + "` at page " + str(page-num) + ". You can't use it inside some functions like `context`. You may want to use the callback-style `uncover` function instead.")
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
then, I ported the one-by-one and item-by-item functions from polylux (removed the mode parameter)
#let one-by-one(start: 1, ..children) = {
for (idx, child) in children.pos().enumerate() {
uncover((beginning: start + idx), child)
}
}
#let item-by-item(start: 1, body) = {
let is-item(it) = type(it) == content and it.func() in (
list.item, enum.item, terms.item
)
let children = if type(body) == content and body.has("children") {
body.children
} else {
body
}
one-by-one(start: start, ..children.filter(is-item))
}
calling it directly works
#item-by-item[
- item 1
- item 2
]
but
#show list: item-by-item
- item 1
- item 2
yields the same error as before
i think what happens is that the show rules are resolved in a context expression in touying, and that's why it is complaining
You can't use pause in show rule
Hello, is it expected that the layout do not converge within 5 attempts for a presentation of around 20 slides/60 pages?
Is there a way to fix the warning?
That typically means you're doing something very involved introspection-wise
Probably involved with a show rule
And I've made very long touying presentations... This shouldn't happen.
That's strange, I am only using one show rule for touying, one for ctheorems + 2 simple ones for footnotes and outline. And commenting them out does not resolve the issue. I am using meanwhile, pause and uncover on the same slides, can it be because of that?
I think you can use them.
The most helpful hint would be a minimal reproducible example from your side.
Is it on the web app?
Can you revert to a typst version that's earlier, than currently selected one, and tell me if you still get that warning?
here it is if you wanna have a look
I have the same issue in all versions of the compiler I have tested
it seems to be an issue with numering of headings and theorems 🤔
I managed to isolate a minimal example
I didn't use and have no idea why ctheorems is needed, but perhaps it's a key problem, because otherwise it looks totally normal to me.
[0m[35m#import[0m [0m[32m"@preview/ctheorems:1.1.3"[0m: [0m[36m*[0m
[0m[35m#import[0m [0m[32m"@preview/touying:0.6.1"[0m: [0m[36m*[0m
[0m[35m#import[0m themes.metropolis: [0m[36m*[0m
[0m[35m#set[0m [0m[3m[34mheading[0m(numbering: [0m[32m"1.1"[0m)
[0m[35m#show[0m: [0m[3m[34mmetropolis-theme[0m
[0m[1m[36m==[0m Theorem
#([0m[3m[34mthmbox[0m([0m[32m"theorem"[0m, [0m[32m"Theorem"[0m))[]
[0m[1m[36m==[0m a
1 [0m[37m#pause[0m 2
[0m[1m[36m==[0m b
1 [0m[37m#pause[0m 2
[0m[1m[36m==[0m c
1 [0m[37m#pause[0m 2
I just found out there is already an issue open about that in the ctheorem repo
@stable dragon You can use #show: metropolis-theme.with(config-common(enable-frozen-states-and-counters: false)) to disable feature of frozen counters and avoid this problem.
Sadly, this does not fix the issue
What is this option for ? I do not find it in the touying documentation
You have a typo, not config-common:(enable-frozen-states-and-counters: false), but config-common(enable-frozen-states-and-counters: false).
Oh yeah sorry, the warning disappears yes but now the counter for the theorem is not frozen... It's arguably worse
Yes, there is no real frozen state yet, so there will be this non-convergence warning
Would someone be able to help my with creating a reducer for this?
#ded-nat(
arr: (
(0, $U => Z$, "P"),
(0, $(Z and R) => A$, "P"),
(0, $U$, "P"),
(0, $Z$, [e $=>$, 1]),
(1, $R$, "P"),
(1, $Z and R$, [i $and$, 4, 5]),
(1, $A$, [e $=>$, 6, 2]),
(0, [$R => A$], [i $=>$, 5 -- 7]),
)
)
How can I get a box around the title of slide in this form?
Moreover I see that I can only put institute logo either in header or the container. Putting it in header makes it too small.
Hi, when I do
#import "@preview/touying-brandred-uobristol:0.1.3": *
#show: uobristol-theme
// #set math.mat(delim: "[")
= test
#set math.mat(delim: "[")
$ mat() $
= text
I get the error "page configuration is not allowed inside of containers" from the line #set math.mat(delim: "[") (as shown #bot-corner message )
I still dont know why it happens but a workaround is
#{
set math.mat(delim: "[")
$ mat() $
}
For now, the reducer is only for automatically handling #pause. If your (0, $U = Z$, "P") refers to the 0th subslide, you can consider using #touying-fn-wrapper and #self.subslide
For box, you can use #layout to calculate the available width in advance, or use the grid layout; For the logo, you can consider using #pad(bottom: -10pt, logo) or #place
how exactly do frozen counters work?
#import "@preview/touying:0.6.1": *
#import themes.simple: *
#show: simple-theme.with(
config-common(
enable-frozen-states-and-counters: true
),
)
== test
#counter("test").step()
#context counter("test").get()
#pause
#context counter("test").get()
what am i missing? how do i make this counter freeze?
You should add your counter to the array of frozen counters frozen-counters in config-common
oh, i suspected something like this. thank you
i wish this were documented...
Is bibliography-as-footnote supposed to work? I can cite papers, but nothing appears on the slides
long time ago I tried sth like this with my own theme and it worked. This is the snippet I found
#show: UPS-theme.with(
...
config-common(show-bibliography-as-footnote: bibliography(title: none, "./src/bib.bib",style:"src/aps.csl"))
...
)
This is what I have, but it doesn't show...
I also added
#show: magic.bibliography-as-footnote.with(bibliography("bibliography.bib", title: none))
I'm using the Metropolis theme
In the end, I use simply #ci(<tag1>,<tag2>,...) which works like #footnote(cite(<tag1>,<tag2>,...))
#let ci(..tags) = {
let res = ()
for k in tags.pos() {
res.push(cite(k))
}
footnote(res.join("; "))
// }
}
With bibliography shown in the end of slides
// #hide(
bibliography("./src/bib.bib", style: "src/aps.csl", title: none)
// )
Maybe give it a try if the native solution always fails
Ok, thanks for the workaround 🙂
No prob!
I just check with the metropolis theme and it does work.
The MWE is
#import "@preview/touying:0.6.1": *
#import themes.metropolis: *
#show: metropolis-theme.with(
config-info(title: [title], subtitle: [sub], author: [authors], date: datetime.today(), institution: []),
config-common(new-section-slide-fn: none, show-bibliography-as-footnote: bibliography(
title: none,
"./src/bib.bib",
style: "src/aps.csl",
)),
)
#title-slide()
= test footnote bib
This is the citation: @abc2024
Wow, for me if I don't add #show: magic.bibliography-as-footnote.with(bibliography("bibliography.bib", title: none)), it complains that references do not exist
Well, I had bibliography-as-footnote instead of show-bibliography-as-footnote 🤦♂️
Why are bibliography items numbering reset at each slide?
Shouldn't they be incremented along the entire document?
Hi, I seem to be getting warning: layout did not converge within 5 attempts whenever I do #pause at the start of a slide - would anyone know how to avoid this?
I'm just going to ask here. What if I don't want these "title slides"? I just want, a title page and then slides, and non of that section title page thing.
config-common(new-section-slide-fn: none)
I'm starting to understand how I'm supposed to interact with touying. But I still find myself needing to read the source of the touying package, to figure out how to do what I want.
Any ideas on how I can get the total number of slides in the current section in Touying? I'm trying to have a secondary progress counter on each slide aside from the one that displays the total progress (i.e., current_slide / total_slides is already there, I want current_slide_out_of_the_current_section / total_slides_in_current_section). I would like the current slide number in this secondary progress counter (not a progress bar) to reset on each new section as well.
I tried an absolute mess with counters, but then I can't get the context to work as it either breaks Touying's assertions:
assertion failed: you must use
touying-slide-wrapperin your slide function
and I also can't use context with self as self is declared outside of the context scope. :(
I wanted to update dependencies of a document, but it was compiled with touying 0.5.3. And apparently it's the last version before a breaking change. After it you have to wrap slides with align to return old behavior?
It's such a weird bug, I don't even know what to think. Do I report it? You have 2 toggle lines + version change.
Basically, if I don't want an explicit show: align(left), I can't use set rules right below heading and before slide content.
Now set text below heading also affects heading above unless you put show: std.align.with(left) in let setting = it => {.
In 0.5.3 it only affected what's below, which does make sense.
I think this might be a regression bug, I'll check it later, thanks!
I don't quite get how this is supposed to work, why does the following code not produce anything under "Introduction"? In general first level heading don't generate any content, I remember doing a presentation with Touying and it was working how I had expected in 0.5.2
#import "@preview/touying:0.6.1": *
#import themes.dewdrop: *
#show: dewdrop-theme
= Introduction
- #lorem(10)
== Test
- #lorem(10)
it does work as expected if I put it in a #slide[] but that comes with some other problems
or are you supposed to start from heading level 2? But then the outline doesn't work
also how do you include a bibliography? I remember having it as a show rule in the first level 1 heading but these don't work anymore and I can't understand why having it in the config-common also doesn't work
#import "@preview/touying:0.6.1": *
#import themes.dewdrop: *
#show: dewdrop-theme.with(
config-common(
bibliography-as-footnote: bibliography(title: none, "works.yaml"),
),
)
= Introduction
- #lorem(10)
== Test
- #lorem(10) @HAWEN
It's show-bibliography-as-footnote
Does anyone know how to make a table in Touying where the last column appear only on the second subslide?
for anyone wondering, they are footnotes so something like #show footnote.entry: set text(size: .8em)
Is there a way to remove both the dots and the page number for the new section slide?
I tried new-section-slide-fn: new-section-slide.with(depth: 1, fill: []) but it doesn't recognize the fill parameter, I am a bit confused on how to customize this component https://github.com/touying-typ/touying/blob/99fa25528b72933ffeda075c041589043c87073a/themes/dewdrop.typ#L18
hello, when compling touying to HTML with the touying CLI a GIF that I hae in my presentation becomes extremely laggy, is there a way to improve the perfomance of the JS presentation? My computer isn't the best but it's really a very small GIF
Usually for the customization of outline, you may first check the Typst intrinsicoutline function https://typst.app/docs/reference/model/outline/
A specific theme could have its own way under the hood to generate an outline based on the intrinsic outline. So very possibly you need also to locate the function that's responsible for the outline in your picture. Note that in Touying there're also progressive-outline and in this theme Dewdrop, sidebar outline.
So before customizing a theme, it's better check through the source code of the theme to see how it's interfacing between the typst intrinsic functions and theme-specific functions accessible for users. For example, the outline seems to be generated here https://github.com/touying-typ/touying/blob/99fa25528b72933ffeda075c041589043c87073a/themes/dewdrop.typ#L193 .
And the fill parameter looks like to apply only to sidebar navigation, according to https://github.com/touying-typ/touying/blob/99fa25528b72933ffeda075c041589043c87073a/themes/dewdrop.typ#L9
Yes, customizations to the outline only apply to the first slide, that’s why I’m a bit confused on how to customize this. From the code I see that it accepts “..args” and one of these args should be “fill” for this slide but I can’t seem to make it work
Sorry you mean you want to change exactly the sidebar outline?
Then maybe you should modify the theme initialization
#show: dewdrop-theme(
aspect-ratio: "16-9",
navigation: "sidebar",
sidebar: (
width: 10em,
filled: false,
fill: [ ], // <= disable dots by using sth else. Not tested
numbered: false,
indent: .5em,
short-heading: true,
),
...
)
Nono, I want to change the outline that is show between a new section. What in the code is “new-section-slide”
Now I see. Then please change the default outline function style. For example, add the following show rule into your main file. Be sure that it comes after the #show: dewdrop-theme.with(...) block.
// From Typst documentation https://typst.app/docs/reference/model/outline/
#show outline.entry: it => link(
it.element.location(),
// Keep just the body, dropping
// the fill and the page.
it.indented(it.prefix(), it.body()),
)
This works, thank you!
btw the answer to that is "use google chrome". Neither Zen, Firefox or even Chromium work decently. Only Google Chrome
I was going to ask here, but forgout about it
Would it be possible to make the search only search for things in the current version?
It's a bit hard to find stuff in the documentation when you keep getting thrown to earlier versions
I wish the templates would have a b etter implementation of author and institution
Often when making academic talks you include coauthors, and each have their own institution, which sometimes also overlap
hey, please I need help with touying and bibliographies, is there someone with knowledge on how it works?
It doesnt work anymore in typst 0.14 an I was trying to fix the problem
https://github.com/touying-typ/touying/issues/229
touying creates a state to be populated with the bibliography, using the following function, but in typst 0.14 it gives an empty state (I believe):
#let record-bibliography(bibliography)
show grid: it => {
bibliography-state.update(
range(it.children.len()).filter(i => calc.rem(i, 2) == 1).map(i => it.children.at(i).body),
)
}
place(hide(bibliography))
}
(#contributors message)
-# (also [#quick-questions](#quick-questions message))
it doesn't matter (because using grid is only the right thing if the typst version is frozen and the bibliography style is known to use grid), but show rule on grid.cell will still expose the same data, still in 0.14. If one wanted to continue using this method it's maybe possible that way.
you can recreate that style without using any bibiography magic like this (default ieee style)
#let cite-note(key, form: "normal", enumerate: false) = {
set footnote(numbering: _ => none) if not enumerate
footnote[#cite(form: "full", key)]
if not enumerate {
super[#cite(form: form, key)]
}
}
You can also use enumerate: true for styles that have a too long marker for the normal form, and you could also use a bibliography style that always uses footnotes which is even better
im using university theme and have this setup:
#show: university-theme.with(
aspect-ratio: "16-9",
progress-bar: false,
...
)
however, the progress bar is still there. am i doing something wrong?
oh i just realized progress bar controls another component...
ideally id like the header to look like the subheader
i looked at the documentation and havent found a way to change that
Would likely require you to create your own template
ahh
i did use this as a workaround but the downside is that the header color is black
one last thing, it is possible to disable this text on the top right?
Thank you, it works perfectly! Do you know if I can redefine the @citation style to use this? I tried with #let cite = cite-note but it doesn't work
The best would be a natively footnote using cite style I guess, if you could convert your style to that. To change @ you can use a show rule on ref or cite. There's one thing we can do..
This way - mark any cite with "author" just as a marker, we won't use. Then translate all the default cites to cite-note. The author trick avoids recursion in the show rule (cite-note doesn't use that form)
#set cite(form: "author")
#show cite.where(form: "author"): it => cite-note(it.key)
Yep@CitekeyBook No@CitekeyMisc
if you need supplement, then you improve cite-note to support that and forward it through the rule above too
Thank you very much for your help, it works! I was really stuck with this issue
If anyone has the same use case as me, I currently am showing the references as in IEEE doc style:
This allows to write "This is used in [1] and [2] provides..."
Using a footnote CSL is quicker but the superscript does not really allow to do this
I slightly modified the snippet above because while obtaining this style, the citations where always coming next to the previous word (as if it was a supescript index, as in footnotes), I just added an empty space before in cite-note function (quick and dirty):
#let cite-note(key, form: "normal", enumerate: false) = {
set footnote(numbering: _ => none) if not enumerate
footnote[#cite(form: "full", key)]
if not enumerate {
// super[#cite(form: form, key)] // apice
" " + cite(form: form, key) // normale
}
}
#set cite(form: "author")
#show cite.where(form:"author"): it => cite-note(it.key)
and then cite with @key
update: the solution was horrible. I am still learning typst scripting so I can't solve the issue of refs attaching to the previous word ignoring spaces, here's a working solution:
#let cite-note(key, form: "normal", enumerate: false) = {
set footnote(numbering: _ => none) if not enumerate
"" + footnote[#cite(form: "full", key)]
if not enumerate {
cite(form: form, key) // normale
// super[#cite(form: form, key)] // apice
}
}
I just precede the ref with an empty string, this allows the ref to be placed mantaining spaces in the source before and after it.
that doesn't seem so horrible
Ahaha thanks, it was problematic because it added spaces even if the citation was at the beginning of a sentence, the second snippet is more viable
Hi, I have successfully reimplemented our corporate design in touying, but now I am trying to make the slide title optional. In beamer, I used to just leave the title empty, and the full title (with separating line) would vanish, leaving more space for the content. I partly solved this (detecting slides started with == without text) via
config-store(
header: self => [
#context if utils.current-heading().body != [] {
but I would now also like to reduce margin.top in this case, so that I can actually make use of the additional space. How would you address this? (I know I could write a custom slide function, but I would argue that it is much nicer to be able to just use empty headings, and the slide is not really of a different type. (I would consider a plain-slide for a completely empty one, or maybe just add a boolean show-footer argument to the slide function, so that I can have footerless slides with titles as well.)
Oh, cool, I found I can just set self.page.margin.top = self.page.margin.x, for instance. Now I only need to find out the correct place in my own code for conditional application.
(In the docs, only reading self.page was mentioned, but I now understand it's also writeable.)
I do have a problem to do that dynamically, though, which has to do with context. Since that does not seem to be touying-related, but rather my limited understanding of typst's context feature, I asked here: https://discord.com/channels/1054443721975922748/1463590218346139709
Maybe it is touying-related after all, because it concerns the context-awareness of the touying-slide-wrapper, so it would be nice if some of you could take a look at that support thread as well!
I am not completely sure of what you are doing and I've seen that you've been able to solve your context issues. However, I suspect you don't actually need to use context here. From what I understand, the value of the slide header is supposed to be in self.store.header
Well, header is the typst content that displays the heading. My goal was to make the header empty if the heading is empty (and then to also reduce the page margin). This works great now, so I can just start a new slide with an empty subsection heading and it will be header-less. I think that's much more comfortable than having to specify a special headerless slide function.
I will also implement subcaptions, analoguously, so I can just do
= Introduction
== Introducing the Main Application
=== (Informative subcaption here, still part of slide header)
- Feature 1
- Feature 2
...
== More Details on the Application
...
(Screenshot follows on next slide)
==
#image("large_screenshot.png", height: 100%)
for instance.
But are you writing a new theme, ie a new slide function or are you trying to tweak an existing one?
A new one, mostly for the corporate design of my institute. But now that I did that, I guess that part could be useful for other themes as well.
But for now, I'll play with mine (which is not fully finished). I'll have to check whether I can put it into the universe as-is, because of logo copyrights.
I've had a more precise look and I think I was wrong. Context seems to be needed here, sorry for that
Is there a way to make bullet list items from two lists appear at the same time? I have a two column wide grid and each has a list and I want to compare the two
You will have to use the uncover function for this. See https://touying-typ.github.io/docs/dynamic/complex
You can use #meanwhile
Yeah, I know about meanwhile and have used it before. But it doesn’t seem to be working here.
Do you have a working example? Basically just a list on the right with 1. 2. 3. and on the right. all 1 appear at the same time and all 2, etc
Should I add the meanwhile as a grid cell content?
#import "@preview/touying:0.6.3": *
#import themes.simple: *
#show: simple-theme.with(aspect-ratio: "16-9")
== Item by item
#slide[
#item-by-item[
- 1
- 2
- 3
]
][
#item-by-item[
- 1
- 2
- 3
]
]
== Or you can
#slide[
- 1 #pause
- 2 #pause
- 3
][
#meanwhile
- 1 #pause
- 2 #pause
- 3
]
There is a very interesting and touch problem on the forum regarding page margin precedence. I wonder if these "user-defined config" markers can be added to fix the issue? I don't see any other way to solve this. Like it's a minor thing, but a paper cut nevertheless, and there is a potential to make the user experience smoother.
Or just check for the keys (updated the post).
Thanks for doing an analysis of the problem, so the problem is that top/bottom are set by the template and so y has no effect?
exactly
I think the fix is actually not that hard, though feels still a bit jank. with checking the keys. though maybe with a separate named function it can be still ergonomic.
Yeah, I think it's pretty good: https://github.com/touying-typ/touying/pull/322.
I'm trying to create a presentation with touying (v0.7.1) using the dewdrop theme. When I create a new section (=) I always get a new outline in the previous page. Is it possible to disable this and just have the main outline?
config-common(new-section-slide-fn: none)
Great, thanks! I will try that! (It didn't thought about using none as a fn!)
Is there a way for alternatives to just take in a range of subslides? Using alternatives(a, a, a, b, b, b, b) feels a bit whack
You mean how many times a and b should be repeated?
alternatives(...((a,)*3 + (b,)*4)) should work
Yea, a syntax like beamer with <1-5> and stuff like that
Hi, I wanted to add an appendix to my presentation, modifying the heading numbering to "A.", but i have noticed that this is creating an extra (empty) slide before it. I think it may be related to commit 446cc68. Of course, I am using the latest available version: 0.7.3.
Here is an minimal example:
?r
#import "@preview/touying:0.7.3": *
#import themes.simple: *
#show: simple-theme.with(aspect-ratio: "16-9")
#set heading(numbering: "1.")
= Title
== First Slide
#slide[
#lorem(20)
]
== Second Slide
#slide[
#lorem(20)
]
#counter(heading).update(0)
#set heading(numbering: "A.1", supplement: [Anexo])
#show: appendix
= Appendices
#slide[
#lorem(15)
]
Note: 1 more page ignored
Should I open an issue? Maybe it has been already reported, I have searched in the open issues, but maybe I have skipped it.
Or maybe this is not the correct way to achieve this. Thanks in advance for your help
let's say i want to make a script for a youtube slides presentation, can i have a normal document and then implement touying to have my script reference slide pages?
so script and then slides, in the same doc
@deft pier Thanks a lot for your work on Touying and its documentation. Would you welcome a pull request on the documentation website that would reveal the existence of other code editors than VSCode? Your description of Tinymist is currently “A full-featured Typst LSP extension for VS Code. Provides syntax highlighting, autocomplete, error diagnostics, and a built-in slide preview panel.” but this has nothing to do with VSCode. Tinymist is first a LSP server that can work with any code editor. It also contains a VSCode plugin but everything from your description is available when using Tinymist in other code editors.