josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.41k stars 142 forks source link

Documentation about `\newenvironment`: tweaks needed? #827

Closed dbitouze closed 1 year ago

dbitouze commented 1 year ago

Does the following MCE, build from the current (3.68) documentation (page 86), give the expected result?

\documentclass{beamer}
\newenvironment<>{myboldblock}[1]{%
  \begin{actionenv}#2%
    \textbf{#1}
    \par}
  {\par%
  \end{actionenv}}
\begin{document}
\begin{frame}
  \begin{myboldblock}<2>
    This theorem is shown only on the second slide.
  \end{myboldblock}
\end{frame}
\end{document}

Indeed, the second slide looks like:

image

On the same page, it is written “Example: Text in the following environment is normally bold and italic on non-specified slides:” but I guess there's no italic in the involved examples:

\newenvironment<>{boldornormal}
{\begin{altenv}#1
{\begin{bfseries}}{\end{bfseries}}
{}{}}
{\end{altenv}}

and:

\newenvironment{boldornormal}
{\begin{altenv}
{\begin{bfseries}}{\end{bfseries}}
{}{}}
{\end{altenv}}

BTW, wouldn't be more advised to use bfseries as a declaration instead of an environment, e.g.:

\newenvironment<>{boldornormal}
{\begin{altenv}#1
    {\bfseries}{}
    {}{}}
  {\end{altenv}}
samcarter commented 1 year ago

@dbitouze Thanks for the report! I added the missing title for the theorem and fixed the wording for the boldenormal environment.

@josephwright I left the \begin{bfseries}...\end{bfseries} in the example for now because I think it makes it easier to see where the environment starts and ends. What do you think? Should it be changed to something else? Using the center environment all the time would be a bit boring...