OrangeX4/typst-pinit

Highlighting/drafting not work for some page size

CHHC-L opened this issue · 2 comments

CHHC-L commented

Take equation-desc.typ as example.
Changing line 4 to

#set page(width: 700pt, height: 500pt, margin: 30pt)
#lorem(700)

or

#set page(width: 700pt, height: 300pt, margin: 30pt)
#lorem(200)

or just

#set page(width: 20cm, height: 16cm, margin: 30pt)

will disable all pin-based features, including highlighting and drafting.

(Changing the text length may make pin work again. It is speculated that this bug is related to the relative position of the pin, but I have not been able to find its root cause yet.

You should make sure that they are on the same page, e.g. can be replaced with

Equation written out directly (for comparison):

$ (q_T^* p_T)/p_E p_E^* >= (c + q_T^* p_T^*)(1+r^*)^(2N) $

Laid out with pinit:

#v(3.5em)

#block[
  $ (#pin(1)q_T^* p_T#pin(2))/(p_E#pin(3))#pin(4)p_E^*#pin(5) >= (c + q_T^* p_T^*)(1+r^*)^(2N) $

  #pinit-highlight-equation-from((1, 2, 3), 3, height: 3.5em, pos: bottom, fill: rgb(0, 180, 255))[
    quantity of Terran goods
  ]

  #pinit-highlight-equation-from((4, 5), 5, height: 2.5em, pos: top, fill: rgb(150, 90, 170))[
    price of Terran goods, on Trantor
  ]
]

#v(5em)

Paragraph after the equation.
CHHC-L commented

Got it, thanks)