formal-ledger-specifications icon indicating copy to clipboard operation
formal-ledger-specifications copied to clipboard

LaTeX error — Alignment of Agda code fails

Open HeinrichApfelmus opened this issue 7 months ago • 1 comments

I frequently encounter the error

! Package array Error: Empty preamble: `l' used.

when running

fls-shake --trace -j8 cardano-ledger.pdf

after adding Agda code and wanting to look at the output.

Making the alignment more messy works around this issue, but leads to worse output.

I started doing this a lot, for example defining

record Snapshot : Set where
  field
    stake        : Credential ⇀ Coin
    delegations   : Credential ⇀ KeyHash
    poolParameters  : KeyHash ⇀ PoolParams

instead of

record Snapshot : Set where
  field
    stake           : Credential ⇀ Coin
    delegations     : Credential ⇀ KeyHash
    poolParameters  : KeyHash ⇀ PoolParams

HeinrichApfelmus avatar Apr 10 '25 14:04 HeinrichApfelmus

I think it's probably related to https://github.com/agda/agda/issues/7290 and the even further upstream https://github.com/kosmikus/lhs2tex/issues/104. I've also seen this pop up nondeterministically sometimes, and just adding empty lines invalidates some cache sufficiently to fix it in that case. It's not ideal, but I'm not sure there's much more we can do save for actually submitting an upstream patch.

WhatisRT avatar Apr 11 '25 13:04 WhatisRT