Numbered List inside block

I have the following function:

/// Display filtered questions.
#let display-question(
  scoring: none,
  show-answers: false,
  show-criteria: false,
  show-sections: none, // Este parámetro se poblará desde el nuevo 'filter' en 'questions'
  filter: (:), // Este 'filter' aquí dentro de display-question ya no es tan relevante,
                // porque el filtrado principal se hará en 'questions'
  question,
) = {
  let (sections, description, scoring, criterion, answer) = question

  // Lógica para filtrar secciones - Sin cambios en su funcionamiento
  let sections-to-display = if show-sections == none {
    sections // Si no se especifica, mostrar todas las secciones
  } else {
    let filtered-indices = show-sections.filter(idx => idx >= 1 and idx <= sections.len())
    filtered-indices.map(idx => sections.at(idx - 1))
  }

  // Cálculo del max-score modificado - Sin cambios
  let max-score = {
    if sections-to-display == () {
      scoring
    } else {
      calc.round(sections-to-display.map(s => s.scoring).sum(),digits: 2)
    }
  }
  let points = if max-score == 1 [punto] else [puntos]

  show: enum.item
  set enum(numbering: "a)")
  block(width:100%,[#box[*(#max-score #points)*] #description])

  for section in sections-to-display {
    display-section(
      show-answer: show-answers,
      show-criterion: show-criteria,
      ..section,
    )
  }
  if sections == () {
    if show-criteria { display-criterion(criterion) }
    if show-answers { display-answer(answer) }
    v(10pt)
  }
}

Is it possible for the numbering to be inside the block? Sometimes I encounter strange line breaks, like the one in the following image:

check out this issue for workarounds!

#1204 –
List and enum markers are not aligned with the baseline of the item’s contents

3 Likes

Duplicate of

@JESUS, feel free to flag your own post/message me if you think this is an error.