How do I add bibliography to a Touying presentation?

I’m trying to add bibliography as footnotes in touying, I added the show rule

 #show: magic.bibliography-as-footnote.with(bibliography("refs.bib"))

at the start of my document but that creates an empty page. I have a feeling I have to declare it in some way under the preamble like codly, can anybody show me the correct way to do it? Thanks

Not super familiar with touying but what could be happening is that you have not referenced anything from your bibliography yet. By default, #bibliography() will only display the references that were used in the document but you can include all of them with the full-parameter: #bibliography("refs.bib", full: true).

EDIT: After testing myself, it is true – you do have to cite anything for a footnote to appear but I also do not know how to remove the empty page.

Yes, I wasn’t clear enough, I did cite some sources in the presentation and they appear alright, it’s just the starting blank page that I can’t get rid of

1 Like

I believe this to be a bug in the package. In order to make references available, they place and hide the bibliography, which results in the blank empty page.

@OrangeX4 Would you be able to fix this upstream? I’ve identified the offending line as

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

#show: simple-theme.with(aspect-ratio: "16-9")
#let bib = bibliography("bib.bib")
#show: magic.bibliography-as-footnote.with(bib)

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!

= Bibliography
#magic.bibliography()

show bibliography: none would probably do the job instead

1 Like

Ah yea, that is definitely it. I did see the place + hide in the source code but figured it would work since the package authors are experienced so it is surprising that they missed the #show <xyz>: none idiom.

Indeed, here I wrote a bug. But #show bibliography: none doesn’t solve the problem (since we need to record bibitems), and you should consider putting it after the heading of the first slide before the next version fixes. For example

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

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

= Title

== First Slide

#show: magic.bibliography-as-footnote.with(bibliography("refs.bib"))

Hello, Touying!

Hello, Typst!

= Bibliography

#magic.bibliography()

This doesn’t seem to work, the “bibliography” section appears in the outline twice, I have something like

#import "@preview/touying:0.5.2": *
#import themes.dewdrop: *
#import "@preview/codly:1.0.0": *
#import "@preview/numbly:0.1.0": numbly

#show: codly-init.with()

#show: dewdrop-theme.with(
  aspect-ratio: "16-9",
  footer: self => self.info.institution,
  navigation: "mini-slides",
  config-common(preamble: {
    codly(
      languages: (
        python: (name: "Python",  color: rgb("#306998")),
      ),
      zebra-fill: none,
      number-align: right + horizon,
    )
  }),
  config-info(
    title: [Title],
    subtitle: [subtitle],
    author: [Name Surname],
    date: datetime.today(),
    institution: [University],
  ),
)

#show raw.where(block: true): set text(size: 0.8em)

#title-slide()

#outline-slide()

= Introduction

#show: magic.bibliography-as-footnote.with(bibliography("refs.bib"))

bla bla bla

= Second section

bla bla

== Subsection

bla bla

``py
print("Hello World!")
``

= Third section

bla bla @citation

#magic.bibliography()

I’m including part of the codly code in case the bug is due to some interaction between the two packages

This is another problem, you just need:

#show: magic.bibliography-as-footnote.with(bibliography("refs.bib", title: none))
1 Like