TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

\setbeamertemplate{block title}[horizontal shading][left=black, right=white]


The template sidebar canvas left can be set in this fashion; is there any way the same can be done for block titles using templates?

share|improve this question
up vote 10 down vote accepted

Unfortunately, due to the way boxes are built in beamer (take a look at the definition of \beamerboxesrounded and \endbeamerboxesrounded in beamerbaseboxes.sty to see how different chunks are pieced together to build a box), this would require a major rewriting of the code producing the boxes and quite frankly I am not sure if the work is worthy the effort.

You can however, get this effect using the beamer skin for a tcolorbox and a convenient definition for interior titled code using \shade; something along these lines:


  enlarge left by=-3pt,
  colframe=block body.bg,
  adjusted title=#1,
  interior titled code={
    \shade[left color=Maroon!80,right color=Dandelion,middle color=Salmon] 
      (title.south west) --
      (title.south east) {[rounded corners] -- 
      (title.north east)  -- 
      (title.north west)} --
      (title.south west); 



\begin{block}{The title}
This box ia a box provided by the \texttt{beamer} class.

\begin{myblock}[An example with \texttt{tcolorbox}]
This box looks like a box provided by the \texttt{beamer} class.


enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.