1

I realize that in beamer there is an environment named solution, but I cannot find any documentation about it. In particular, I would like to address these two issues:

  1. I see that a title "Solution" is produced followed by a number. I would like to know if it's possible to change that title. This would be useful when writing a document in a non-English language.

  2. How to hide solutions?

  • Try with \documentclass[spanish]{beamer}\usepackage{babel} .... and see that happen. Warning: sometimes correct changes in babel configuration as change the document language cannot be compiled because the presence of auxiliary files of previous compilations. If that happen, remove the auxiliary files and try again. – Fran Nov 05 '20 at 22:53
  • I tried \usepackage[spanish]{babel} and I also removed the other files, but nothing changes. – user12703198 Nov 05 '20 at 23:03
  • Then you are doing something wrong, but without a minimal example is useless try to guess that. I have made an answer that show that this really solve the problem, at least for languages supported for babel. – Fran Nov 06 '20 at 01:15
  • I am sorry. You are right. I was mispleacing the [spanish] option in my document. Thanks! I still would like to know if you can set it so that what's inside this solution environment is not shown in the output. – user12703198 Nov 06 '20 at 09:11
  • About hide solutions: Hiding how? The solution block must be collapsed or maintain the dimensions when empty? It must be showed in other slide? As sample, try replacing "Foo" by " $2+3=\only<2>{5}$" in the MWE. This will hide the 5 except in the second slide of the frame. But there are more than one method. Please run texdoc beamer and read the section 3.9 and 3.10. – Fran Nov 06 '20 at 10:48
  • I would like to be able to create two documents: one shows what's inside the solutions environment and one hides it completely (leaving no empty space). – user12703198 Nov 06 '20 at 11:42
  • Then you do not need beamer's overlays, just define a macro \foo that does nothing (\newcommand\foo[1]{}) or just print the argument (\newcommand\foo[1]{#1}) like here. – Fran Nov 06 '20 at 17:01

1 Answers1

1

mwe

It should be enough set the language of the document using babel for most common languages. The title should change automatically to "Solución" in Spanish, to "Lösung" in German, to "Rešenje" in Serbian, etc.

Example:

\documentclass[spanish]{beamer}
\usepackage{babel}
\usetheme{Madrid}
\begin{document}
\begin{frame}{Foo}
\begin{solution} 
     Foo 
\end{solution}
\end{frame}
\end{document}
Fran
  • 80,769