How to use bibliography with subfiles

I have a question about using bibliographies in subfiles in the latest version 0.12.0.

The lastest update broke my code with the changes to locate. How can I cite my bibtex file from the subfile without making producing the references at the end of the subfile?

Before the latest update I had a main file for my thesis and included a chapter with #include "chapt_validation.typ". Inside chapt_validation.typ I reference papers from my bibtex file with #cite(<paper_name>, form:"author") and #locate(loc => bib_state.at(query(<here_is_valid_chapt>, loc).first().location())) at the end of the subfile, which only produced a reference section in the main file.

How can I convert this typst code to the new version?

Hello @Mr_study and welcome!
Don’t hesitate to read about how to convert locate to context expressions at How to use context instead of a callback function in locate function calls?

Thanks for the help.
With your direction I managed to fix the issue by replacing:
#locate(loc => bib_state.at(query(<here_is_intro_chapt>, loc).first().location()))
with
#context {bib_state.at(query(<here_is_intro_chapt>).first().location()) }

1 Like

Even better, you can replace the query with locate() (it has a new purpose now: find the location of something):

#context bib_state.at(locate(<here_is_intro_chapt>))

(Also, please don’t forget to mark an answer as a solution if you managed to solve your problem, thank you :smiley:)

1 Like