pdfpc
pdfpc copied to clipboard
Support beamer "next" note placement
Well, I'm fed up with the troubles and ugliness that show notes on second screen=*
causes.
The bug (not going to blame specifically beamer
, pgfpages
, hyperref
, or some combination thereof; but for brevity, will call it a beamer bug) is obviously a long-standing one and nobody of the maintainers of those packages is willing to find a proper fix.
To clarify, the issue is the PageLabels
entry; it is a "number tree" object in the PDF parlance, but for the purpose of this discussion (and the way beamer
uses it) it's essentially an array of strings -- each page index is associated with a label. When a variant of the show notes *
option is set, beamer
does the following: all real slides are labeled correctly taking into account the "overlayness", but the "notes" slides are assigned sequential numbers starting from 1, and these labels are interleaving. That is, if the real slides are A
, B
, C
, D
,..., PageLabels
will contain A
, 1
, B
, 2
, C
, 3
, D
, 4
,....
Now, with each notes slide shoved in the same page as the slide proper, the actual number of the pages halves, so the second half of the PageLabels
array points to nowhere, while the first one (A
, 1
, B
, 2
) is obviously different from the intended A
, B
, C
, D
. That's the root of the problem. BTW, I'm surprised that such a non-kosher PDF doesn't make any PDF reader issue a warning...
Anyway, it's the end of the preamble.
Now the idea. Why do we need this hack (show notes on second screen=*
) at all?! Let beamer notes fans use the "bare" show notes
, where the slides and notes do interleave, so the labels in PageLabels
are correct. We just need to deal with even pages as real slides and odd ones as notes. The whole logic is fit into a few trivial lines of get_slide_page()
. And autogrouping works.
Comments?
If I see it correctly, there is one problem with odd/even slides and the corresponding notes. If one slide has no notes, beamer produces no "empty" slide but puts the next content slide directly afterwards. So we have no chance of detecting the note slides in every case.
Damn, indeed... OK, it must be more complicated. Beamer sets slide numbers, but doesn't care about note pages, so it is easy to force their labeling to our liking. E.g.,
\renewcommand{\thepage}{note-\arabic{framenumber}}
Then the algorithm would be
- scan the document ignoring page labels in the "note-%d" format & autogroup;
- if a normal page ("%d") has a subsequent "note" page, it will be used as such.
What do you think?
Okay I have the following as an example:
\documentclass{beamer}
\renewcommand{\thepage}{note-\arabic{framenumber}}
\setbeameroption{show notes}
\begin{document}
\begin{frame}{Foo}
Bar
\note{Bar1}
\end{frame}
\begin{frame}{Foo2}
Bar2
\note{Bar2}
\end{frame}
\begin{frame}{Foo3}
Bar3
\end{frame}
\begin{frame}{Foo4}
Bar4
\note{Bar4}
\end{frame}
\end{document}
I get the following page labels:
1
note-1
2
note-2
3
4
note-4
This looks fine and I think we can detect note pages correctly. Just one question: Why does it work? :) I can't figure out why \thepage
is what we set for note pages but not for normal pages? Is beamer overriding that?
Is beamer overriding that?
Yes, here:
https://github.com/josephwright/beamer/blob/acd26cf1b6187d985de2bf401b86ed83aa8d689e/base/beamerbaseframe.sty#L71-L72
BTW, it implies that thispdfpagelabel
might be redefined somehow, but I cannot see where.
Of course, redefining thepage
is fragile, since it isn't guaranteed the user wouldn't override it, e.g., via something like
\setbeamertemplate{note page}{\thispdfpagelabel{mynote-\arabic{framenumber}}\insertnote}
Ideally, beamer should provide official options to redefine the slide and note page labeling patterns...
Of course, redefining
thepage
is fragile, since it isn't guaranteed the user wouldn't override it, e.g., via something like
\setbeamertemplate{note page}{\thispdfpagelabel{mynote-\arabic{framenumber}}\insertnote}
Ideally, beamer should provide official options to redefine the slide and note page labeling patterns...
It is, but the current approach is more luck than everything else :)
It is, but the current approach is more luck than everything else :)
By "current", do you mean in the master branch or discussed in this PR?
By "current", do you mean in the master branch or discussed in this PR?
Sorry, I mean the approach in master branch were we rely on broken page labels.
Hmm, I don't understand. The "broken page labels" is what makes autogrouping fail with beamer notes. Do you say it's better to be left as is?
Hmm, I don't understand. The "broken page labels" is what makes autogrouping fail with beamer notes. Do you say it's better to be left as is?
No :) I think everything is better than now. We should drop the support for on second screen
as you proposed.
OK, I implemented the basics.
- Q1: I think we should omit
beamerNotePosition
from .pdfpc files. It's something specific to beamer, i.e., LaTeX, and so one should usepdfpc.sty
for setting various meta properties, this one included. - Q2: Can we drop support of
show notes on second screen
in 4.6 or would it be too bold a move?
* Q1: I think we should omit `beamerNotePosition` from .pdfpc files. It's something specific to beamer, i.e., LaTeX, and so one should use `pdfpc.sty` for setting various meta properties, this one included.
I agree.
* Q2: Can we drop support of `show notes on second screen` in 4.6 or would it be too bold a move?
Changing your slides from on second screen
to the "new" behaviour is within reason. I think dropping the support of that feature is acceptable.
Q2: Can we drop support of show notes on second screen
Does this mean, that I can't be able to use my old presentations with show notes on second screen
?
Does that also mean that I have to double work to create presentations with \notes command to use with other software like dspdfviewer, then I use windows computer?
Does this mean, that I can't be able to use my old presentations with
show notes on second screen
?
Yep. But of course, you can keep v4.5 around...
Does that also mean that I have to double work to create presentations with \notes command to use with other software like dspdfviewer, then I use windows computer?
Does replacing a single string count as "double work"?!
Yep. But of course, you can keep v4.5 around... That's a problem, I'm not good for packaging apps.
For me drop beamer notes is like 'pdfpc teem' vendor lock, now I can use any software that support beamer notes without pdf recompile. After 4.6 I can't do one file for all software.
After 4.6 I can't do one file for all software.
You still can. Just the side by side notes will change. With v4.6 the note slide will be places after the content slide as a new physical slide (instead of putting everything in one physical slide)
That's a problem, I'm not good for packaging apps.
No need to package anything. Just download & compile (and don't remove afterward...). With the -N
flag used, you don't have to make install
. Can keep around as many versions as you like.
is like 'pdfpc teem' vendor lock
You can also consider the absence of the "next" beamer notes support in any XYZ software as their respective "lock". We don't invent anything new here, the show notes
option (without on the second screen
) has been in beamer for ages.
With v4.6 the note slide will be places after the content slide as a new physical slide
Now I'm completely confused, the notes slide will be a new pdf page, right? But how other software will treat it, as content page or as note page?
Now I'm completely confused, the notes slide will be a new pdf page, right?
Yes.
You never know, but you didn't knew with
on second screen
either.
You never know, but you didn't knew with on second screen
either.
@fnevgeny Is this PR are ready for preview upcoming changes? Does the "next" beamer notes support aware of multiple notes overlays? BTW I used below code to count slide number and notes number, may be it help you deal with notes numbering problem.
\newcounter{slidenumber}%
% below code should be used in beamer template section
\setcounter{slidenumber}{\insertpagenumber}%
\addtocounter{slidenumber}{-\insertframestartpage}%
\addtocounter{slidenumber}{1}%
I tried dspdfviewer that I use on old windows PC, It work with show notes on second screen
but with show notes
it's display only a half screen as it should by documentation.
Also I checked pympress, it's also support only show notes on second screen
. Now show notes on second screen
is most compatible way to show presentation with notes.
So If this PR will be on master branch It's ruins my workflow.
Is this PR are ready for preview upcoming changes?
Not sure I understand the question... It's certainly a work in progress, as its "draft" status shows. But of course you can try it out.
Does the "next" beamer notes support aware of multiple notes overlays?
Yes.
BTW I used below code to count slide number and notes number, may be it help you deal with notes numbering problem.
The problem with "on the second screen" is not in LaTeX as such, but the pgfpages
package that screws up the page labeling on a very low PDF level. Please see the first post above describing the problem.
So If this PR will be on master branch It's ruins my workflow.
First, I don't understand why a simple recompilation equals to "ruining" a workflow. Second, why do you need all the different apps to work with the same presentation? Just use one that fits best your needs.
why do you need all the different apps to work with the same presentation?
My workflow is following, I write my presentation to usb flash disk and go to lecture room with linux or windows xp PC. I obviously prefere linux pc, but sometimes it's busy, so I should move to windows computer. Some presentations require a last minute corrections, so I can end up with broken presentation if I choose wrong option in 'show notes'. So I'm tring to avoid such situation in future. If pdfpc will support all windows version, I'll install it on windows pc and problem will be gone.
simple recompilation
Recompilation sometimes is not an option, for old presentations due to syntax change in some latex packages (chemfig for ex.), missing symlink on tex style or images. Also each latex distribution update bringing incompatible change with packages for example chemfig or eskdx (it's not used for beamer, but a good example of such incompatibility).
why do you need all the different apps to work with the same presentation?
Aside from pdfpc, the docx file I can open in word. But if pc don't have word I can open it with libre office it will be 95% compatible. The dwg file I can open with autocad, but If I don't have autocad I can open it with nanocad, bricscad. The Kompas 3d file I can open only in Kompas 3d. For pdfpc from situation like docx and dwg we are moving to Kompas 3d situation. I hope that that analogue is understandable.
If pdfpc will support all windows version, I'll install it on windows pc and problem will be gone.
There is no reason pdfpc wouldn't compile under Windows. Somebody working with that OS has to do the work. And you can always bring with you a "live" Linux distro on the same USB stick and be independent of the OS installed.
Recompilation sometimes is not an option, for old presentations due to syntax change in some latex packages
Well, it's common for many software packages - at some point, authors decide to stop supporting something old or ugly etc, and move on. pdfpc is not different in this respect, you see. As I mentioned earlier, you can keep a previous version of pdfpc around.
To repeat, "notes on the second page" is a hack in the first place & furthermore is broken, and nobody is going to fix the related bug(s). Supporting this feature adds quite some ugly code in pdfpc (and still autogrouping remains broken). I again suggest you to read the first post in this thread.
I would love to have pdfpc work better with beamer notes, and this approach sounds good to me. Is there anything I can do to help get this merged?
Is there anything I can do to help get this merged?
Try persuading @einhander :)