#Is there a way to remove the numbering in the outline with my code?

12 messages · Page 1 of 1 (latest)

merry wave
#

I am trying to make a model of document for this year but I have trouble with numbering, I do not want the 0 appearing next to the outline title.

#import table: cell, header
#show link: underline
#set page(
  paper: "a4",
  margin: (x: 1.8cm, y: 2.5cm),
  numbering: "1",
  number-align: right,
  header-ascent: -5%,
  footer-descent: 5%,
  header: context {
    if counter(page).get().first() == 1 [
      #set text(size: 10pt, font: "")
      #table(
        columns: (8.7cm, 8.7cm),
        rows: (auto),
        stroke: none,
        align: (left, right),
        [
          Prénom NOM \
          Classe \
          #datetime.today().display("[day]/[month]/[year]")
        ],
        [
          /*#image(
            "logo-insa.svg",
            width: 5.5cm,
            height: 1.2cm
          )*/
        ]
      )
    ]
  }
)

#set text(
  size: 12pt,
  weight: "thin",
  lang: "fr",
  ligatures: false,
  fractions: false,
  overhang: false,
  hyphenate: false
)

#set heading(
  numbering: "I.1.a."
)
#show heading.where(level:1): it => [
  #set text(
    size: 18pt,
    weight: "extrabold",
  )
  
  #counter(heading).display()
  #underline(it.body)

]
#show heading.where(level:2): it => [
  #set text(
    size: 16pt,
    weight: "bold",
  )

  #counter(heading).display()
  #underline(it.body)
  
]
#show heading.where(level:3): it => [
  #set text(
    size: 14pt,
    weight: "regular",
  )

  #counter(heading).display()
  #underline(it.body)
  
]
#show heading: underline

#set par(
  justify: true,
  linebreaks: "optimized",
  first-line-indent: 15pt
)

#set outline(
  depth: 3,
  indent: auto
)

#set list(
  marker: ([•], [--], [‣])
)

#set enum(
  full: true,
  number-align: start + bottom
)

#set math.equation(
  numbering: "(1)"
)

#outline()

= Heading
#lorem(50)
== Heading
#lorem(50)
=== Heading
#lorem(50)
void patio
#

The issue here is that you're defining heading such that it forces counter(heading).display() regardless of whether or not it has a numbering

#

yeah I think this will need a bit of a reform

#

In this specific case this suffices for the headings, but also refer to the styling documentation

#set heading(
  numbering: "I.1.a."
)

#show heading: it => underline(it)
#show heading.where(level: 1): set text(size: 18pt, weight: "extrabold")
#show heading.where(level: 2): set text(size: 16pt, weight: "bold")
#show heading.where(level: 3): set text(size: 14pt, weight: "regular")
merry wave
#

Ok thanks, that works very well

#

That is what I did originally but I changed it to be able to have a continuous underline

void patio
#

ah sorry

#

I think underline(evade: false, …) does that

#

o

#

nvm

#

cursed, precarious and extemporary, but works if you want to declutter lmao

#show heading: it => {
  show h: " "
  it
}

or have the rules begin after

#show heading: it => block({
  if it.numbering != none {
    [#counter(heading).display() ]
  }
  it.body
})
merry wave
#

Oh yes that works