Omikhleia / resilient.sile

Advanced book classes and packages for the SILE typesetting system
MIT License
21 stars 4 forks source link

folio-even is offset when left aligned, happens with new update of resilient.sile #42

Closed no-vici closed 10 months ago

no-vici commented 1 year ago

Hi there,

Last night, I updated resilient.sile and this happened, this did not happen with earlier versions.

I still can't where the problem comes from.

Before: image

After the update: image

My folio style is as follows:

folio-even:
  inherit: "folio-base"
  origin: "resilient.book"
  style:
    font:
      size: "0.80em"
    # paragraph:
      # align: "left"

folio-odd:
  inherit: "folio-base"
  origin: "resilient.book"
  style:
    font:
      size: "0.80em"
    paragraph:
      align: "right"
Omikhleia commented 1 year ago

Greetings, Good catch... There was an error in the default generated style (#30) It was introduced in 2.0.0 and I minimally fixed it in 2.0.1 (so it now generates the correct defaults), but earlier users are indeed affected (... and you are probably one of these very few early hard-core early adopters :cat: !), since existing styles are not re-generated...

On existing style files, theses styles should be fixed manually:

folio-even:
  inherit: "folio-base"
  origin: "resilient.book"
  style:
    paragraph:
      align: "left"
      before:
        indent: false

folio-odd:
  inherit: "folio-base"
  origin: "resilient.book"
  style:
    paragraph:
      align: "right"
      before:
        indent: false

FWIW, The root cause at the core of it was whether left/right alignment should have a paragraph indent or not... SILE's ragged environments don't have the parindent, but don't allow nesting (i.e. they always take 100% of the line width even if they were in an indented environment). So I re-implemented them to support nesting and used that in the styling methods... But I kept the paragraph indent, because there are cases when it might be needed (though not on folios, obviously). I am still not fully satisfied with how paragraph indents are managed (and to be complete, how to properly manage left and right skips), to be honest -- so I just went for the minimal fix here (= fix the default style for brand new documents).

Omikhleia commented 1 year ago

By the way, header-odd and header-even may need the same style-fixing too, i.e. that "before" entry in the "paragraph" styling:

      before:
        indent: false
Omikhleia commented 1 year ago

I should have mentioned that more clearly in the Release notes... Just did it (https://github.com/Omikhleia/resilient.sile/releases/tag/v2.0.1), sorry for the inconvenience.

no-vici commented 1 year ago

Greetings, Good catch... There was an error in the default generated style (#30) It was introduced in 2.0.0 and I minimally fixed it in 2.0.1 (so it now generates the correct defaults), but earlier users are indeed affected (... and you are probably one of these very few early hard-core early adopters cat !), since existing styles are not re-generated...

I've just seen what you changed for the init.lua, thank you for your clear explanation and the fix. Only the author knew what caused the problem. At first, I thought the frametrick or the offset parameter caused the shift, disabling them did not worked out, so the last resource is reaching out to you.

The logics of the style package are very advanced, I still don't quite get it, will have to read your code a dozen of times. You should write a book about how to code in Lua for SILE, diving into the underneath coding part is quite a fun experience, and you know it all. I do know that you don't expect us, the end users, mention too much about the internal bits ;) and I don't mean to be offensive ;)

no-vici commented 1 year ago

By the way, header-odd and header-even may need the same style-fixing too ...

The header wasn't affected for my case ;)

no-vici commented 1 year ago

I should have mentioned that more clearly in the Release notes... Just did it (https://github.com/Omikhleia/resilient.sile/releases/tag/v2.0.1), sorry for the inconvenience.

The users should thank you for your great work and kindness. I already own you too much.