Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: vertically centre progressbar section title on baseline #30

Merged
merged 5 commits into from
Nov 22, 2024

Conversation

jpcirrus
Copy link

Section pages with sectionpage=simple have the section title vertically centered in the frame. But, those with sectionpage=progressbar (the default) do not. This commit corrects that.

@jolars
Copy link
Owner

jolars commented Oct 31, 2024

I'm not completely convinced this is better than the current behavior, but not sure. What is your motivation for centering with respect to only the text?

@jpcirrus
Copy link
Author

The current behavior is not centered in either case, and in investigating a solution found that rather than having all the content centered, because the title is much more ink heavy than the thin progress bar, visually it appeared better. Particularly in the case when you have a section page with a progress bar followed immediately by a sub-section page (i.e. simple) where it looked unbalanced.

@jolars jolars changed the title fix: vertically centre progressbar section titles to match those of simple feat: vertically centre progressbar section titles to match those of simple Oct 31, 2024
@jolars
Copy link
Owner

jolars commented Oct 31, 2024

I see. You might be right, I'll have to spend some time looking over and comparing the alternatives. I see that you're right about the current version not being centered either, so at least that should be changed to be the case. If someone else have an opinion here, feel free to chime in. I don't have a strong opinion myself. Maybe @samcarter?

@samcarter
Copy link

The problem with human perception: it does not always follow geometric rules :)

I don't think that the different styles have to put the title in the exact same spot. To me, the higher title from the main branch looks more harmonic.

Main: Patch:
main patch

@samcarter
Copy link

I think the situation here isn't dissimilar than what is described in https://en.wikipedia.org/wiki/Mat_(picture_framing)#Decoration

The most common used matting has an equal margin all the way around. On artwork with the visual center lower than actual center,.[6] Bottom weighting, or off-sets are used frequently in matting. The bottom margin are made larger than the side and top margins. When looking at an image, the eyes tend to center higher up than the physical center of the image. By creating a larger bottom margin and off-setting the mat you draw the eye to physical center of the image. Top Center is a subset of bottom weighting where the top and side margins are equal, which creates a visually pleasing effect. This is particularly true in mats where the borders are not equal, such as an 11x14 with an 8x10 opening.

The progress bar makes the lower part of the frame heavier and thus a perfectly centred title looks off-centre.

@jolars
Copy link
Owner

jolars commented Oct 31, 2024

Hm, yes, I tend to agree. Nice reference. But I think it's true, like @jpcirrus suggests, that the fact that the bar is so thin relatively speaking does make this less clear-cut. On the other hand, as you say, geometry and human perception are two different things.

On the whole, I'm happy to accept the PR if it just removes removes just the baselineskip on line 285, so that the entire block is centered. At least it would be a minor improvement for you, @jpcirrus.

@jpcirrus jpcirrus changed the title feat: vertically centre progressbar section titles to match those of simple feat: vertically centre progressbar section title on baseline Oct 31, 2024
@jpcirrus
Copy link
Author

Yes, I agree, the section title does look better when centered on its baseline in the normal case. In proposing centering the title to match that of simple I had been creating a presentation where a section page with a progress bar was followed immediately by a simple sub-section page, and when viewed projected there was noticeable height difference when transitioning quickly between the two slides. However, I think your suggestions are better in the general case.

@samcarter
Copy link

@jpcirrus It might be interesting to see how it would look like if the simple title is moved up to match the one with the progress bar.

@jpcirrus
Copy link
Author

@samcarter yes, I had thought about that! Unfortunately, I am really busy today and it will only be this evening when I get a chance to take a look.

@jpcirrus
Copy link
Author

Further to @samcarter's comment, with sectionpage=simple:

Currently:
20241101T114242-section-page-simple-before

