#Numbering nested lines

1 messages · Page 1 of 1 (latest)

earnest grove
#

Hello, I'm currently taking a course on logic and natural deduction, and I would like to use Typst for writing natural deduction proofs in the Fitch-style. As seen in the image, for this style of proofs, there are line numberings and boxes, but the line numberings go on the outside. Is this achievable in Typst?

bold flume
#

Seems like just an ordered list to me with some #h() calls

earnest grove
#

Because this is all that I have been able to come up with

earnest grove
#

Sort of got it, by using tables

earnest grove
#

By recursively mirroring the table structure

bold flume
#

I can't seem to open the attachment at work, but i tried to solve this my way and it turned out to be more difficult than I thought. The spacing between the numbers in the last picture doesn't appear to be uniform. try and add a row(3%) to your table and play with the value.

#

?r

#grid(
  columns: (10%,20%,20%),
  rows: (2.5%),
  align:(left, left, left),
  [1], [$y = x + 1$], [premise],
  [2], [$f(x) = 5 - x$], [premise],
  
  [3],
  place(
    left+top, float:true,
    dx:-0.1cm, dy:-0.1cm,
    rect(
      stroke: 0.5pt,
      height:2.4cm,
      width:4.7cm,
      inset:0.1cm,
      [$P(x_0) -> Q(x_0)$])
  ),
  [$x e 1$],
  
  [4], [$P(x_0)$], [$-> e 3,4$],
  [5], [$Q(x_0)$], [$x i 3-1$],
  [6], [$x Q(x)$], [$x e 2$],
  [7], [$g(x)=2x^2 + 3x$], [premise]
)
bold flume
#

this is my solution, it's not flexible because you need to manually change the height of the rectangle when you add more rows. also, sorry for the mess