==== Title of first slide ====
content
content
content
==== Title of second slide ====
content
content
content
==== (a new slide with no title) ====
content
content
content
=============
This would make it very easy to produce my slides.
But how can I achieve this in pure (La)TeX?
I would need to define a command '==== #1 ===='
that expands to
\end{frame}\begin{frame}\frametitle{#1}
But of course this does not work, first of all the
equals sign is a delicate character to work with, and
secondly, if I define a command that expands to
\end{frame} this is expanded down to the definition
of the frame environment and gives an error.
Any idea on how to get this? I think this might be
very useful
Piero
>==== Title of first slide ====
> content
> content
> content
>==== Title of second slide ====
> content
> content
> content
>==== (a new slide with no title) ====
> content
> content
> content
>=============
> This would make it very easy to produce my slides.
> But how can I achieve this in pure (La)TeX?
Even if possible, it might not be worth the effort. I suggest either
to use "normal" LaTeX macros or a preprocessor, like the Docutils
beamer extension.
...
> if I define a command that expands to \end{frame} this is expanded down
> to the definition of the frame environment and gives an error. Any idea
> on how to get this?
The beamer layout for LyX (www.lyx.org) uses a command instead of an
environment to start a new slide, so you will find guidance by looking
at a LyX-produced LaTeX file:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
\AtBeginDocument{
\let\origtableofcontents=\tableofcontents
\def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
\def\gobbletableofcontents#1{\origtableofcontents}
}
\makeatletter
\long\def\lyxframe#1{\@lyxframe#1\@lyxframestop}%
\def\@lyxframe{\@ifnextchar<{\@@lyxframe}{\@@lyxframe<*>}}%
\def\@@lyxframe<#1>{\@ifnextchar[{\@@@lyxframe<#1>}{\@@@lyxframe<#1>[]}}
\def\@@@lyxframe<#1>[{\@ifnextchar<{\@@@@@lyxframe<#1>[}{\@@@@lyxframe<#1>[<*>][}}
\def\@@@@@lyxframe<#1>[#2]{\@ifnextchar[{\@@@@lyxframe<#1>[#2]}{\@@@@lyxframe<#1>[#2][]}}
\long\def\@@@@lyxframe<#1>[#2][#3]#4\@lyxframestop#5\lyxframeend{%
\frame<#1>[#2][#3]{\frametitle{#4}#5}}
\makeatother
\newenvironment{topcolumns}{\begin{columns}[t]}{\end{columns}}
\def\lyxframeend{} % In case there is a superfluous frame end
Günter
> Even if possible, it might not be worth the effort.
I agree. You can also use sed as a preprocessor.
sed -e 's/^ *==== *\([^ ].*[^ ]*\) *==== *$/\\end{slide}\
\\begin{slide}\
\\frametitle{\1}/' | sed -e 's/^ *==== *==== *$/\\end{slide}\
\\begin{slide}/'
Here I'm assuming the title is meaningful and contains at least two
non-space characters. Also you may have spaces before the first ====
and after the last ====.
Regards,
Marc van Dongen