{"action":"created","issue":{"url":"https://api.github.com/repos/matze/mtheme/issues/182","repository_url":"https://api.github.com/repos/matze/mtheme","labels_url":"https://api.github.com/repos/matze/mtheme/issues/182/labels{/name}","comments_url":"https://api.github.com/repos/matze/mtheme/issues/182/comments","events_url":"https://api.github.com/repos/matze/mtheme/issues/182/events","html_url":"https://github.com/matze/mtheme/pull/182","id":136153986,"number":182,"title":"Fix multi-line block titles","user":{"login":"rchurchley","id":1131743,"avatar_url":"https://avatars.githubusercontent.com/u/1131743?v=3","gravatar_id":"","url":"https://api.github.com/users/rchurchley","html_url":"https://github.com/rchurchley","followers_url":"https://api.github.com/users/rchurchley/followers","following_url":"https://api.github.com/users/rchurchley/following{/other_user}","gists_url":"https://api.github.com/users/rchurchley/gists{/gist_id}","starred_url":"https://api.github.com/users/rchurchley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchurchley/subscriptions","organizations_url":"https://api.github.com/users/rchurchley/orgs","repos_url":"https://api.github.com/users/rchurchley/repos","events_url":"https://api.github.com/users/rchurchley/events{/privacy}","received_events_url":"https://api.github.com/users/rchurchley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-24T18:57:13Z","updated_at":"2016-02-24T23:25:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/matze/mtheme/pulls/182","html_url":"https://github.com/matze/mtheme/pull/182","diff_url":"https://github.com/matze/mtheme/pull/182.diff","patch_url":"https://github.com/matze/mtheme/pull/182.patch"},"body":"For quite a while, ᴍᴇᴛʀᴏᴘᴏʟɪs has had trouble with block environments with long titles:\r\n\r\n![screen shot 2016-02-24 at 10 05 00 am](https://cloud.githubusercontent.com/assets/1131743/13295584/6d92ff3c-dade-11e5-89c6-a6b806650f2b.png)\r\n\r\nThis pull request solves this issue while maintaining the current behaviour for single-line blocks:\r\n![screen shot 2016-02-24 at 10 05 55 am](https://cloud.githubusercontent.com/assets/1131743/13296399/3d5e0556-dae2-11e5-8feb-7a7d0a6de87a.png)\r\n![screen shot 2016-02-24 at 10 06 45 am](https://cloud.githubusercontent.com/assets/1131743/13296528/d2902636-dae2-11e5-89b2-e51ffa74dc75.png)\r\n\r\nTechnical details:\r\n- Previously, we fixed the height and depth of the `beamercolorbox` in block titles, and added padding to the right and left when `block title.bg` was nonempty. Now, we set `sep` for the `beamercolorbox` and add negative padding to the right and left when `block title.bg` is empty. This is similar to how we fixed multi-line frame titles a while back.\r\n- Just replacing `dp` and `ht` with `sep` wouldn't be enough, though. The padding at the top of a beamer box seems to actually be `sep + parskip`; since ᴍᴇᴛʀᴏᴘᴏʟɪs increases the `\\parskip` length, we'd have too much padding at the top if we didn't do something more. The solution is to reset `\\parskip` to zero at the beginning of `block begin` and restore the ᴍᴇᴛʀᴏᴘᴏʟɪs `\\parskip` length when the block body begins.\r\n- This pull request also adds some wiggle room to the `rightskip` for the block title to produce a good ragged right edge.\r\n- Finally, I added some comments explaining why we can't just use `colsep`, which would be the ideal solution if it actually worked."},"comment":{"url":"https://api.github.com/repos/matze/mtheme/issues/comments/188512814","html_url":"https://github.com/matze/mtheme/pull/182#issuecomment-188512814","issue_url":"https://api.github.com/repos/matze/mtheme/issues/182","id":188512814,"user":{"login":"rchurchley","id":1131743,"avatar_url":"https://avatars.githubusercontent.com/u/1131743?v=3","gravatar_id":"","url":"https://api.github.com/users/rchurchley","html_url":"https://github.com/rchurchley","followers_url":"https://api.github.com/users/rchurchley/followers","following_url":"https://api.github.com/users/rchurchley/following{/other_user}","gists_url":"https://api.github.com/users/rchurchley/gists{/gist_id}","starred_url":"https://api.github.com/users/rchurchley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchurchley/subscriptions","organizations_url":"https://api.github.com/users/rchurchley/orgs","repos_url":"https://api.github.com/users/rchurchley/repos","events_url":"https://api.github.com/users/rchurchley/events{/privacy}","received_events_url":"https://api.github.com/users/rchurchley/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T23:25:14Z","updated_at":"2016-02-24T23:25:14Z","body":"Coming from a web/CSS background, setting the desired padding and compensating for a special case with a negative margin was actually the more intuitive solution to me.\n\nI prefer using Beamer's higher-level options where possible rather than rolling our own solutions with struts. Using Beamer's mechanisms mean that our bugs will at least be consistent with other themes. I'm sure that a strut-based solution is possible, but I'm not sure how well I could debug it, or to anticipate the relevant edge cases where our solution would differ from other themes. (3+ line titles? Accented capital letters?)\n\nIn an ideal world, of course, we'd just use `colsep` and not have any colour-conditional code at all. I suppose that's another advantage of the `sep` solution — if Beamer fixes the bug with `colsep` and inherited empty colours, it will be very easy to take advantage of that.\n"}}