matze / mtheme

A modern LaTeX Beamer theme
6.44k stars 845 forks source link

Spacing between block title and contents is off #307

Open a3nm opened 6 years ago

a3nm commented 6 years ago

Hi,

I'm having a problem with the metropolis theme, which I think is a recent regression (the problem now appears on documents that were fine when I compiled them with an earlier version). I'm using the version of Metropolis shipped with Debian testing, texlive-latex-extra version 2017.20171128-1.

Here's the MWE:

\documentclass{beamer}
\usetheme{metropolis}

\begin{document}
\begin{frame}{Frame title}
  \begin{block}{This line is too close to the text below}
    This line is too close to the text above, when compared to the spacing
    between the lines in the theorem environment.
  \end{block}
\end{frame}
\end{document}

Here's how it compiles for me: slides

Compare to the version without \usetheme{metropolis}, where the spacing is much more reasonable:

slides_orig

Can you reproduce this? Any idea of how to fix this? Thanks!

a3nm commented 6 years ago

FYI, one workaround is to add \vspace{0pt} at the beginning of the block contents. But still, this is a bit strange...

rodrigoalcarazdelaosa commented 6 years ago

I have also experienced this with my latest compilations.

stefanocampanella commented 6 years ago

I can confirm the issue with LuaTeX Version 1.0.4 (TeX Live 2017/Arch Linux)

matze commented 6 years ago

Hmm, I cannot reproduce this on a Ubuntu 17.10 VM with TeXlive 2017. I also don't find the spacing reasonable at all even without metropolis …

mtheme-307

emersonmello commented 6 years ago

Same problem here using MacTex 2018. (I didn't install metropolis from this github repository.)

emilioj commented 6 years ago

Same problem here! (using the Metropolis theme included in Debian sid's texlive-latex-extra package)

I'm attaching a snapshot with the demo.pdf included in the documentation (right) and the one generated by me (left) screenshot-1527521068

LucaFranceschini commented 6 years ago

Same problem here, using TeXlive and the included metropolis theme, Arch Linux.

rougier commented 6 years ago

Same here with TexLive 2017 and TexLive 2018 (on OSX).

matze commented 6 years ago

Alright, I can replicate the issue on my Ubuntu 18.04 box. However, I am on vacation and have no real estimate when I can fix it. Feel free, to jump in :smile:

wence- commented 6 years ago

This appears to work for me, but it's tremendously cargo-culted:

diff --git a/source/beamerinnerthememetropolis.dtx b/source/beamerinnerthememetropolis.dtx
index f65378f..2fe8350 100644
--- a/source/beamerinnerthememetropolis.dtx
+++ b/source/beamerinnerthememetropolis.dtx
@@ -407,9 +407,15 @@
 %
 %    \begin{macrocode}
   \ifbeamercolorempty[bg]{block title#1}{%
-    \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}}{%
+    \begin{beamercolorbox}[
+      sep=\dimexpr\metropolis@blocksep-\metropolis@blockadjust\relax,
+      leftskip=\dimexpr\metropolis@blockadjust-\metropolis@blocksep\relax,
+      rightskip=0pt plus 4em]{block title#1}}{%
   \ifbeamercolorempty[bg]{block title}{%
-    \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}%
+    \begin{beamercolorbox}[
+      sep=\dimexpr\metropolis@blocksep-\metropolis@blockadjust\relax,
+      leftskip=\dimexpr\metropolis@blockadjust-\metropolis@blocksep\relax,
+      rightskip=0pt plus 4em]{block title#1}%
   }%
 %   \end{macrocode}
 %
emilioj commented 6 years ago

@wence- it seems to work so I'll use it at least temporarily as a workaround. Thanks!

The drawback: (ugly) extra space when an itemize is the block's content :-/

xiehao commented 5 years ago

Same problem here with the latest TeXLive 2018 on Archlinux (installed from pacman) and Windows 10 (official installer), also with the latest MacTeX 2018 on macOS 10.14.2 (installed from Homebrew), compiled by xelatex.

dbogatov commented 5 years ago

Same problem in June 2019.

jacr13 commented 5 years ago

I have fix it in my case using this :

% map defaulf block to oldblock
\let\oldblock\block
\let\endoldblock\endblock

% change block by adding smallskip
\renewenvironment{block}[1]
    {\begin{oldblock}{#1}
        \smallskip
    }
    { 
    \end{oldblock}
    }
ThreeFx commented 5 years ago

Can confirm this is still an issue with TexLive 2019 under Arch Linux.

FinnStutzenstein commented 4 years ago

Still an issue under Debian within TextStudio

gsbabil commented 4 years ago

Same issue continues in MacTex (mactex-20200407.pkg). Thanks.

fabiobrau commented 4 years ago

Same issue for Debian 10

$ lualatex --credits This is LuaTeX, Version 1.07.0 (TeX Live 2019/dev/Debian)

The LuaTeX team is Hans Hagen, Hartmut Henkel, Taco Hoekwater, Luigi Scarso.

LuaTeX merges and builds upon (parts of) the code from these projects:

tex : Donald Knuth etex : Peter Breitenlohner, Phil Taylor and friends omega : John Plaice and Yannis Haralambous aleph : Giuseppe Bilotta pdftex : Han The Thanh and friends kpathsea : Karl Berry, Olaf Weber and others lua : Roberto Ierusalimschy, Waldemar Celes and Luiz Henrique de Figueiredo metapost : John Hobby, Taco Hoekwater and friends poppler : Derek Noonburg, Kristian Hogsberg (partial) fontforge : George Williams (partial) luajit : Mike Pall (used in LuajitTeX)

Compiled with libpng 1.6.34; using 1.6.36 Compiled with lua version 5.2.4 Compiled with mplib version 2.00 Compiled with poppler version 0.68.0 Compiled with zlib 1.2.11; using 1.2.11

Development id: 6686

Thanks.

Tomohirohashizume commented 3 years ago

Hi, I have the same problem with pdflatex, ubuntu-20.4

pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian)
kpathsea version 6.3.1
Copyright 2019 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.01
jdm204 commented 2 years ago

To anyone else coming across this issue, @jacr13's comment worked for me - to have it working for example and alert blocks I had to essentially copy it twice and do block -> exampleblock etc!