I’m trying to put together a document containing articles from multiple authors. On each article’s first page, I want to display title and author in a specific formatting style; I also want them to appear in a table of contents,
Title1 (Author1)…3
Title2 (Author2)…5
etc.
I think the answer to this is a custom function for each article, that sets title and author variables in such a way that outline can read them, but I’m very new at this and I’m having trouble finding documentation in between the tutorials (jolly good but don’t cover what I’m after) and the reference (almost certainly does cover what I’m after, but I can’t find it).
Any suggestions on (a) how to do this but also (b) other documentation sources?
(I am a coder but I’m just starting with typst code. If it matters I’m using the CLI exclusively.)
Hi there. You can look at ijimai – Typst Universe, which is recently an official template for the journal that accepts articles in Typst. But you can’t just use it for each article, because multiple bibliographies are not supported yet. Do you use bibliography()? If not, then I think you can copy the necessary stuff from that template and that’s it.
Then the above and below (with custom content) will show up above and below the article where the template is used.
Although one problem still, is that if article will use non-unique custom labels, then the main document won’t compile. I guess you can use a custom label() throughout the article that will internally create unique labels, even though it’s not as convenient as using special syntax.
But if you don’t reference anything in the articles, then there should be no issues at all.
You can make a function and wrap the whole article in it, but then you won’t be able to compile the article by itself with all the necessary styling. You don’t normally wrap a whole document in a function explicitly.
Thanks for this, which has got me a lot further. The article-level template is working well. But my original question, which may have got lost in the other things I didn’t understand, was about generating the ToC. The IJIMAI code doesn’t seem to include the material for creating a whole issue of the journal with multiple papers, or I’ve failed to spot it.
To put it another way, I want to say somewhere in the article file:
title = “title one”
author = “author one”
(in whatever format is needed, with a conf file, that’s all flexible), and then build an outline() that will look for all those definitions and produce a ToC that looks like
title one (author one)…3
title two (author two)…5
etc.
In other words, I think, I need to define an element that is locatable so that outline() can find it, but not displayed. Or maybe I’m completely on the wrong track there.