# Providing Arguments to a Start-Stop

Mostly for the sake of doing so, I am writing a presentation in ConTeXt. I thought that defining a start-stop would be a good way to split up slides. So I have something like:

\definestartstop[Slide][after={\break}]
...
\startSlide
\subject{Title}
\subsubject{Subtitle}
\stopSlide


My question is, given that every slide will have a title and a subtitle, is there a way to wrap the \subject and \subsubject up in the \definestartstop and provide the values when the start-stop begins?

I haven't found anything that is related to this and I know start-stops don't take arguments, so how might you do something like that? If I am going about the problem wrong, what would be the ConTeXt way?

-
Why don't you use the regular \startsection ... \stopsection and \startsubsection? That will give you the benefit of being able to add the title. And you can define every section to equal one slide. –  Thomas Jul 4 '12 at 20:37
Have a look at the annotation module by Wolfgang Schuster and search the ConTeXt mailing list for usage examples. –  Aditya Jul 9 '12 at 12:46

I would suggest to simply use the built-in sectioning macros for the slides.

With \definehead you can create new sectioning commands which can be individually styled and the behaviour modified as desired. If you use MkIV sectioning style you can provide a second argument which can be accessed with \structureuservariable{…}. Here is a very simple slide template demonstrating that feature.

\useMPlibrary     [dum]  %% only for the screenshot
\setuppapersize   [S6]
\setupbodyfont    [sans,18pt]
\setupheadertexts [{\getmarking [slide] — \getmarking [subtitle]}]
\definemarking    [subtitle]

\setuplayout
[height=.8\paperheight,
width=middle,
topspace=.15\paperwidth]

[slide] [subsection]

\starttexdefinition doSubtitle
\marking [subtitle] {\structureuservariable{subtitle}}
\stoptexdefinition

\starttext

\startslide [title=Foo] [subtitle=a subtitle]
\input ward
\stopslide

\startslide [title=Bar] [subtitle=another subtitle]
\placesidebyside
{\externalfigure [dummy] [width=.5\textwidth]}
{\externalfigure [dummy] [width=.5\textwidth]}
\stopslide

\stoptext


Also have a look at Aditya's step-by-step instruction tutorial to create slides with ConTeXt.

To actually answer your question: You can create commands with arguments using \dosingleempty for one argument \dodoubleempty for two arguments, etc. Here is an example of a macro \TwoArgs that simply prints parentheses around the arguments.

\def\TwoArgs
{\dodoubleempty\doTwoArgs}

\def\doTwoArgs[#1][#2]%%
{(#1) (#2)}