[texhax] \DeclareGraphicsRule in beamer

Roger Mason rmason at esd.mun.ca
Mon Feb 14 17:43:00 CET 2005


Hello,

I'm using beamer to prepare both presentation and article versions of
lecture notes.  Follwing the beamer user guide, I have a file
main.beamer.tex as follows:

\documentclass[ignorenonframetext]{beamer}
\input{main.tex}

\end{document}

and a file main.article.tex:

\documentclass{article}
\usepackage[noxcolor]{beamerarticle}
\setjobnamebeamerversion{main.beamer}
\input{main.tex}

\end{document}

In main.tex I have:

% Not to be run stand-alone: to be \incuded
% in main.beamer.tex and main.article.tex.
\mode<presentation>
{
  \usetheme{Warsaw}
  % or ...
  \setbeamercovered{transparent}
  % or whatever (possibly just delete it)
  \DeclareGraphicsRule{*}{mps}{*}{}
}
\mode<article>
{
\DeclareGraphicsRule{*}{eps}{*}{}
}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage{subfigure}
\usepackage{graphicx}

\begin{document}

When I run LaTeX on main.article.tex it raises the complaint:

ERROR: Undefined control sequence.

--- TeX said ---
<recently read> \DeclareGraphicsRule 
                                     
l.12 \mode<article>\DeclareGraphicsRule
                                       {*}{eps}{*}{}
--- HELP ---
TeX encountered an unknown command name. You probably misspelled the
name. ...

The purpose in having multiple definitions using \DeclareGraphicsRule
is to use the same MetaPost output files <filename>.<numeral> no
matter which version of the document I wish to generate.

I don't see what I have done wrong.

Thanks for any help,

Roger Mason



More information about the texhax mailing list