Comments (6)
If the \plain{[title]}{body} command for dark frames matched Beamer frame syntax, it would allow Beamer exporters like emacs org-mode to reference it using existing templates.
Sounds like a good idea!
I've never done it before.
Me neither. So do you want to continue or should I investigate at some point?
from mtheme.
I can at least provide some extra information after the presentation I'm using the theme for is done :)
from mtheme.
What is meant by "Beamer frame syntax"? If you just want
\begin{plainframe}{...title...}
...
\end{plainframe}
we should be able to accomplish this using \newenvironment
instead of \newcommand
. Or am I missing something?
from mtheme.
I've finally done some research into this long-standing issue. I believe I originally misunderstood @talexand's request; by "matching frame syntax", he means implementing the standout plain slides as an optional argument to frame
.
\begin{frame}[standout]
Questions?
\end{frame}
(Obviously, we couldn't use plain
as the argument, as this already exists in Beamer. I've called the option standout
for now since I couldn't think of anything better, but I'd welcome other ideas for what to call it.)
As I understand it, doing this would allow users of emacs org-mode to generate the above frame using something like the following input. (Note: I have not actually tested it.)
* A standout slide :B_ignoreheading:
:PROPERTIES:
:BEAMER_opt: standout
:END:
Questions?
Advantages
Moving to an optional frame argument offers a couple mild advantages in addition to emacs org-mode compatibility.
- The syntax is more consistent with other frames.
- It could make it very slightly easier to adapt a presentation to or from ᴍᴇᴛʀᴏᴘᴏʟɪs.
- We could implement the new option in the inner theme, making it possible to use independently of the font and color themes. (For some reason, I feel more comfortable defining a new frame option in the inner theme than a new command.)
Disadvantages
The main disadvantage of this proposal is that I don't see a way of implementing the allsmallcaps
and allcaps
options of titleformat plain
. This can be mitigated by keeping \plain{...}
as a shortcut for \begin{frame}[standout]{#1}\metropolis@plaintitleformat{#2}\end{frame}
Implementation
To implement the optional argument, we just have to move all the code from \plain
to a block that is executed when the standout
option is called. (See the keyval
package for details.) Most of it is straightforward; we begin a group, change the colors and fonts, and set a \centering
alignment.
(This code is all executed before the frame is fully set up, so adding a \MakeLowercase
here for titleformat plain=allsmallcaps
would break the frame rather than applying to its contents.)
\providebool{metropolis@standout}
\define@key{beamerframe}{standout}[true]{%
\booltrue{metropolis@standout}
\begingroup
\setkeys{beamerframe}{c}
\setkeys{beamerframe}{noframenumbering}
\ifbeamercolorempty[bg]{palette primary}{
\setbeamercolor{background canvas}{
use=palette primary,
bg=-palette primary.fg
}
}{
\setbeamercolor{background canvas}{
use=palette primary,
bg=palette primary.bg
}
}
\centering
\usebeamercolor[fg]{palette primary}
\usebeamerfont{plain title}
}
Then, we just need to end the group after the standout slide is finished in order to restore the colours and fonts for the rest of the presentation. Unfortunately, the obvious solution — \AfterEndEnvironment{frame}{...}
— doesn't work. I've therefore chosen to add the \endgroup
to \beamer@reseteecodes
, which I believe is run exactly once at the end of each slide. I'm not 100% confident of this, though, so if we choose to go this route we'll need to test extensively to make sure there are no unintended consequences.
\apptocmd{\beamer@reseteecodes}{%
\ifbool{metropolis@standout}{
\endgroup
\boolfalse{metropolis@standout}}{}
}
Discussion
The primary question we should answer here is do we want to implement plain slides as an optional argument to frame
? (Presumably we will still support the \plain
syntax as well.) If the answer is "no" we can just close this issue; if it's "yes", I will pull request the above implementation and we can discuss there if it works or can be improved.
from mtheme.
Thanks for looking into this further. I haven't been able to get to this but I still think it would be a good feature.
from mtheme.
The primary question we should answer here is do we want to implement plain slides as an optional argument to frame?
Tough call. However, for the sake of the listed advantages I'd support your proposal for the standout
option. In the long run (i.e. for 2.0), I'd deprecate the \plain
command though.
from mtheme.
Related Issues (20)
- Dead Link to Paul Tol's technical note for SRON
- Not sure how to use Fira Fonts HOT 7
- mtheme license HOT 1
- In knitr, can't get metropolis theme to work with \mathbf and greek letters, or with \bm from the bm package HOT 2
- includeonlylecture and subsectionpage are not compatible HOT 1
- Supported range / Fallback setup with XeLaTeX? HOT 3
- Italic in verbatim environment
- Tikz node color changes to black after \color{} HOT 1
- Fix make demo
- How can I change the font of this theme?
- Create a whiteboard sidebar when aspectratio=169
- page number in frame title
- Change mtheme license
- allowframebreaks breaks frame very strange
- Don't include appendix pages in progress bar without use of appendixnumberbeamer
- Switch sectionpage and subsectionpage to standout mode HOT 1
- .
- Issue with texlive 2023 HOT 8
- The manual contains outdated pandoc instructions
- Make word color Green HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mtheme.