slds-lmu / lecture_i2ml

I2ML lecture repository
https://slds-lmu.github.io/i2ml/
Creative Commons Attribution 4.0 International
145 stars 81 forks source link

bugfix #1108

Closed mb706 closed 1 year ago

mb706 commented 1 year ago

@jemus42 can you check if this fixes things for you?

jemus42 commented 1 year ago

On TeX Live 2023: Produces a PDF without obvious (to me) problems, but I get this warning

Reference `endlect:@@1' on page 1 undefined on input line 24

Not sure what \endlecture does, reset slide numbers? https://github.com/slds-lmu/lecture_i2ml/blob/764a16f62b23a3bd71a7c43c274c2d7a4d66bcc9/style/lmu-lecture.sty#L140-L144

On 2022, I get a similar error

! Package calc Error: `\calc@A ' invalid at this point.
mb706 commented 1 year ago

As I understand it, \endlecture writes out the current slide number to the aux file, which is then used as the y in the x / y footer.

jemus42 commented 1 year ago

As far as I can tell this works now - thing is I don't understand the problem (or solution).

In general though, what's happening there, anyway? We're redefining \ref (or rather \lectureref) due to beamer redefining that, to ensure slide numbers are displayed correctly? But why wouldn't they be?

mb706 commented 1 year ago

I think what is supposed to happen here is that we want the footer to display "page X of Y" for each lecture, even if there are multiple \lecture{...} .... \endlecture in a single tex file -- this way you can \input many lectures to get the total collection of slides, and each lecture has its own page counter. One way to solve this would be to do \label{lect:<lecturenumber>} on the first page and \label{endlect:<lecturenumber>} on the last page and do some calculations by subtracting \pageref{lect:<lecturenumber>} from the current frame number etc.

My impression is that the code in our .sty file is a copy-pasted version of the Latex source code that re-implements the \ref / \pageref logic for this purpose. I think the problem is that we copy-pasted and re-implemented some, but not all, of the \ref logic. So when this commit in this PR changed how \@setref works, it broke our code (added some \@empty tokens that our code doesn't anticipate). My change here should work regardless of the presence of \@empty tokens by simply looking for the \null token at the end.

mb706 commented 1 year ago

Since this works now, I am going to merge. As a medium term task, we should probably clean up this code. I think it does a lot of things that we don't actually need, and the other things we should probably solve "the recommended way".