Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there a way to specify fragile mode as default for all frames? Now I know how to define a fragile frame: \begin{frame}[fragile].

share|improve this question

1 Answer 1

up vote 18 down vote accepted

You could define your own frame environment like it is explained in the user manual p.62, e.g.:

\newenvironment{xframe}[2][]
  {\begin{frame}[fragile,environment=xframe,#1]
  \frametitle{#2}}
  {\end{frame}}

The environment option does the trick. It tells beamer that the frame ends with an \end{xframe} now.

Note that the frame has a complex set of optional arguments, including two < > and to optional(!) braced arguments for the frame title and sub-title. Not all of these arguments might be supported by the above code. You might write it better as:

\newenvironment{xframe}[1][]
  {\begin{frame}[fragile,environment=xframe,#1]}
  {\end{frame}}

which should support both optional title and sub-title arguments. You also can define the frame title using an explicit \frametitle command.

Another, more complex alternative is to use the xparse package to define xframe with the same arguments of frame and pass it along.

share|improve this answer

Your Answer

 
discard

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.