matze / mtheme Goto Github PK
View Code? Open in Web Editor NEWA modern LaTeX Beamer theme
A modern LaTeX Beamer theme
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.
I can come up with something but I need a little bit of a sketch on defining frames in LaTeX style files as I've never done it before.
I suggest we break beamerthemem.sty
into an "inner theme" and "outer theme" similar to the structure of beamerthemedefault
. The main theme file would then include the various sub-packages and forward options appropriately. This would allow users to apply the structural parts of the theme independently from the colour and font themes. This would address outstanding issues with #8 and #85.
I usually use Beamer's [t] option. When doing so with mtheme, it causes the text of the section header slides to also get pushed to the top of the slide, which looks strange (at least to me). It seems they should always be centered.
I propose the following patch, which forces the section slides to always be centered:
diff --git a/beamerthemem.dtx b/beamerthemem.dtx
index ad5ad0d..85bf59c 100644
--- a/beamerthemem.dtx
+++ b/beamerthemem.dtx
@@ -412,7 +412,7 @@
\ifbeamer@inframe
\sectionpage
\else
- \frame[plain]{\sectionpage}
+ \frame[plain,c]{\sectionpage}
\fi
}
\fi
So I had a look at the theme, and it looks great. Only, how do I go about installing it? I installed pygments, Fira Sans, and use XeLaTex, but what do I do with the .sty-files. It seems I need to do a "make" of some sorts, but what does that mean? Could you perhaps give an overview of the steps I need to make? Sorry for my ignorance.
As decided in #81 the version number in the title of the documentation PDF is hardcoded for now. This should be fixed, that it is automatically determined from the package version und date of the beamermtheme.dtx
file.
Hi,
The clean
target in the Makefile should remove the directory _minted-demo
, with git clean -d
for example.
Not deleting this directory between builds can cause puzzling issue such as:
! Undefined control sequence.
<argument> \PYGtrac
{k}{\PYGtracZbs {}documentclass}\PYGtrac {n+nb}{\PYG...
l.2 ...acZob{}}beamer\PYGtrac{n+nb}{\PYGtracZcb{}}"
while Pygments (and pygmentize) were correctly installed.
This issue was caused by the minted files generated during a previous attempt at build the demo before I installed pygmentize.
It took me a moment before realising this, and I guess you know how unpleasant it is to debug strange error with LaTeX :-).
Here are the error message and minimal example that produces it:
[44]
! Arithmetic overflow.
\progressbar@titleprogressbar ...essbar@tmpcounta
\divide \progressbar@tmpdi...
l.51 \test
?
\documentclass{beamer}
\usetheme[titleprogressbar]{m}
\newcommand{\test}{\begin{frame}{Title}blahblahblah\end{frame}}
\begin{document}
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\test
\end{document}
Hi!
Was it an intention to make links indistinguishable from the plain text? Or can something beer done about it? Sometimes it worth making them underlined.
How can I put the progress bar in the footer, without inserting the section head?
Thanks!
(sorry, if such questions don't belong here - didn't know where to go/put)
The manual installation of the theme is annoying and maybe difficult for beginners. For example I have to install the theme on every PC and for every user separately. So I think it would help a lot to distribute the theme as a package via CTAN. It would also reach more users, as a lot of the TeX community is probably not active on GitHub. Also this would make other ways of distribution like the .deb package obsolete. We would have only one way of distribution left for everyone.
As far as I looked into it, this is what has to be done:
\ProvidesPackage
commandstexdoc {packagename}
.m
to something more self-explanatory like modernbeamer
.If I get it right the folder structure of the zip file should look like this in our case:
mtheme.zip:
mtheme/
README % to use as a changelog
doc/
mtheme.md % renamed README.md
mtheme.pdf % using pandoc created documentation
tex/
beamercolorthememetropolis.sty
beamerfontthememetropolis.sty
beamerthemem.sty
Or for a very simple package without documentation just:
mtheme.zip:
mtheme/
README.md
beamercolorthememetropolis.sty
beamerfontthememetropolis.sty
beamerthemem.sty
Does anybody have experience with CTAN and can confirm my infos or can give some more insights?
Mtheme is an absolutely BEAUTIFUL, intelligent, well-designed theme. Thank. You!!
My slides often have two sections of itemized (bulleted) lists, i.e.:
Lorem
Ipsum
I'd like to automatically add some additional vspace between "* b" and "Ipsum", but my attempts so far have also pushed Lorem downwards. Can you offer a suggestion that won't break the overall template?
Thanks!
Hi. I really like this theme.
I found that I had to have the usetitleprogressbar
has to be engaged for the section titles to work. However in the demo.tex file the option is not used despite section titles being included.
The given command \plain{}{Questions?} doesn't show the text on the slide. It pushes it below the background instead. It would be better to type \plain{Questions?}
This MWE:
\documentclass[titleprogressbar]{beamer}
\usetheme{m}
\usepackage{lipsum}
\begin{document}
\begin{frame}[allowframebreaks]
\frametitle{A Frame Title}
\lipsum
\end{frame}
\end{document}
bombs with
...
Runaway argument?
! TeX capacity exceeded, sorry [main memory size=5000000].
\reserved@a #1#2->\let #2#1\reserved@a
l.9 \end{frame}
...
Hi again, two quick questions.
On the title page is it possible to add a logo easily?
How can the section title pages be made to have the colours in the graphic in the Readme file, i.e. teal background, orange progress bar, white title as they currently appear with a white background and teal title and progress bar.
Many thanks
Adding this issue to consolidate discussion about the fira
bundle.
In #75, @ChipmunkMath made us aware of these packages:
fira
// Fira Sans Fonts: Provides Fira Sans and Fira Mono fonts, and works outside of xelatex/lualatex. I was playing around with it and typesetting just in plain pdflatex. Seems to be in pretty good shape, although it's important to make sure you're updated to the most recent version (2015-05-23) which fixes some major gaps.
The included packages — FiraSans.sty
and FiraMono.sty
purport to provide the Fira fonts for pdflatex, xelatex, lualatex, etc. If it works, it would remove the need for users to find and install the Fira fonts, which is the biggest barrier for a prospective user to adopt this theme. It would allow us to remove all the platform-specific instructions for installing the Fira fonts or manually changing the theme if Fira has an unexpected name. And as an added bonus, it would allow full compatibility with pdflatex
for the conservative users who don't want to use xelatex
for whatever reason.
As @ChipmunkMath points out, though
There is a potential issue in that fira is extremely recent, so unless a user has been doing a good job keeping their TeX install up to date, they might not have the package. Similarly, even if they have the package, it's important for them to be on the most recent version (extremely recent, less than a month ago), as the older version was missing some important things. But it should be easier to tell a potential new user to just go run TeX Live (or equivalent) and make sure they have the most current version of fira than having them do the current install method.
As a caveat, though, I'd recommend extensive testing with the fira package before adopting it into the metropolis theme as a required package. When I was playing with it before, it didn't seem to be 100% perfect. It was very close, but there were some minor issues, so we should be careful before choosing to work with it.
This issue is for discussion on the fira
bundle and whether we should use it instead of \fontspec
and the user's font domain for Fira Sans. @ChipmunkMath , do you have any details on the minor issues you came across with fira
?
Like your theme. I have a slight problem with the blocks. Why they are showing now "visible" color in the header? (In the demo.pdf)
Under Customisation > Package options
I believe the switch for the progress bar option should read "useTitleProgressBar"
\usetheme[useTitleProgressBar]{m}
This should come in handy for people who include pre-made white images in their presentations.
Thanks for the beautiful template!
I found some incompatibilities when using it in Pandoc:
useTitleProgressBar
and nooffset
cannot be set\plain{...}
doesn't workHere is a minimal example:
---
title: title
author: author
---
# Slide
- a
- b
- c
$ pandoc slides.md -t beamer -V theme:m --latex-engine xelatex -o slides.pdf
Edit:
\usepackage{lmodern}
in the default Pandoc template.For 3) \usetheme
may be changed as follows: \usetheme$if(themeopts)$[$themeopts$]$endif${$theme$}
A workaround for 4) is to place the \plain{...}
command in the hader:
include-after:
- \plain{Questions?}
ignorenonframetext
from \documentclass
and using \maketitle
instead of \frame{\titlepage}
.I mistakenly assumed that these were bugs in your template. I will create a pull request and try to get my fixes merged into Pandoc's upstream.
Especially the background is not set correctly.
The subpackage pgfplotsthemetol
is not getting installed by default via make install
.
I had to manually copy over the resulting .sty file. Is this on purpose?
Right now the pgfplots theme is hardcoded into the Beamer theme itself. This is not good for various reasons. First of all, the color definitions might clash with a different color theme (once #64 is merged this will be much more of an issue). And even worse: pgfplots might not be available.
Ideally we would have a command to load a pgfplot theme just like \usecolortheme
, i.e. something like \usepgfplottheme
. In the best case pgfplots would provide that, but I don't know about such thing.
This command could also take care to not issue pgfplotset
in case pgfplots is not available.
Although the coding style is overall quite decent already, I think it is reasonable to set up a small wiki page. Helps to keep us all on the same page.
@modk: noted ;-)
Hi there,
Thanks for the theme. Facing a bit of an issue getting it to build inside a docker container.
When I run the build.sh, get the following,
! LaTeX Error: File `beamerthemem.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
The file beamerthemem.sty does not exist in the current working directory(repo). Surprisingly, the repo which I had downloaded a few days ago on a different computer has the file. Can anyone point out if I am missing some step ?
The block paddings and margin do not look particularly nice when using blockbg
(as can be seen on the first screenshot). What you see on the second screenshot is the definition I used in the hsrmbeamertheme. If you agree I will integrate the code into the theme once we decided how we will further organize the development regarding the dtx
implementation. Maybe we can optimize it even more. E.g. a little vskip
before the block or take a deeper look on how to adjust the block paddings and margins in case blockbg
is not activated.
Old
New
I've run the make command from the root directory, but my Section slides have a white background and dark teal progress bar. How do I specify that the section slides should appear like in the example pdf?
Hi,
it took me quite long to figure out what exactly was responsable for my ! Dimension too large
error. It occurs if the option usetitleprogressbar
is set and we have 45 or more slides.
\documentclass[10pt, compress]{beamer}
\usetheme[usetitleprogressbar]{m}
\usepackage{booktabs}
\usepackage[scale=2]{ccicons}
\usepgfplotslibrary{dateplot}
\title{A modern beamer theme}
\subtitle{}
\date{\today}
\author{Matthias Vogelgesang}
\institute{Institute or miscellaneous information}
\begin{document}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\begin{frame}
\frametitle{Test}
\end{frame}
\end{document}
To organize things we should maybe add a Milestone for our first CTAN release. @matze Can you set one up?
To minimize the effort of updating the package on CTAN it is reasonable to have a Makefile rule to create it. It should read the current package version from the files automatically and add the version number to the zip file name. As for the zip files folder structure: It seems to be preferred to have all the files inside a single directory.
From http://www.ctan.org/upload
The CTAN team has decided that packages on the archive shall remain in a browsing-friendly layout, i.e. the best format is to have all the files inside a directory, as illustrated here.
xxx.zip:
xxx/
README
xxx.dtx
xxx.ins
xxx.pdf
No idea how feasible this is, but being able to include a graphic for sections in a similar way to how the title screen does it would be great.
Awesome job on this theme.
The MWE below (containing 50 frames) stops at frame 44 with the following error message:
[44]
! Arithmetic overflow.
\progressbar@titleprogressbar ...essbar@tmpcounta
\divide \progressbar@tmpdi...
l.28 \tentestframes
There's no problem without the titleprogressbar
option. This is with texlive 2014 on Mac OS X 10.7.5.
\documentclass[titleprogressbar]{beamer}
\usetheme{m}
\usepackage{lipsum}
\begin{document}
\newcommand{\testframe}{
\begin{frame}
\frametitle{A Frame Title}
\lipsum
\end{frame}}
\newcommand{\tentestframes}{
\testframe
\testframe
\testframe
\testframe
\testframe
\testframe
\testframe
\testframe
\testframe
\testframe}
\tentestframes
\tentestframes
\tentestframes
\tentestframes
\tentestframes
\end{document}
Most of the sizes in the theme are hardcoded right now. There are only the few beamersizes which can be set via \setbeamersize{•}
and the frametitleoffset
which can be set as an option. It would be nice to have them all stored as subkeys of /metropolis/sizes
. Then all the sizes could be set very conveniently by the user with an additional macro \metrosetsize{•}
.
The header for frames seems to shrink/expand depending on the content on the page. It's a minor movement, but enough to be noticeable and annoying.
For example; moving back and forward between the animation slides quickly makes this easily apparent.
Fedora 20 does ship Fira {Sans,Mono}
as Fira {Sans,Mono} OT
and also lacks the ExtraLight
variant, causing xelatex to thrown upon.
0.3.x is the minimum I guess, at least I did not see the ExtraLight
in the 0.2.x tarball. About the OT not sure if this is fedora specific or also a change between 0.2.x and 0.3.x
How can I reduce the vertical space between title frame and main text, what could also be called the top margin of the main frame? In mtheme, this seems to be overly large, in particular when the frame is full or almost full, and the bottom margin gets smaller than the top margin. The default beamer theme does not leave that much space at the top.
I know I could insert \vspace*{-10mm}
before the main text on every frame, but I'm looking for a general solution.
What I'm looking for is essentially something like the (apparently unimplemented) \setbeamersize{text margin top=10mm}
.
MWE (comment out \usetheme{m}
to compare with the default beamer theme):
\documentclass{beamer}
\usetheme{m}
\usepackage{lipsum}
\begin{document}
\begin{frame}
\frametitle{A Frame Title}
\lipsum
\end{frame}
\end{document}
Hello,
Great theme, thank you for making it :-).
I just have a suggestion: I think the requirements for building the demo in README.md should be more precise. It should say Fira Mono (not only Fira Sans) fonts, and Pygmentize (not only Pygments) are required.
This is because on Arch Linux for example, there are 2 different packages for Fira fonts (otf-fira-mono and otf-fira-sans). Similarly, Pygmentize and Pygments are provided in separate packages (pygmentize and python-pygments).
I am converting/updating some existing presentations of mine. Longer ones have subsections.
Any views on whether
My latex-fu is a little weak; I tried to hack a quick macro together but it didn't quite pan out. Thoughts?
All-lowercase small caps for titles look nice as long as they contain letters only.
It all starts looking very ugly, however, as soon as brackets, apostrophes, quotation marks, or numbers are added.
As noted before (benjamin-weiss@629c117), \textsc{\MakeLowercase{…}} should be replaced by \MakeUppercase{…} and the fontsize adjusted accordingly.
Using Numbers=Lowercase
seems to solve this issue for numbers, but not for other punctuation characters. For possible solutions - which do not seem to work for Fira Sans, though - see also https://tex.stackexchange.com/questions/170293/parentheses-and-square-brackets-contextually-in-small-caps.
On the demo.tex,
first enable blockbg:
\documentclass[blockbg,10pt, compress]{beamer}
then copy the frame about blocks to the beggining:
\begin{document}
\maketitle
\begin{frame}{Blocks}
\begin{block}{This is a block title}
This is soothing.
\end{block}
\end{frame}
and it will compile fail:
Errors:
C:/GIT/mtheme/demo.tex:29: Package xcolor Error: Undefined color `palette primary.bg'. [\end{frame}]
C:/GIT/mtheme/demo.tex:29: Package xcolor Error: Undefined color `palette primary.bg'. [\end{frame}]
C:/GIT/mtheme/demo.tex:29: Package xcolor Error: Undefined color `palette primary.bg'. [\end{frame}]
C:/GIT/mtheme/demo.tex:29: Package xcolor Error: Undefined color `palette primary.bg'. [\end{frame}]
C:/GIT/mtheme/demo.tex:29: Package xcolor Error: Undefined color `palette primary.bg'. [\end{frame}]
C:/GIT/mtheme/demo.tex:29: Package xcolor Error: Undefined color `palette primary.bg'. [\end{frame}]
C:/GIT/mtheme/demo.tex:29: Package xcolor Error: Undefined color `palette primary.bg'. [\end{frame}
Same thing happens if you add it anywhere before the line
\section{Elements}
So, for instance, this FAILS:
\begin{frame}{Blocks}
\begin{block}{This is a block title}
This is soothing.
\end{block}
\end{frame}
\section{Elements}
but this WORKS:
\section{Elements}
\begin{frame}{Blocks}
\begin{block}{This is a block title}
This is soothing.
\end{block}
\end{frame}
Hi,
when I compile my slides with the progress bar option, there is a gap:
However, when I modify https://github.com/matze/mtheme/blob/master/beamerthemem.sty#L207 and set the vspace to -.6em it looks like:
as it should be.
It is the case in both a Mac and a PC with Debian.
Actually, some stuffs are not similar to the example like section pages and progress bar in section pages.
Cheers,
Emmanuel
The pgfopts
package allows for options of the form key=value
, which would let us reimplement the options list with much more memorable names. For example:
noslidenumbers & usetotalslideindicator
-> numbering={none, count, fraction}
protectframetitle & \mthemetitleformat{}
-> frametitle={plain, protect, lowercase, uppercase}
darkcolors
-> colors={light, dark}
This should help to customize colors and avoid hard dependencies on XeTeX.
Teal and orange is a lovely default, and as someone in front of solarized etc editor scheme I quite like.
But a very common standard is blue in various shades. By a quick look at the paletton.com site you reference I found a pretty nice default for the header background I like better -- so I override it via \definecolor{mDarkTeal}{HTML}{....}
in a header. Is there way to pass this in via style options?
As I mentioned, I work from (R)markdown via beamer so the obvious quick edit to the top of the tex file is not a given (though we leave an \include{}
open for a header which is what I use).
What do other people use, or is default colours for everyone?
Even if the title page looks well designed on its own, it feels a little bit too light in comparison to the other slides. First of all it is the only place we use the ExtraLight
font (for the author and the date) and the dividing line is a little bit thinner than the progress bar.
So I think we should change the author and date font to Light
, change the institute font to ExtraLight
and use the same thickness for the divider and the progress bar.
If you guys agree I will make a PR.
I'm curious to see how many of the current files are unused and could be deleted.
images/valley.jpg
was once used in the demo slides, but currently is not.make
is our supported build method, then build.sh
and latexmkrc
might be unnecessary.contributors.py
, contributors.tex
and login.json
? Personally, I think it's sufficient to acknowledge us contributors with a link to the full list, which has the advantage of being automatically updated without the need for us to maintain a parallel list.fira
bundle to see if it can be relied on to provide the fonts. If so, we will be able to remove contrib/Dockerfile
and contrib/getFiraFont.sh
.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.