jolars / moloch

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

Feedback about transitioning from metropolis #6

Closed samcarter closed 8 months ago

samcarter commented 8 months ago

Background story: I'm in the process to move some of my answers on various Q&A sites from metropolis to moloch. So far I've converted about 100 answers.

The transition from metropolis to moloch seems very smooth, in most cases a search&replace for metropolis->moloch is all that is needed. However I noticed 3 situations which need some manual intervention. I suspect they are all design decisions to get rid of the considerable technical debt of metropolis, but maybe you could take the following points just as discussion starters if the transition could be made smoother? Maybe a chapter in the doc on how to transition from metropolis would already be a solution?

Default layout of the footline

I love that (unlike metropolis), moloch is now compatible with beamer's page number in head/foot template. Have you considered setting \setbeamertemplate{page number in head/foot}[framenumber] as default in moloch? The disappearance of the frame number is probably the most noticeable difference between the two themes.

numbering=fraction

About 30-40% of the question authors use the numbering=fraction option

block=fill

In approximately 15-20% of the questions, the authors used the block=fill options. Is there any way to make their life easier?

jolars commented 8 months ago

Thanks for the report!

Default layout of the footline

I love that (unlike metropolis), moloch is now compatible with beamer's page number in head/foot template. Have you considered setting \setbeamertemplate{page number in head/foot}[framenumber] as default in moloch? The disappearance of the frame number is probably the most noticeable difference between the two themes.

Sure, I'm fine with making that the default. I guess it's simple to revert anyway if one should want to.

numbering=fraction

About 30-40% of the question authors use the numbering=fraction option

  • repurpose the option to change the page number in head/foot template?
  • add a descriptive error message, maybe with a link to some explanation how to change the numbering?

Sure. I guess it wouldn't hurt to bring the option back, but maybe keep it soft-deprecated (since I prefer to rely on the standard beamer API if possible).

block=fill

In approximately 15-20% of the questions, the authors used the block=fill options. Is there any way to make their life easier?

  • bring the option back?
  • add an additional colour theme to get filled blocks, which users can load in addition to the moloch theme? (this could even be useful for non-moloch users who might want to have gray blocks)
  • add a descriptive error message, maybe with a link to some explanation how to get filled blocks?

Hm, I'll give this one a bit more thought but if it's simple enough I wouldn't mind supporting it again. I don't think the filled blocks really fit the clean, minimal design of the theme, but if that many people use them, then I see a point in bringing them back just to keep backwards compatibility with metropolis.

samcarter commented 8 months ago

numbering=fraction

About 30-40% of the question authors use the numbering=fraction option

  • repurpose the option to change the page number in head/foot template?
  • add a descriptive error message, maybe with a link to some explanation how to change the numbering?

Sure. I guess it wouldn't hurt to bring the option back, but maybe keep it soft-deprecated (since I prefer to rely on the standard beamer API if possible).

Beamer also has a couple of deprecated options, for which it will issue a warning with a short hint what to do instead:

https://github.com/josephwright/beamer/blob/main/base/beamer.cls#L236-L240

You could do something similar and than change it to an error message sometime later? Or just add section in the doc.

samcarter commented 8 months ago

block=fill

In approximately 15-20% of the questions, the authors used the block=fill options. Is there any way to make their life easier?

  • bring the option back?
  • add an additional colour theme to get filled blocks, which users can load in addition to the moloch theme? (this could even be useful for non-moloch users who might want to have gray blocks)
  • add a descriptive error message, maybe with a link to some explanation how to get filled blocks?

Hm, I'll give this one a bit more thought but if it's simple enough I wouldn't mind supporting it again. I don't think the filled blocks really fit the clean, minimal design of the theme, but if that many people use them, then I see a point in bringing them back just to keep backwards compatibility with metropolis.

All good points! From the code complexity, it should be similar to your light/dark background option, but it might clutter the code a bit....

One point in favour of adding some kind compatibility for this: unlike the frame numbers, which your users can easily change with a single line of code (which is documented in the beamer manual), it is a bit more difficult for a user to bring back the filled blocks. They would have to dig through the metropolis front theme and then do something like

