1

I have defined two block environments, one with fixed width, the other with variable length (the second based on a definition here). Generally things work. However, when I have a long line in an itemize environment within the variable length block, it doesn't wrap around and runs wide. My code and what it generates are below. Is there any way to fix the definition so that itemized lines properly wrap? Thanks much.

![\documentclass\[table,xcolor=pdftex,dvipsnames\]{beamer}

\newenvironment<>{problock}\[1\]{%
  \begin{actionenv}#2%
      \def\insertblocktitle{#1}%
      \par%
      \mode<presentation>{%
        \setbeamercolor{block title}{fg=white,bg=blue!50!white}
       \setbeamercolor{block body}{fg=black,bg=blue!20}
       \setbeamercolor{itemize item}{fg=blue}
       \setbeamertemplate{itemize item}\[triangle\]
     }%
      \usebeamertemplate{block begin}}
    {\par\usebeamertemplate{block end}\end{actionenv}}

\newenvironment<>{varproblock}\[2\]\[.9\textwidth\]{%
  \setlength{\textwidth}{#1}
  \begin{actionenv}#3%
      \def\insertblocktitle{#2}%
      \par%
      \mode<presentation>{%
        \setbeamercolor{block title}{fg=white,bg=blue!50!white}
       \setbeamercolor{block body}{fg=black,bg=blue!20}
       \setbeamercolor{itemize item}{fg=blue}
       \setbeamertemplate{itemize item}\[triangle\]
     }%
      \usebeamertemplate{block begin}}
    {\par\usebeamertemplate{block end}\end{actionenv}}

\begin{document}

\begin{frame}
\begin{problock}{Definition}
Given a countably infinite set $\cal{D}$ (documents), a Web of Linked Data is a tuple $W = ( D, adoc, data )$ where:
\begin{itemize}
\item $D \in \cal{D}$, 
\item $adoc$ is a partial mapping from URIs to $D$, and
\item $data$ is a total mapping from $D$ to finite sets of RDF triples.
\end{itemize}
\end{problock}

\begin{varproblock}\[8cm\]{Definition}
A Web of Linked Data  $W = (D, adoc, data)$ contains a data link from document $D \in \cal{D}$ to document $D' \in \cal{D}$ if there exists a URI $u$ such that:
\begin{itemize}
\item $u$ is mentioned in an RDF triple $t \in data(D)$ and
\item $D' = adoc(u)$.
\end{itemize}
\end{varproblock}

\end{frame}
\end{document}][2]
ozsu
  • 2,385

1 Answers1

1

Rather than trying to change \textwidth it seems more sensible to me to wrap the contents of your varproblock inside a minipage environment. As far as I can see there aren't any side-effects. For your second box this gives:

enter image description here

Here's how I modified your environment:

\newenvironment<>{varproblock}[2][.9\textwidth]{%
  \begin{actionenv}#3%
    \minipage{#1}
      \def\insertblocktitle{#2}%
      \par%
      \mode<presentation>{%
        \setbeamercolor{block title}{fg=white,bg=blue!50!white}
       \setbeamercolor{block body}{fg=black,bg=blue!20}
       \setbeamercolor{itemize item}{fg=blue}
       \setbeamertemplate{itemize item}[triangle]
     }%
      \usebeamertemplate{block begin}}
    {\par\usebeamertemplate{block end}\endminipage\end{actionenv}}