-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable transparent background of beamercolorbox #884
base: main
Are you sure you want to change the base?
Conversation
Good points, I entirely missed that |
One point to think about: with the default value of 1, the opacity will no longer adopt to the surrounding opacity. This means existing code like https://tex.stackexchange.com/a/656921/36296 or https://tex.stackexchange.com/a/331416/36296 will no longer give the desired result. |
Right. I guess one could leave |
Yes, this could work. Or maybe avoid all potential backwards compatibility problems by creating a new transparent box? |
implementation based on https://tex.stackexchange.com/questions/75839/transparency-of-beamercolorbox-and-opaqueness-of-its-text additional things that needed fixing: - implement transparent background for `rounded=false` - by default, don't change anything by not defining the `bgopacity` macros - more exact clipping of shadows when `bgopacity` is set
4f3094b
to
95c758a
Compare
Got around to implementing this with not defining
I suppose the inner box would still be drawn with 0.5 opacity, but I think this is a pretty niche case and can be easily fixed by setting |
I am working on a beamer theme right now and found myself wanting colorboxes with truly transparent backgrounds. I found a stackexchange post addressing this topic and then noticed that implementing this as a proper parameter
bgopacity
forbeamercolorbox
andbeamerboxesrounded
does not seem too hard.The result is cleanest for non-rounded boxes, as they are drawn as one shape.
For rounded boxes, especially with a heading, the box can sometimes get tiny gaps, as the shapes can't overlap with transparent background colours.
I made sure that the shapes still overlap when no transparency is used, so that the gaps don't appear in this case.
Here is an example of what I get with my code.
The LaTeX code to generate the example above
The implementation is based on this stackexchange post and I made the following additional modifications:
rounded=false
: the stackexchange post only made modifications tobeamerboxesrounded
, not to non-rounded boxes that are drawn directly inbeamercolorbox
bgopacity=1
: in order to make sure I'm not messing anything up, pretty much all changes are guarded byif bgtransparency != 1
(looking through the theme examples in the userguide, they all still look fine to me)