There are two things going on in this situation. For those who know about LaTeX's list parameters, there is a \topsep
being added before the itemize list. The other is
that this item is starting in vertical mode, so a \partopsep
is also being added.
We thus need to do two things in this situation: (1) set \topsep
to zero for the list, via a redefinition \@listi
, and (2) clear \partopsep
.
The best way to do this is to add this to block begin
template. Here is an example, based on the essentials of your code.
\documentclass[10pt]{beamer}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usetheme{default}
\usecolortheme{crane}
\setbeamertemplate{itemize items}[square]
\setbeamercolor{item}{fg=black}
\setbeamercolor{frametitle}{fg=black}
\setbeamercolor{block title}{fg=black}
\setbeamercolor{title}{fg=black}
\setbeamercolor{block body}{bg=white}
\makeatletter
\addtobeamertemplate{block begin}{
\def\@listi{\leftmargin\leftmargini
\topsep 0pt
\parsep 0pt
\itemsep 3pt plus 2pt minus 3pt}
\partopsep 0pt
}
\makeatother
\begin{document}
\begin{frame}
\frametitle{text vs. item blocks}
\begin{columns}[t]
\begin{column}{0.42\textwidth}
\begin{block}{text block}
block block block block block\vadjust{\hrule}
block block block block block
block block block block block
block block block block block
\end{block}
\end{column}
\begin{column}{0.48\textwidth}
\begin{block}{item block}
\begin{itemize}
\item item\vadjust{\hrule}
\item item
\item item
\end{itemize}
\end{block}
\end{column}
\end{columns}
\end{frame}
\end{document}
I have placed the blocks side-by-side and added the \vadjust{\hrule}
for illustration purposes. The values for \@listi
are based on beamers defaults which are
\def\@listi{\leftmargin\leftmargini
\topsep 3\p@ \@plus2\p@ \@minus2.5\p@
\parsep 0\p@
\itemsep3\p@ \@plus2\p@ \@minus3\p@}
\partopsep
has default value
2.0pt plus 1.0pt minus 1.0pt
If you want the individual lines to match up, then you should also put \itemsep
equal to 0pt
in the above code.
Beaware that if the titles of the two blocks have different heights/depths then theh body will move accordingly and you will loose your alignment again. You can cover yourself a little by adding an appropriate strut to your block titles.
Note that the above code also kills \topsep
for subsquent uses of itemize
within the same block. If this is a problem, you might try to just adjust \partopsep
to cancel out \topsep
and ensure that your subsequent lists in the block do not start in vertical mode.
The problem is that when one of the circles
or rounded
inner themes is used, some different templates/colors/fonts are used, so you need to change item projected
, subitem projected
and subsubitem projected
, as in (just for the first level, but is the same idea for the other levels):
% for inner theme circles
\AtBeginEnvironment{alertblock}{\setbeamercolor{item projected}{bg=red}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{item projected}{bg=DarkGreen}}
A complete example:
\documentclass[10pt,compress,table]{beamer}
\mode<presentation>{
\usetheme[bullet=circle,alternativetitlepage=true,height=1cm]{Torino}
\usefonttheme[onlymath]{serif}
}
\setbeamertemplate{blocks}[rounded][shadow=false]
\usepackage[spanish]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ragged2e}
\usepackage{etoolbox}
\justifying
\theoremstyle{definition}
\definecolor{purple}{RGB}{153,0,51}
\definecolor{maroon}{RGB}{132,89,107}
\definecolor{glade}{RGB}{51,0,51}
\definecolor{tan}{RGB}{181,138,165}
\definecolor{DarkGreen}{RGB}{0,100,0}
\setbeamercolor*{palette primary}{fg=white,bg=tan}
\setbeamercolor*{palette secondary}{fg=white,bg=maroon}
\setbeamercolor*{palette tertiary}{fg=white,bg=glade}
\setbeamercolor*{palette quaternary}{fg=white,bg=purple}
\setbeamercolor*{titlelike}{bg=purple}
\setbeamercolor*{frametitle}{bg=purple,fg=white}
\setbeamercolor*{part title}{bg=black,fg=tan}
\setbeamercolor*{item}{fg=purple}
\setbeamercolor*{block title}{bg=purple,fg=white}
\setbeamercolor*{block body}{bg=purple!15,fg=black}
\setbeamercolor*{block title alerted}{bg=red,fg=white}
\setbeamercolor*{block body alerted}{bg=red!15,fg=black}
\setbeamercolor*{block title example}{bg=DarkGreen,fg=white}
\setbeamercolor*{block body example}{bg=DarkGreen!15,fg=black}
\setbeamercolor*{separation line}{}
\setbeamercolor*{fine separation line}{}
\useinnertheme{circles}
\AtBeginEnvironment{alertblock}{\setbeamercolor{itemize item}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{itemize subitem}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{itemize subsubitem}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor*{enumerate item}{bg=cyan,fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{enumerate subitem}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{enumerate subsubitem}{fg=red}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{itemize item}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{itemize subitem}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{itemize subsubitem}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{enumerate item}{bg=red,fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{enumerate subitem}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{enumerate subsubitem}{fg=DarkGreen}}
% for inner theme circles
\AtBeginEnvironment{alertblock}{\setbeamercolor{item projected}{bg=red}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{item projected}{bg=DarkGreen}}
\begin{document}
\begin{frame}[t]{Lorem Ipsum}
\begin{columns}
\column{0.5\textwidth}
\begin{exampleblock}{Lorem Ipsum}
\begin{itemize}
\item Aut consilio aut ense
\item Post tenebras Lux
\end{itemize}
\end{exampleblock}
\begin{alertblock}{Lorem Ipsum}
\begin{itemize}
\item Aut consilio aut ense
\item Post tenebras Lux
\end{itemize}
\end{alertblock}
\column{0.5\textwidth}
\begin{alertblock}{Lorem Ipsum}
\begin{enumerate}
\item Aut consilio aut ense
\item Post tenebras Lux
\end{enumerate}
\end{alertblock}
\begin{exampleblock}{Lorem Ipsum}
\begin{enumerate}
\item Aut consilio aut ense
\item Post tenebras Lux
\end{enumerate}
\end{exampleblock}
\end{columns}
\end{frame}
\end{document}
Best Answer
Just alter the parent structure:
I would not recommend to use exactly this color scheme but it shows how itemize items and the background can be adjusted individually. This will effect
enumerate
environments and any other alert as well.Additional tipp: instead of guessing beamer templates which are not listed in the guide just look them up in the
beamer<color/inner/outer>themedefault.sty
files in the beamer tree.