\documentclass{beamer}
%\usetheme[block=fill]{metropolis}
\usetheme{moloch}

\setbeamercolor{block title}{%
  use=normal text,
  fg=normal text.fg,
  bg=normal text.bg!80!fg
}
\setbeamercolor{block body}{%
  use={block title, normal text},
  bg=block title.bg!50!normal text.bg
}
\setbeamercolor{block title alerted}{%
    use={block title, alerted text},
    bg=block title.bg,
    fg=alerted text.fg
}
\setbeamercolor{block title example}{%
    use={block title, example text},
    bg=block title.bg,
    fg=example text.fg
}
\setbeamercolor{block body alerted}{use=block body, parent=block body}
\setbeamercolor{block body example}{use=block body, parent=block body}  

\begin{document}

\begin{frame}
\begin{block}{title}
content...
\end{block}
\begin{alertblock}{title}
content...
\end{alertblock}
\begin{exampleblock}{title}
content...
\end{exampleblock}
\end{frame}

\end{document}
jolars commented 8 months ago

Okay, the first two issues have been solved with 9a013e4d46e1c009f058862525c4d92983c4103c and 54e0fce68b39a10aabf646c000ffa6656dede748.

I'll see about the third issue shortly. As I recall, there was a problem with spacing in the block environments in metropolis.

samcarter commented 8 months ago

I vaguely remember the problem of metropolis messing with the spacing, let me see if I can find my fix again.

samcarter commented 8 months ago

In normal beamer, blocks are a bit oversized so that the text aligns with the surrounding text:

\documentclass{beamer}

\usepackage{lipsum}

\usecolortheme{orchid}

%\usetheme[block=fill]{metropolis}

\begin{document}

\begin{frame}
  \lipsum[2]
  \begin{block}{title}
  \lipsum[2]
  \end{block}
\end{frame}

\end{document}

Screenshot 2024-03-03 at 13 54 05

Metropolis has this strange approach to make them smaller in case the background is filled:

\documentclass{beamer}

\usepackage{lipsum}

%\usecolortheme{orchid}

\usetheme[
block=fill
]{metropolis}

\begin{document}

\begin{frame}
  \lipsum[2]
  \begin{block}{title}
  \lipsum[2]
  \end{block}
\end{frame}

\end{document}

Screenshot 2024-03-03 at 13 54 53

samcarter commented 8 months ago

... but if you'd only set the colours in moloch, the text would automatically align like in normal beamer:

\documentclass{beamer}

\usepackage{lipsum}

%\usecolortheme{orchid}

\usetheme[
%block=fill
]{moloch}

\setbeamercolor{block title}{%
  use=normal text,
  fg=normal text.fg,
  bg=normal text.bg!80!fg
}
\setbeamercolor{block body}{%
  use={block title, normal text},
  bg=block title.bg!50!normal text.bg
}
\setbeamercolor{block title alerted}{%
    use={block title, alerted text},
    bg=block title.bg,
    fg=alerted text.fg
}
\setbeamercolor{block title example}{%
    use={block title, example text},
    bg=block title.bg,
    fg=example text.fg
}
\setbeamercolor{block body alerted}{use=block body, parent=block body}
\setbeamercolor{block body example}{use=block body, parent=block body}  

\begin{document}

\begin{frame}
  \lipsum[2]
  \begin{block}{title}
  \lipsum[2]
  \end{block}
\end{frame}

\end{document}

Screenshot 2024-03-03 at 13 56 19

jolars commented 8 months ago

Thanks, that's what I'll do then. I think keeping the text aligned is probably the right thing to do anyway (and is going to cause less headache for me). Thanks for the investigation!

samcarter commented 8 months ago

You're very welcome!

jolars commented 8 months ago

All of these issues should be resolved now, but I noticed that there is a problem in the spacing with the filled blocks, which is due to the \linespread{1.15} setting.

image

The spacing is excessive between the start of the block title body and the top of the body container.