How to remove the final backslash when quoting using a personalized heading?

Hi everyone,

I’m using this to create two appendixes :

#set heading(numbering: (first, ..other) =>
  {return numbering("A.1/",..other)}
)

#counter(heading).update(0)

#heading(numbering: none)[Appendices]

== L'espace des formes modulaires pour S <AppA>

But now when I use @AppA, I obtain : “Chapter A/” and I would like to remove the final /.

Does anyone know how to do it ?

Thanks in advance !

@Jacu,

Could you please post code blocks using back ticks and not screenshots in order to better help you?

Could you please edit your (last two) post(s)?

``` 
#let x = … //code shows formatted
``` 

And ideally, your code should compile if pasted into a new .typ file. The example you have provided does not (because of #S not defined).

However, it looks like you are looking for How to properly set heading numbering to include supplement? - #5 by Andrew

Thanks for editing your post :slight_smile:
Is this what you are looking for?

#set heading(supplement: "Appendice", numbering: (first, ..other) => 
  { return numbering("A.1/", ..other) })

#show ref: it => {
  let el = it.element
  if el == none or el.func() != heading or el.level != 2 or el.supplement != [Appendice] {
    return it
  }
  let lvl = counter(heading).at(el.location()).at(1)
  let body = el.supplement + numbering(" A", lvl)
  link(el.location(), body)
}
#counter(heading).update(0)

#heading(numbering: none)[Appendices]

== Heading1 <refA>

Voir @refA pour plus de détails.

Yes, it’s that. Thanks !

1 Like