After, adding \vspace{0.5\baselineskip} as the last line in the \defbeamertemplate{section page}{simple}{ command:
20241101T115645-section-page-simple-after

In my opinion it looks better raised, especially when projected, and exactly matches the title height when sectionpage=progressbar. Thoughts?

@samcarter
Copy link

Further to @samcarter's comment, with sectionpage=simple:

Currently: 20241101T114242-section-page-simple-before

After, adding \vspace{0.5\baselineskip} as the last line in the \defbeamertemplate{section page}{simple}{ command: 20241101T115645-section-page-simple-after

In my opinion it looks better raised, especially when projected, and exactly matches the title height when sectionpage=progressbar. Thoughts?

Thanks for the comparison! Personally, I prefer the one with the higher title.

@jolars
Copy link
Owner

jolars commented Nov 5, 2024

Thanks for the suggestions here. I experimented a bit with this yesterday and it's not immediately clear to me what to do. I think raising the title on the simple looks fine, but I think the most important combination to optimize for is when sectionpage is set to the same value as subsectionpage, where I think the fact that the text jumps as you switch is more noticeable.

I guess it would be possible to ignore the subtitle when defining the layout, and adopt the raise you suggested previously (although I think we need \vspace{\baselineskip - 1ex + 0.4pt + 3\lineskip} or something similar to have it match exactly.

I also noticed just now that the alignment of the subtitle is not great for the progressbar template. Also I think the subtitle in the simple template is maybe too close to the title. So there are probably several small improvements that can be made here.

@jolars
Copy link
Owner

jolars commented Nov 21, 2024

I have pushed some changes. The current idea I have is to add \vphantom{\insertsubsectionhead} for section pages. This makes it so that the section title aligns when a section page is immediately followed by a subsection page, as long as the subsection title does not span more than one line. I've done this both for simple and progressbar pages, and the alignment of the section title should be identical for progressbar and simple pages.

This feels somewhat hacky, but maybe it's fine? Let me know what you think.

@jolars
Copy link
Owner

jolars commented Nov 21, 2024

Oh, I also fixed the alignment of the subsectiontitle on progressbar pages, which was not right (at least not to me) before.

@samcarter
Copy link

I have pushed some changes. The current idea I have is to add \vphantom{\insertsubsectionhead} for section pages. This makes it so that the section title aligns when a section page is immediately followed by a subsection page, as long as the subsection title does not span more than one line. I've done this both for simple and progressbar pages, and the alignment of the section title should be identical for progressbar and simple pages.

This feels somewhat hacky, but maybe it's fine? Let me know what you think.

use a \strut instead? This will always have the same height.

@jolars
Copy link
Owner

jolars commented Nov 21, 2024

I have pushed some changes. The current idea I have is to add \vphantom{\insertsubsectionhead} for section pages. This makes it so that the section title aligns when a section page is immediately followed by a subsection page, as long as the subsection title does not span more than one line. I've done this both for simple and progressbar pages, and the alignment of the section title should be identical for progressbar and simple pages.
This feels somewhat hacky, but maybe it's fine? Let me know what you think.

use a \strut instead? This will always have the same height.

Great, thanks! Now It's just a matter of deciding whether it would make more sense to lower everything slightly. The section title is possibly a little too high up now.

@jpcirrus
Copy link
Author

@jolars these changes look really good. Personally, I think the section pages look better with the titles slightly raised, especially when there is a subsection title. In particular, when the progressbar section page titles are raised by \vspace{0.5\baselineskip}, and correspondingly, for the simple section page when \vspace{\baselineskip - 1ex + 0.4pt} is altered to \vspace{\baselineskip + 0.4pt}.

@jolars
Copy link
Owner

jolars commented Nov 22, 2024

@jolars these changes look really good. Personally, I think the section pages look better with the titles slightly raised, especially when there is a subsection title. In particular, when the progressbar section page titles are raised by \vspace{0.5\baselineskip}, and correspondingly, for the simple section page when \vspace{\baselineskip - 1ex + 0.4pt} is altered to \vspace{\baselineskip + 0.4pt}.

Good, but are you sure that's what you want with the new change? Everything is raised by some similar amount now since there is a strut that wasn't there before (for the section page that is).

I'm attaching an example pdf of section and supages sat the current sate of this pr.

moloch-sectionpages.pdf

@jpcirrus
Copy link
Author

Yes, but I would get other feedback too. I have been using customised section page templates with the titles raised above the geometric centre after consideration of the above comments from @samcarter, and asking for feedback from colleagues. Also, I am using aspect ratios with less height: 16:9 and 16:10. When projected, especially with a subsection title, the text had appeared to be too low. The amendments I suggested were after taking into account the addition of the \strut on the section page.

@jolars
Copy link
Owner

jolars commented Nov 22, 2024 via email

@jolars jolars merged commit 5a98c69 into jolars:main Nov 22, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants