jolars / moloch

A LaTeX Beamer theme, forked from the metropolis theme
https://ctan.org/pkg/moloch
Creative Commons Attribution Share Alike 4.0 International
91 stars 6 forks source link

feat: vertically centre progressbar section title on baseline #30

Closed jpcirrus closed 5 days ago

jpcirrus commented 4 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

@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 commented 3 weeks ago

@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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 6 days ago

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 commented 6 days ago

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

samcarter commented 6 days ago

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 commented 6 days ago

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 commented 6 days ago

@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 commented 5 days ago

@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 commented 5 days ago

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 commented 5 days ago

I see. Hm, I definitely don't want to move it further up. I was even considering lowering it so maybe this is a reasonable compromise. I think I'll merge this PR now, but I would be open for revisiting this later.

On Fri Nov 22, 2024 at 9:27 AM CET, John Purnell wrote:

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.