ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Undefined controle sequence with usemodule[simpleslides]
  2012-01-04  9:34 Undefined controle sequence with usemodule[simpleslides] pol stra
@ 2011-01-04 17:58 ` Aditya Mahajan
  2012-01-04 18:27 ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Aditya Mahajan @ 2011-01-04 17:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 964 bytes --]

On Wed, 4 Jan 2012, pol stra wrote:

> I tried to compile the first example of the simpleslide module’s documentation, but it doesn’t work:

The recent cleanup in the MkIV has broken parts of the simpleslides 
module. As a quick hack, you can put the attached file in your current 
directory.

Thomas and I have been thinking of (again) rewriting the presentation 
module to make it modular. The current version of this module is at

http://bitbucket.org/adityam/complexslides

It currently has only one style (that I am using at present). There is no 
documentation at present, but the following shows the current interface.

\usemodule[complexslides][colorscheme=..., fontscheme=..., extras=....]

\starttext

\setvariables
    [talk]
    [title=...,
     shorttitle=...,
     author=....,
     shortauthor=...,
     institute=...,
     location=...,
    ]

\startsection[title=....]
...
\stopsection

...
\stoptext


Aditya

[-- Attachment #2: Type: TEXT/PLAIN, Size: 33777 bytes --]

%D \module
%D   [      file=simpleslides-s-default,
%D        version=2009.03.30
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Module simpleslides --- Default style setup,
%D         author=Thomas A. Schmitz \& Aditya Mahajan,
%D           date=\currentdate,
%D      copyright={Aditya Mahajan and Thomas A. Schmitz}]
%C
%C Copyright 2007 Aditya Mahajan and Thomas A. Schmitz
%C This file may be distributed under the GNU General Public License v. 2.0.

\writestatus{simpleslides}{loading default style setup}

\startmodule[simpleslides-s-default]

\unprotect

%D This module is the first sub-module that is loaded by
%D \filename{simpleslides}.  This sets up the style macros for the module. We
%D choose a rather plain style as the default; separate style sub-modules
%D redefine some internal macros to achieve fancier effects.


%D We start with the page layout. S6 has the ratio of a usual computer screen.

\setuppapersize[S6][S6]

%D We do not want page numbers, but we sometimes want to use the page numbering
%D mechanism, so we make sure pages are counted, but the numbers are not
%D displayed. 

\setuppagenumbering[location=]

%D As for the page layout: most of the numbers have been reached by
%D trial and error; I have just taken what seemed to produce the best output.

\setuplayout [width=middle,
              margin=0.6cm,
              height=middle, 
              header=0.15cm, 
              footer=1.35cm, 
	      footerdistance=0.5cm,
              topspace=0.5cm, 
              backspace=1cm,
              location=singlesided]


%D We define some other layouts which can be used to change the layout of
%D specific kinds of pages. This module defines three kinds of pages:
%D horizontal, vertical, and title, and we allow the possibility of changing the
%D layout of all three page styles.

\definelayout [simpleslides:layout:horizontal]
\definelayout [simpleslides:layout:vertical]
\definelayout [simpleslides:layout:title]
\definelayout [simpleslides:layout:page]

\setuplayout  [simpleslides:layout:page]
              [topspace=0cm,
               header=0cm,
               footer=0cm,
               bottomspace=0cm,
               backspace=0cm,
               cutspace=0cm,
               width=middle,
               height=middle]

%D We want colored presentations

\setupcolors[state=start]

%D And colored typesetting for \TEX\ code.

\definetype[typeTEX][option=color]

%D Presentations have relatively dense lines, we do not care about underfull
%D lines, but allow emergency stretch.

\setuptolerance[\v!verytolerant,\v!stretch] 

%D We use combinations for placing vertical pictures and text side by side, and
%D we want a distance of 3em between both.

\setupcombinations[distance=0.9cm]

%D Next we define some dimensions that are used as nominal values by other
%D macros and the user.

\define\NormalHeight        {.830\textheight}
\define\NormalWidth         {.476\textwidth}
\define\PictureFrameHeight  {.830\textheight}
\define\PictureFrameWidth   {.476\textwidth}

%D As we said before, the presentation consists of three kinds of pages: title,
%D horizontal, and vertical. Each page can have a different background; we can
%D switch to a specific background using
%D \starttyping
%D \setupPageBackground[horizontal]
%D \stoptyping

\def\setupPageBackground%
   {\dosingleargument\dosetupPageBackground}

\def\dosetupPageBackground[#1]%
  {\setups{simpleslides:background:#1}}

%D The backgrounds in all the styles are very similar. So, we define overlays to
%D capture the different features of the backgrounds, and then simply define the
%D overlays in different styles.

\defineoverlay[simpleslides:background:horizontal]
\defineoverlay[simpleslides:background:title]
\defineoverlay[simpleslides:background:vertical]
\defineoverlay[simpleslides:background:ornament]
\defineoverlay[simpleslides:background:page]

\defineoverlay[simpleslides:background:highlight]
              [\useMPgraphic{simpleslides:MP:highlight}]%

\definelayer[simpleslides:layer:slidetitle]
    [\c!width=\paperwidth,
    \c!height=\paperheight]

\definelayer[simpleslides:layer:page]
    [\c!width=\paperwidth,
    \c!height=\paperheight]

\definelayer[simpleslides:layer:extras]
    [\c!width=\paperwidth,
    \c!height=\paperheight]

\definelayer[simpleslides:layer:highlight]
    [\c!width=\paperwidth,
    \c!height=\paperheight]


%D A generic frame which is used for titles and other commands

\defineframed[simpleslides:framed]
             [\c!frame=\v!off,\c!offset=\zeropoint,
              \c!top=\vss,\c!bottom=\vss]

\defineframed[simpleslides:framed:page]
             [\c!frame=\v!off,\c!offset=3mm,
              \c!top=\vss,\c!bottom=\vss,
              \c!width=fit,
              \c!corner=\v!round,
              \c!background=\v!color,
              \c!backgroundcolor=simpleslides:backgroundcolor]


%D Now we define setups for specific backgrounds

\startsetups simpleslides:background:title
   \setuplayout[simpleslides:layout:title]
     \setupbackgrounds[\v!page]
        [background={simpleslides:background:title,
                     foreground,
                     simpleslides:layer:highlight}]
\stopsetups

\startsetups simpleslides:background:horizontal
  \setuplayout[simpleslides:layout:horizontal]
  \setupbackgrounds[\v!page]
        [background={simpleslides:background:horizontal,
                     simpleslides:background:ornament,
                     simpleslides:layer:extras,
                     simpleslides:layer:slidetitle,
                     foreground,
                     simpleslides:layer:highlight}]
\stopsetups

\startsetups simpleslides:background:vertical
  \setuplayout[simpleslides:layout:vertical]
  \setupbackgrounds[\v!page]
        [background={simpleslides:background:vertical,
                     simpleslides:layer:extras,
                     simpleslides:background:ornament}]
\stopsetups

\startsetups simpleslides:background:page
  \page
  \setuplayout[simpleslides:layout:page]
  \setupbackgrounds[\v!page]
        [background={simpleslides:background:page,
                     foreground,
                    %simpleslides:background:ornament,
                     simpleslides:layer:extras,
                     simpleslides:layer:page}]
\stopsetups

%D We also define some fall backs for presentation backgrounds.

\startsetups simpleslides:background:default
  \setups{simpleslides:background:horizontal}
\stopsetups

\startsetups simpleslides:background:none
  \setupbackgrounds[\v!page]
                   [background=]
\stopsetups

\startsetups simpleslides:background:empty
   \message{I don't know the name of the background you have provided.}
   \setups{simpleslides:background:horizontal}
\stopsetups
  
%D Now we move on to specific components of the presentation. The first thing in
%D any presentation is the title page, so we start with that. We define a macro
%D that stores values for the title, author and date of the presentation. These
%D are input as
%D \starttyping
%D \setupTitle[title={How to write a sub module for simpleslides},
%D             author={Aditya Mahajan},
%D             date={\currentdate[d=10,m=7,y=2008]}]
%D \stoptyping
%D This setup command can also setup the color and style for the title, author,
%D and date.

\definenamespace
    [Title]
    [
      \c!type=module,
      \c!name=Title,
      setup=\v!yes,
      \c!style=\v!yes,
      \s!parent=Title]

% For backward compatibility.
\def\simpleslidestitleparameter{\Titleparameter}    

%D A few macros to save some typing

\def\simpleslidestitlecomponent#1%
  {\simpleslidestitleparameter{\c!before#1}
      \startalignment[\simpleslidestitleparameter{#1\c!align}]
        \useTitlestyleandcolor{#1\c!style}{#1\c!color}
        \Titleparameter{#1}%
       \stopalignment
    \simpleslidestitleparameter{\c!after#1}}

%D \macros{placeTitle}
%D
%D The macro \tex{placeTitle} produces a title page with the author, the
%D title of the presentation, and the date. Using it is not mandatory.

\define\placeTitle
  {\page
   \setupPageBackground[title]
   \null
   \simpleslidestitleparameter\c!before
   \startalignment[\simpleslidestitleparameter\c!align]
    \useTitlestyleandcolor\c!style\c!color
    \simpleslidestitlecomponent\c!title
    \simpleslidestitlecomponent\c!author
    \simpleslidestitlecomponent\c!date
   \stopalignment
   \simpleslidestitleparameter\c!after
   \page}

%D If a sub-module wants to display more information about the presentation
%D (e.g., institute of the author), it can be simply input as
%D \starttyping
%D   \setupTitle[institute={Some University}]
%D \stoptyping
%D This parameter can be accessed inside the module as
%D \type{\simpleslidestitleparameter{institute}}, and the module writer
%D can redefine \type{\placeTitle} to display the institute at the appropriate
%D place. 


%D Now we setup some default values for the title page. Other modules will
%D redefine these values later.

\setupTitle
  [\c!title=,
   \c!author=,
   \c!date=\currentdate,
   \c!style=,
   \c!color=red,
   \c!align=\v!middle,
   \c!before=\vfill,
   \c!after=\vfill,
   \c!title\c!style={\switchtobodyfont[\TitleSize]},
   \c!title\c!color=,
   \c!title\c!align=,%\v!middle,
   \c!author\c!style=,%{\switchtobodyfont[\SlideTitleSize]},
   \c!author\c!color=,
   \c!author\c!align=,%\v!middle, 
   \c!date\c!style=,%{\switchtobodyfont[\SlideTitleSize]},
   \c!date\c!color=,
   \c!date\c!align=,%\v!middle,
   \c!before\c!title=,
   \c!before\c!author=,
   \c!before\c!date=,
   \c!after\c!title={\blank[2*line]},
   \c!after\c!author={\blank[3*line]},
   \c!after\c!date=]

%D \macros{SlideTitle}
%D \tex{SlideTitle}: well, the name says it all. The
%D argument is typeset as the title, but the implementation and the result
%D (alignment, size, distance to text, color etc.) vary from module to module,
%D so this macro is defined in each of the submodules. 

\definenamespace
    [SlideTitle]
    [
      \c!type=module,
      \c!name=SlideTitle,
      setup=\v!yes,
      \c!style=\v!yes,
      \s!parent=SlideTitle]

\setupSlideTitle
  [\c!alternative=\v!normal,\c!width=\textwidth,
   \c!height=2\lineheight]

% For backward compatibility.
\def\simpleslidesslidetitleparameter{\SlideTitleparameter}    


\def\defineSlideTitleAlternative
  {\dodoubleargument\dodefineSlideTitleAlternative}

\def\dodefineSlideTitleAlternative[#1][#2]% #3
  {\setvalue{simpleslides:slidetitle:#1}}

\defineSlideTitleAlternative[\v!normal]#1%
  {\page[\simpleslidesslidetitleparameter\c!page]%
   \simpleslidesslidetitleparameter\c!before
      \startalignment[\simpleslidesslidetitleparameter\c!align]
        \useSlideTitlestyleandcolor\c!style\c!color#1%
       \stopalignment
    \simpleslidesslidetitleparameter\c!after}

%D The layered alternative is adapted from a sample document that Brooks Moses
%D published on the wiki:

\defineSlideTitleAlternative[layer]#1%
  {\page[\simpleslidesslidetitleparameter\c!page]%
   \simpleslidesslidetitleparameter\c!before
   \setlayer[simpleslides:layer:slidetitle]%
     {\getvalue{simpleslides:framed}
        [\c!width=\simpleslidesslidetitleparameter\c!width,
        \c!height=\simpleslidesslidetitleparameter\c!height,
         \c!align=\simpleslidesslidetitleparameter\c!align]
         {\useSlideTitlestyleandcolor\c!style\c!color#1}}%
    \simpleslidesslidetitleparameter\c!after}

\defineSlideTitleAlternative[page]#1%
  {\page[\simpleslidesslidetitleparameter\c!page]%
   %\simpleslidesslidetitleparameter\c!before
   \setlayer[simpleslides:layer:page]%
     [\c!preset=\simpleslidesslidetitleparameter\c!preset,
      \c!hoffset=\simpleslidesslidetitleparameter\c!hoffset,
      \c!voffset=\simpleslidesslidetitleparameter\c!voffset]
     {\getvalue{simpleslides:framed:page}
       [\c!align=\simpleslidesslidetitleparameter\c!align]
        {\let\\\crlf\useSlideTitlestyleandcolor\c!style\c!color#1}}}
    %\simpleslidesslidetitleparameter\c!after}


%D Now the main user command

\def\SlideTitle{\dowithpargument\doSlideTitle}

\def\doSlideTitle% #1
  {\getvalue{simpleslides:slidetitle:\simpleslidesslidetitleparameter{alternative}}}

\setupSlideTitle
  [\c!page=\v!yes,
   \c!style={\switchtobodyfont[\SlideTitleSize]},
   \c!before={\setupPageBackground[horizontal]},
   \c!after={\blank[0.75cm]},
   \c!align=\v!middle,
   \c!alternative=\v!normal]


%AM: Clean this up later.

%D \macros{IncludePicture}
%D The macros for placing pictures. This section has been entirely rewritten in
%D order to provide a cleaner user interface and to make the code easier to
%D maintain. We now have just one macro, \tex{IncludePicture}, which
%D automatically inserts page breaks and adjusts the background and margins, if
%D necessary. This macro takes four arguments: 
%D \setup{IncludePicture} 
%D The first argument decides whether the picture will be place in a horizontal
%D or vertical arrangement; the second argument is the filename of the picture
%D you want to include; the third argument does some setup, and the fourth
%D argument (in braces) is the text accompanying the picture, which will be
%D placed either in a \tex{SlideTitle} environment (for horizontal pictures) or
%D opposite the picture, centered horizontally and vertically, for vertical
%D pictures.

%D The user macro takes three arguments in brackets + an additional argument
%D for typeset content. So we define it in two steps:

\def\setupPicture
  {\dosingleargument\dosetupPicture}

\def\dosetupPicture[#1]%
  {\setvariables[simpleslides:picture]
                [highlight=\v!no,
                 steps=5,
                 opacity=0.4,
                 \c!x\c!scale=couple,
                 \c!y\c!scale=couple,
                 \c!width=,\c!height=,#1]}

\setupPicture
  [highlight=\v!no,%yes|no|default=no
   \c!alternative=\v!none,%none|circle|arrow|focus|default=none
   \c!grid\c!color=darkgreen,
   \c!grid=\v!no,
   \c!sub\c!grid=\v!no,
   steps=5,%controls the number of subdivisions of the subgrid
   \c!rulethickness={OverlayWidth/100},%for circle and arrow
   \c!color=orange,% should this be called highlightcolor?
   \c!x=5,
   \c!y=5,
   \c!x\c!scale=couple,
   \c!y\c!scale=couple,
   length=2cm,
   direction=0,
   opacity=0.4,
   shadow=\v!no,
   shadow\c!color=gray,
   verticalbackground=none,
   verticalbackgroundcolor=simpleslides:backgroundcolor,
   verticalforegroundcolor=simpleslides:textcolor,
  ]

\def\simpleslidesPictureParameter%#1
  {\getvariable{simpleslides:picture}}


\newconditional\simpleslidesHighlight   \setfalse\simpleslidesHighlight
\newconditional\simpleslidesGrid        \setfalse\simpleslidesGrid
\newconditional\simpleslidesSubGrid     \setfalse\simpleslidesSubGrid

\chardef\simpleslidesHighlightAlternative\zerocount %0=none, 1=circle, 
                                                    %2=arrow, 3=focus
\chardef\simpleslidesShadow\zerocount %0=no, 1=topleft, 2=topright,
                                      %3=bottomright, 4=bottomleft

\def\IncludePicture%
   {\dotripleargument\doIncludePicture}


\def\doIncludePicture[#1][#2][#3]#4% dir graphic options text
  {\begingroup % Else the settings of \setupPicture are global 
   \setupPicture[#3]%
   \processaction
     [\simpleslidesPictureParameter{highlight}]
     [    \v!yes=>\settrue\simpleslidesHighlight,
           \v!no=>\setfalse\simpleslidesHighlight,
      \v!default=>\setfalse\simpleslidesHighlight,
      \v!unknown=>\setfalse\simpleslidesHighlight]
   %
   \processaction
     [\simpleslidesPictureParameter\c!grid]
     [    \v!yes=>\settrue\simpleslidesGrid,
           \v!no=>\setfalse\simpleslidesGrid,
      \v!default=>\setfalse\simpleslidesGrid,
      \v!unknown=>\setfalse\simpleslidesGrid]
   %
   \processaction
     [\simpleslidesPictureParameter{\c!sub\c!grid}]
     [    \v!yes=>\settrue\simpleslidesSubGrid,
           \v!no=>\setfalse\simpleslidesSubGrid,
      \v!default=>\setfalse\simpleslidesSubGrid,
      \v!unknown=>\setfalse\simpleslidesSubGrid]
   %
   \processaction
     [\simpleslidesPictureParameter{shadow}]
       [     \v!no=>\chardef\simpleslidesShadow\zerocount,
            \v!yes=>\chardef\simpleslidesShadow\plusthree,
     \v!top\v!left=>\chardef\simpleslidesShadow\plusone,
    \v!top\v!right=>\chardef\simpleslidesShadow\plustwo,
 \v!bottom\v!right=>\chardef\simpleslidesShadow\plusthree,
  \v!bottom\v!left=>\chardef\simpleslidesShadow\plusfour,
        \v!default=>\chardef\simpleslidesShadow\zerocount,
        \v!unknown=>\chardef\simpleslidesShadow\zerocount]
   %
   \edef\simpleslidesGridColor{\simpleslidesPictureParameter{\c!grid\c!color}}%
   \doifnothing{\simpleslidesGridColor}{\edef\simpleslidesGridColor{green}}%
   %
   \processaction
     [\simpleslidesPictureParameter\c!alternative]
     [   circle=>\chardef\simpleslidesHighlightAlternative\plusone
                  \simpleslidesSetEllipseDimensions,
           arrow=>\chardef\simpleslidesHighlightAlternative\plustwo,
           focus=>\chardef\simpleslidesHighlightAlternative\plusthree
                  \simpleslidesSetEllipseDimensions,
      \v!default=>\chardef\simpleslidesHighlightAlternative\zerocount,
      \v!unknown=>\chardef\simpleslidesHighlightAlternative\zerocount]
   %
    \processaction[#1]
      [\v!horizontal=>{\doIncludePictureHorizontal[#2]{#4}},
         \v!vertical=>{\doIncludePictureVertical[#2]{#4}},
             \v!page=>{\doIncludePicturePage[#2]{#4}},
          \v!default=>{\doIncludePictureHorizontal[#2]{#4}},
          \v!unknown=>{\doIncludePictureHorizontal[#2]{#4}}%
                       \message{Keywords for positioning pictures are
                         "horizontal" or "vertical." 
                          Please specify one of them!}]
     \endgroup}

%D We have to set the width or height for vertical and horizontal pictures
%D separately. We test if the user has supplied values for the "width" and
%D "height" key. If they have been set, these are used for the width/height of
%D the picture. If not, we determine the ratio of the picture and let it fill
%D the available space. Small pictures will be enlarged, big pictures will be
%D fit. This code was suggested by Wolfgang Schuster on the mailing list.

\def\setPictureDimensionsTo#1#2#3% graphic height width 
  {\doifelsenothing{\simpleslidesPictureParameter\c!width}
     {\doifelsenothing{\simpleslidesPictureParameter\c!height}
        {\setbox\scratchbox\hbox{\externalfigure[#1]
          [\c!page=\simpleslidesPictureParameter\c!page]}
        % Courtsey Wolfgang Schuster
        \ifdim\dimexpr#3*100/\wd\scratchbox\relax < 
              \dimexpr#2*100/\ht\scratchbox\relax
          %
          \setvalue{simpleslides:picture:width}{#3}%
          \setvalue{simpleslides:picture:height}{}%
        \else
          \setvalue{simpleslides:picture:width}{}%
          \setvalue{simpleslides:picture:height}{#2}%
        \fi}
     {\setvalue{simpleslides:picture:width}{}%
      \setvalue{simpleslides:picture:height}{\simpleslidesPictureParameter\c!height}}}
 {\setvalue{simpleslides:picture:width}{\simpleslidesPictureParameter\c!width}
  \setvalue{simpleslides:picture:height}{}}}% not \simpleslidesPictureParameter\c!height

%D This macro places the picture centered both vertically and horizontally. 

\def\doplacePictureFrame[#1]#2%
  {\framed[\c!frame=\v!off,
           \c!framecolor=green,
           \c!align=\v!middle,
           \c!top=\vss,
           \c!bottom=\vss,
           \c!strut=\v!no,
           \c!offset=\zeropoint,#1]
      {\framed[\c!frame=\v!off,
	       \c!framecolor=red,
               \c!strut=\v!no,
               \c!offset=\zeropoint,
               \c!width=\v!fit,
               \c!height=\v!fit,
               \c!background={foreground,simpleslides:background:highlight}]
      {#2}}}


%D This macro places the picture in horizontal mode.

\def\doIncludePictureHorizontal[#1]#2% graphic text
 {\setPictureDimensionsTo{#1}\PictureFrameHeight\textwidth
  \SlideTitle{#2}%
  \doplacePictureFrame
    [\c!width=\textwidth,
     \c!height=\PictureFrameHeight]
    {\externalfigure[#1]
                    [\c!height=\getvalue{simpleslides:picture:height},
                      \c!width=\getvalue{simpleslides:picture:width},
                       \c!page=\simpleslidesPictureParameter\c!page]}%
    \page}% Otherwise last page is not correct in \MKII.

%D This macro places the picture in vertical mode.

\def\doIncludePictureVertical[#1]#2% graphic text
  {\page
   \setPictureDimensionsTo{#1}\PictureFrameHeight\PictureFrameWidth
    \setupPageBackground[vertical]
    \startcombination[2]
      {\doplacePictureFrame
        [\c!height=\textheight,
         \c!width=\PictureFrameWidth]
         {\externalfigure[#1]
                    [\c!height=\getvalue{simpleslides:picture:height},
                      \c!width=\getvalue{simpleslides:picture:width},
                       \c!page=\simpleslidesPictureParameter\c!page]}}{}
       {\framed[\c!frame=\v!off,
                \c!framecolor=blue,
                \c!height=\textheight,
                \c!width=\PictureFrameWidth,
                background=\simpleslidesPictureParameter{verticalbackground},
                backgroundcolor=\simpleslidesPictureParameter{verticalbackgroundcolor},
 	        foregroundcolor=\simpleslidesPictureParameter{verticalforegroundcolor},
                \c!top=\vss,
                \c!bottom=\vss,
                \c!align=\v!middle,
                \c!strut=\v!no]{#2}}{}
    \stopcombination
    \page}% Otherwise last page is not correct in \MKII.

%D This macro places the picture in full page mode

\def\doIncludePicturePage[#1]#2% graphic text
 {%\setPictureDimensionsTo{#1}{0.95\paperheight}{0.95\paperwidth}
  \getvalue{simpleslides:slidetitle:page}{#2}%
  \setupPageBackground[page]%
  \doplacePictureFrame
    [\c!width=\paperwidth,
     \c!height=\paperheight]
    {\externalfigure[#1]
                    [\c!height=\paperheight,
                      \c!width=\paperwidth,
                       \c!page=\simpleslidesPictureParameter\c!page]}%
    \page}% Otherwise last page is not correct in \MKII.
   
%D Now, we define the main \METAPOST\ graphic to highlight the picture. It first
%D checks if the user has asked for a grid, and if so, draws a grid and a
%D subgrid. Then it checks which alternative (arrow, circle, focus) is requested
%D and draws that. Notice that we have intermixed \TEX\ and \METAPOST, 
%D exploiting the power of the MP-TEX interaction provided by \CONTEXT.

\startuseMPgraphic{simpleslides:MP:highlight}
\ifconditional \simpleslidesHighlight
  \ifconditional \simpleslidesGrid
	\includeMPgraphic{simpleslides:MP:highlight:grid}
    \ifconditional \simpleslidesSubGrid
      \includeMPgraphic{simpleslides:MP:highlight:subgrid}%
    \fi
  \fi
 \ifcase \simpleslidesHighlightAlternative \or
  \includeMPgraphic{simpleslides:MP:highligh:circle} \or
  \includeMPgraphic{simpleslides:MP:highligh:arrow}  \or
  \includeMPgraphic{simpleslides:MP:highligh:focus}  \fi
  \fi
  setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic

%D Metapost graphic to draw a 10x10 grid on a picture. The width of the grid
%D line is 1/250th of the width of the picture, so smaller picture have smaller
%D grid lines.

\startuseMPgraphic{simpleslides:MP:highlight:grid}
  save xaxis, yaxis ; path xaxis, yaxis ;
  xaxis := leftboundary OverlayBox ;
  yaxis := bottomboundary OverlayBox ;


  for i = 0 upto 10 :

    draw xaxis shifted (i/10*OverlayWidth, 0) 
               withpen pencircle scaled (OverlayWidth/250) 
               withcolor \MPcolor\simpleslidesGridColor ;

    draw yaxis shifted (0,i/10*OverlayHeight) 
               withpen pencircle scaled (OverlayWidth/250) 
               withcolor \MPcolor\simpleslidesGridColor ;

    label.bot(textext("\switchtobodyfont[9pt]\startcolor[simpleslides:textcolor]" 
                     & decimal i & "\stopcolor"),
              (i/10*OverlayWidth, 0)) ;
    label.top(textext("\switchtobodyfont[9pt]\startcolor[simpleslides:textcolor]" 
                      & decimal i & "\stopcolor"),
              (i/10*OverlayWidth, OverlayHeight)) ;

    label.lft(textext("\switchtobodyfont[9pt]\startcolor[simpleslides:textcolor]" 
                     & decimal i & "\stopcolor"),
              (0, i/10*OverlayHeight)) ;
    label.rt(textext("\switchtobodyfont[9pt]\startcolor[simpleslides:textcolor]" 
                    & decimal i & "\stopcolor"),
              (OverlayWidth, i/10*OverlayHeight)) ;
  endfor ;
  setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic

%D The Metapost graphic draws a fine grid on the picture. The number of grid
%D lines is controlled by \type{steps} parameter of \type{\setupPicture}. Each
%D grid box of the 10x10 grid drawn above is subdivided into \type{steps} number
%D of finer lines. 

\startuseMPgraphic{simpleslides:MP:highlight:subgrid}
  save xaxis, yaxis ; path xaxis, yaxis ;
  xaxis := leftboundary OverlayBox ;
  yaxis := bottomboundary OverlayBox ;


  save stepSize ; numeric stepSize ;
  stepSize := \simpleslidesPictureParameter{steps} + epsilon ;

  for i = 0 step 10/stepSize until 100 :
    if i mod 10 <> 0 :
      draw xaxis shifted (i/100*OverlayWidth, 0) 
                 withpen pencircle scaled (OverlayWidth/500) 
                 withcolor \MPcolor\simpleslidesGridColor ;
      draw yaxis shifted (0,i/100*OverlayHeight) 
                 withpen pencircle scaled (OverlayWidth/500) 
                 withcolor \MPcolor\simpleslidesGridColor ;
    fi 

  endfor ;
  setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic


%D This is a helper macro to get the dimensions for the circle. Taking care of
%D expansion inside Metapost is tricky, so we define an external macro to set
%D the x and y scales correctly. This macro does not check if both x and y are
%D equal to 'couple'. We should probably catch that error inside Metapost, and
%D give an error message on the terminal if that is the case.


\def\simpleslidesSetEllipseDimensions%
  {\edef\simpleslidesCurrentXscale{\simpleslidesPictureParameter{\c!x\c!scale}}
   \edef\simpleslidesCurrentYscale{\simpleslidesPictureParameter{\c!y\c!scale}}
   \doifelse{\simpleslidesCurrentXscale}{couple}
     {\doifelse{\simpleslidesCurrentYscale}{couple}
       {\edef\simpleslidesCurrentXscale{1}
        \edef\simpleslidesCurrentYscale{1}}
       {\dosimpleslidesSetEllipseDimensions}}
    {\dosimpleslidesSetEllipseDimensions}}

\def\dosimpleslidesSetEllipseDimensions%
  {\processaction
     [\simpleslidesCurrentXscale]
     [    couple=>\edef\simpleslidesCurrentXscale{\simpleslidesCurrentYscale*OverlayHeight/5},
      \v!unknown=>\edef\simpleslidesCurrentXscale{\simpleslidesCurrentXscale*OverlayWidth/5}]
   \processaction
     [\simpleslidesCurrentYscale]
     [    couple=>\edef\simpleslidesCurrentYscale{\simpleslidesCurrentXscale}, % no *OverlayWidth/5, it has already been scaled
      \v!unknown=>\edef\simpleslidesCurrentYscale{\simpleslidesCurrentYscale*OverlayHeight/5}]}

%D Metapost graphic to draw a circle. The circle is centered at (x,y) with a
%D x-radius equal to \type{xscale} and y-radius equal to \type{yscale}. If
%D either \type{xscale} or \type{yscale} equals \type{couple}, a circle is drawn
%D with radius equal to the other (non-couple) scale parameter. The thickness of
%D the circle is \type{rulethickness} and the color is \type{color}. The
%D circle is rotated by an angle \type{direction}

\startuseMPgraphic{simpleslides:MP:highligh:circle}
  save p; path p;
  p := fullcircle xyscaled 
        % The dimensions are divided by 5 rather than 10, since the scale 
        % measures the radius, rather than the diameter.
        (\simpleslidesCurrentXscale, \simpleslidesCurrentYscale)
       rotated (\simpleslidesPictureParameter\c!direction) 
       shifted
       (\simpleslidesPictureParameter\c!x *OverlayWidth/10,
        \simpleslidesPictureParameter\c!y *OverlayHeight/10)  ;

  \ifcase \simpleslidesShadow \else
  
  save shadow_direction ; pair shadow_direction ;
  shadow_direction =\simpleslidesPictureParameter\c!rulethickness * 
     \ifcase \simpleslidesShadow \or
          (-1,1) \or (1,1) \or (1,-1) \or (-1,-1) \fi ;


  save shadow_thickness ; numeric shadow_thickness ;
  shadow_thickness := 1.5 * \simpleslidesPictureParameter\c!rulethickness ;

  def shadow_draw = draw enddef ;

  \includeMPgraphic{simpleslides:MP:highligh:shadow}
  \fi

  draw p withcolor \MPcolor{\simpleslidesPictureParameter\c!color} 
       withpen pencircle scaled (\simpleslidesPictureParameter\c!rulethickness);

\stopuseMPgraphic

%D Metapost graphic to draw an arrow. The arrow's tip is at \type{(x,y)}, and it
%D is \type{length} long in the direction specified by \type{direction}. The
%D arrow is \type{2×rulethickness} thick (the factor of 2 is there so that the
%D same default works for both circle and arrows) and is on \type{color} color.

\startuseMPgraphic{simpleslides:MP:highligh:arrow}
  autoarrows := true ; % so that arrow heads are scaled correctly.

  z1 = (\simpleslidesPictureParameter\c!x *OverlayWidth/10,
        \simpleslidesPictureParameter\c!y *OverlayHeight/10)   ;
  z2 = z1 + \simpleslidesPictureParameter{length} *
            dir(\simpleslidesPictureParameter{direction}) ;

  save p ; path p ;
  p := z2 -- z1 ;

  \ifcase \simpleslidesShadow \else
  save shadow_direction ; pair shadow_direction ;
  shadow_direction = 2*\simpleslidesPictureParameter\c!rulethickness * 
     dir(%\simpleslidesPictureParameter{direction} +
     \ifcase \simpleslidesShadow \or 
          135 \or 45 \or -45 \or -135 \fi ) ;

  save shadow_thickness ; numeric shadow_thickness ;
  shadow_thickness := 2*\simpleslidesPictureParameter\c!rulethickness ;

  def shadow_draw = drawarrow enddef ;

  \includeMPgraphic{simpleslides:MP:highligh:shadow}
  \fi

  drawarrow p
       withcolor \MPcolor{\simpleslidesPictureParameter\c!color} 
       withpen pencircle scaled (2*\simpleslidesPictureParameter\c!rulethickness);

\stopuseMPgraphic

%D Metapost graphic to focus on a particular area. The coordinates of the focus
%D area are equivalent to that of \type{alternative=circle}. The "unfocussed"
%D area is covered with \type{shadowcolor} made transparent by
%D \type{opacity} amount.

\startuseMPgraphic{simpleslides:MP:highligh:focus}
  save p; path p;
  p := fullcircle xyscaled 
        % The dimensions are divided by 5 rather than 10, since the scale 
        % measures the radius, rather than the diameter.
        (\simpleslidesCurrentXscale, \simpleslidesCurrentYscale)
       rotated (\simpleslidesPictureParameter\c!direction) 
       shifted
       (\simpleslidesPictureParameter\c!x *OverlayWidth/10,
        \simpleslidesPictureParameter\c!y *OverlayHeight/10)  ;

  fill OverlayBox -- reverse p -- cycle
       withcolor transparent (1,
         \simpleslidesPictureParameter{opacity},
         \MPcolor{\simpleslidesPictureParameter{shadow\c!color}}) ;
\stopuseMPgraphic

%D The next Metapost graphic draws an arrow. To ensure code re-usability, we
%D assume that the shape of the shadow is stored as a path \type{p}, it is
%D shifted by amount \type{shadow_direction} and its thickness is
%D \type{shadow_thickness}. It is the responsibility of the calling function to
%D ensure that this is done. There are four options for the shadow,
%D \type{topleft}, \type{topright}, \type{bottomright}, and \type{bottomleft}.
%D (TODO: Keep this thickness configurable). The shadow is drawn in color
%D \type{shadowcolor}. The arrow is drawn with a transparent color whose opacity
%D is given by \type{opacity}.

\startuseMPgraphic{simpleslides:MP:highligh:shadow}
  %% I hope there were a better way to do this.
  for i = 1 upto 20 :
  shadow_draw p shifted shadow_direction 
       withcolor transparent (1,
         \simpleslidesPictureParameter{opacity}/10, % 0.1,
         \MPcolor{\simpleslidesPictureParameter{shadow\c!color}}) 
       withpen pencircle scaled (i*shadow_thickness/20) ;
  endfor 
\stopuseMPgraphic


%D This is a small square which will be used for itemizations; it will be
%D placed in the margin. 

\startuniqueMPgraphic{simpleslides:itemize:triangle}
  fill (0,0) -- (0,0.4cm) -- (0.6cm,0.2cm) -- cycle 
       withcolor \MPcolor{simpleslides:itemize:color} ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{simpleslides:itemize:square}
  fill unitsquare xyscaled(0.4cm,0.4cm) 
       withcolor \MPcolor{simpleslides:itemize:color} ;
\stopuniqueMPgraphic

%D Sometimes we want an image as a background of a page. For that, we use the
%D following macro. You need to set a transparent image foreground color for
%D this to work. TODO: This macro should be combined with \type{\SlideTitle}

\def\SlideBackground#1%
  {\setlayer[simpleslides:layer:extras]
    {\externalfigure
    [#1]
    [width=\paperwidth,height=\paperheight,
    background={foreground,color},backgroundcolor=simpleslides:imageforegroundcolor]}}




\protect

\stopmodule

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Undefined controle sequence with usemodule[simpleslides]
@ 2012-01-04  9:34 pol stra
  2011-01-04 17:58 ` Aditya Mahajan
  2012-01-04 18:27 ` Hans Hagen
  0 siblings, 2 replies; 3+ messages in thread
From: pol stra @ 2012-01-04  9:34 UTC (permalink / raw)
  To: conteXt mail


[-- Attachment #1.1: Type: text/plain, Size: 1247 bytes --]








Dear all,

I tried to compile the first example of the simpleslide module’s documentation, but it doesn’t work:
! Undefined control sequence.

system          > tex > error on line 9 in file test-simple.tex: Undefined control sequence ...

 1     \usemodule[simpleslides]
 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9 >>  \placeTitle
10     \SlideTitle {The first slide}
11     Write whatever you want.
12     \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:title:
\dousestylehashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \douses...
\dostartattributes ...estylehashparameter {#1}{#2}
                                                  \dousecolorhashparameter {...
\placeTitle ...pleslides:title:}\c!style \c!color 
                                                  \simpleslidestitlecomponen...
l.9 \placeTitle
               
? 
! Undefined control sequence.

Thanks (I hope I’m not too unpolite)

 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 1724 bytes --]

[-- Attachment #2: test-simple.log --]
[-- Type: application/octet-stream, Size: 25665 bytes --]

(test-simple.tex

ConTeXt  ver: 2012.01.02 21:59 MKIV  fmt: 2012.1.4  int: english/english

system          > cont-new.mkiv loaded
(/opt/context-minimals/texmf-context/tex/context/base/cont-new.mkiv
system          > beware: some patches loaded from cont-new.mkiv
)
system          > test-simple.top loaded

system          > options > start used options

used options    > % runtime options files (command line driven)
used options    > \unprotect
used options    > % feedback and basic job control
used options    > % handy for special styles
used options    > \startluacode
used options    > document = document or { }
used options    > document.arguments={
used options    > }
used options    > document.files={
used options    >  "test-simple.tex",
used options    > }
used options    > \stopluacode
used options    > % process info
used options    > \setupsystem[inputfile=test-simple.tex]
used options    > \setupsystem[\c!n=1,\c!m=1]
used options    > % modes
used options    > % options (not that important)
used options    > \startsetups *runtime:options
used options    > \stopsetups
used options    > % styles and modules
used options    > \startsetups *runtime:modules
used options    > \stopsetups
used options    > % done
used options    > \protect \endinput

system          > options > stop used options

(test-simple.top)
fonts           > latin modern fonts are not preloaded
languages       > language en is active
resolvers       > modules > loaded: 'simpleslides'
(/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/t-simpleslides.tex
loading         > module simpleslides
resolvers       > modules > loaded: 'default'
(/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-f-default.tex
simpleslides    > loading default font setup
fonts           > preloading latin modern fonts (third stage)
(/opt/context-minimals/texmf-context/tex/context/base/type-siz.mkiv) (/opt/context-minimals/texmf-context/tex/context/base/type-otf.mkiv)
files           > readfile > asked name: 'loc', not found
(/opt/context-minimals/texmf-context/tex/context/base/type-otf.mkiv){/opt/context-minimals/texmf-fonts/fonts/map/dvips/lm/lm-math.map}{/opt/context-minimals/texmf-fonts/fonts/map/dvips/lm/lm-rm.map}{/opt/context-minimals/texmf-fonts/fonts/map/pdftex/context/mkiv-base.map}
fonts           > fallback modern ss 17pt is loaded
)
resolvers       > modules > loaded: 'default'
(/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-s-default.tex
simpleslides    > loading default style setup
colors          > rgb color space is not supported
colors          > cmyk color space is not supported
)
resolvers       > modules > loaded: 'simpleslides-s-BigNumber'
(/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-s-BigNumber.tex
simpleslides    > loading Big Number style
colors          > rgb color space is not supported
colors          > cmyk color space is not supported
))
! Undefined control sequence.

system          > tex > error on line 9 in file test-simple.tex: Undefined control sequence ...

 1     \usemodule[simpleslides]
 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9 >>  \placeTitle
10     \SlideTitle {The first slide}
11     Write whatever you want.
12     \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:title:
\dousestylehashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \douses...
\dostartattributes ...estylehashparameter {#1}{#2}
                                                  \dousecolorhashparameter {...
\placeTitle ...pleslides:title:}\c!style \c!color 
                                                  \simpleslidestitlecomponen...
l.9 \placeTitle
               
? 
! Undefined control sequence.

system          > tex > error on line 9 in file test-simple.tex: Undefined control sequence ...

 1     \usemodule[simpleslides]
 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9 >>  \placeTitle
10     \SlideTitle {The first slide}
11     Write whatever you want.
12     \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:title:
\dousecolorhashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \dousec...
\placeTitle ...pleslides:title:}\c!style \c!color 
                                                  \simpleslidestitlecomponen...
l.9 \placeTitle
               
? 
! Undefined control sequence.

system          > tex > error on line 9 in file test-simple.tex: Undefined control sequence ...

 1     \usemodule[simpleslides]
 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9 >>  \placeTitle
10     \SlideTitle {The first slide}
11     Write whatever you want.
12     \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:title:
\dousestylehashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \douses...
\doattributes ...\dousestylehashparameter {#1}{#2}
                                                  \dousecolorhashparameter {...
\simpleslidestitlecomponent ...eslides:title}{#1}}
                                                   \stopalignment \simplesli...
\placeTitle ...impleslidestitlecomponent \c!title 
                                                  \simpleslidestitlecomponen...
l.9 \placeTitle
               
? 
! Undefined control sequence.

system          > tex > error on line 9 in file test-simple.tex: Undefined control sequence ...

 1     \usemodule[simpleslides]
 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9 >>  \placeTitle
10     \SlideTitle {The first slide}
11     Write whatever you want.
12     \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:title:
\dousecolorhashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \dousec...
\doattributes ...\dousecolorhashparameter {#1}{#3}
                                                  #4\endgroup 
\simpleslidestitlecomponent ...eslides:title}{#1}}
                                                   \stopalignment \simplesli...
\placeTitle ...impleslidestitlecomponent \c!title 
                                                  \simpleslidestitlecomponen...
l.9 \placeTitle
               
? 
! Undefined control sequence.

system          > tex > error on line 9 in file test-simple.tex: Undefined control sequence ...

 1     \usemodule[simpleslides]
 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9 >>  \placeTitle
10     \SlideTitle {The first slide}
11     Write whatever you want.
12     \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:title:
\dousestylehashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \douses...
\doattributes ...\dousestylehashparameter {#1}{#2}
                                                  \dousecolorhashparameter {...
\simpleslidestitlecomponent ...eslides:title}{#1}}
                                                   \stopalignment \simplesli...
\placeTitle ...mpleslidestitlecomponent \c!author 
                                                  \simpleslidestitlecomponen...
l.9 \placeTitle
               
? 
! Undefined control sequence.

system          > tex > error on line 9 in file test-simple.tex: Undefined control sequence ...

 1     \usemodule[simpleslides]
 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9 >>  \placeTitle
10     \SlideTitle {The first slide}
11     Write whatever you want.
12     \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:title:
\dousecolorhashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \dousec...
\doattributes ...\dousecolorhashparameter {#1}{#3}
                                                  #4\endgroup 
\simpleslidestitlecomponent ...eslides:title}{#1}}
                                                   \stopalignment \simplesli...
\placeTitle ...mpleslidestitlecomponent \c!author 
                                                  \simpleslidestitlecomponen...
l.9 \placeTitle
               
? 
! Undefined control sequence.

system          > tex > error on line 9 in file test-simple.tex: Undefined control sequence ...

 1     \usemodule[simpleslides]
 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9 >>  \placeTitle
10     \SlideTitle {The first slide}
11     Write whatever you want.
12     \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:title:
\dousestylehashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \douses...
\doattributes ...\dousestylehashparameter {#1}{#2}
                                                  \dousecolorhashparameter {...
\simpleslidestitlecomponent ...eslides:title}{#1}}
                                                   \stopalignment \simplesli...
\placeTitle ...simpleslidestitlecomponent \c!date 
                                                  \dostopattributes \stopali...
l.9 \placeTitle
               
? 
! Undefined control sequence.

system          > tex > error on line 9 in file test-simple.tex: Undefined control sequence ...

 1     \usemodule[simpleslides]
 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9 >>  \placeTitle
10     \SlideTitle {The first slide}
11     Write whatever you want.
12     \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:title:
\dousecolorhashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \dousec...
\doattributes ...\dousecolorhashparameter {#1}{#3}
                                                  #4\endgroup 
\simpleslidestitlecomponent ...eslides:title}{#1}}
                                                   \stopalignment \simplesli...
\placeTitle ...simpleslidestitlecomponent \c!date 
                                                  \dostopattributes \stopali...
l.9 \placeTitle
               
? 
metapost        > initializing instance 'metafun' using format 'metafun'
metapost        > loading 'metafun': /opt/context-minimals/texmf-context/metapost/context/base/metafun.mpiv
backend         > xmp > using file '/opt/context-minimals/texmf-context/tex/context/base/lpdf-pdx.xml'
pages           > flushing realpage 1, userpage 1, subpage 1
! Undefined control sequence.

system          > tex > error on line 10 in file test-simple.tex: Undefined control sequence ...

 1     \usemodule[simpleslides]
 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9     \placeTitle
10 >>  \SlideTitle {The first slide}
11     Write whatever you want.
12     \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:slidetitle:
\dousestylehashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \douses...
\doattributes ...\dousestylehashparameter {#1}{#2}
                                                  \dousecolorhashparameter {...
\simpleslides:slidetitle:layer ...le \c!color {#1}
                                                  }}\simpleslidesslidetitlep...
l.10 \SlideTitle {The first slide}
                                  
? 
! Undefined control sequence.

system          > tex > error on line 10 in file test-simple.tex: Undefined control sequence ...

 1     \usemodule[simpleslides]
 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9     \placeTitle
10 >>  \SlideTitle {The first slide}
11     Write whatever you want.
12     \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:slidetitle:
\dousecolorhashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \dousec...
\doattributes ...\dousecolorhashparameter {#1}{#3}
                                                  #4\endgroup 
\simpleslides:slidetitle:layer ...le \c!color {#1}
                                                  }}\simpleslidesslidetitlep...
l.10 \SlideTitle {The first slide}
                                  
? 
pages           > flushing realpage 2, userpage 2
! Undefined control sequence.

system          > tex > error on line 12 in file test-simple.tex: Undefined control sequence ...

 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9     \placeTitle
10     \SlideTitle {The first slide}
11     Write whatever you want.
12 >>  \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:slidetitle:
\dousestylehashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \douses...
\doattributes ...\dousestylehashparameter {#1}{#2}
                                                  \dousecolorhashparameter {...
\simpleslides:slidetitle:layer ...le \c!color {#1}
                                                  }}\simpleslidesslidetitlep...
l.12 \SlideTitle {The second slide}
                                   
? 
! Undefined control sequence.

system          > tex > error on line 12 in file test-simple.tex: Undefined control sequence ...

 2     [style=BigNumber]
 3     \setupTitle
 4     [ title={Title of the presentation},
 5     author={Name of authors},
 6     date={Date of presentation},
 7     ]
 8     \starttext
 9     \placeTitle
10     \SlideTitle {The first slide}
11     Write whatever you want.
12 >>  \SlideTitle {The second slide}
13     Continue writing.
14     \stoptext
15     

<argument> \??vars 
                   :simpleslides:slidetitle:
\dousecolorhashparameter #1#2->\ifcsname #1
                                           #2\endcsname \expandafter \dousec...
\doattributes ...\dousecolorhashparameter {#1}{#3}
                                                  #4\endgroup 
\simpleslides:slidetitle:layer ...le \c!color {#1}
                                                  }}\simpleslidesslidetitlep...
l.12 \SlideTitle {The second slide}
                                   
? 
pages           > flushing realpage 3, userpage 3
 )</opt/context-minimals/texmf-fonts/fonts/opentype/public/lm/lmsans10-regular.otf>

system          > files > start used files

used files      >    1: filename=mult-mps.lua | filetype=tex | format=tex | foundname=/opt/context-minimals/texmf-context/tex/context/base/mult-mps.lua | usedmethod=database
used files      >    2: filename=test-simple.tex | foundname=test-simple.tex | usedmethod=direct
used files      >    3: filename=cont-new.mkiv | filetype=tex | foundname=/opt/context-minimals/texmf-context/tex/context/base/cont-new.mkiv | usedmethod=database
used files      >    4: filename=test-simple.top | foundname=test-simple.top | usedmethod=direct
used files      >    5: filename=lang-us.lua | filetype=lua | foundname=/opt/context-minimals/texmf-context/tex/context/patterns/lang-us.lua | usedmethod=database
used files      >    6: filename=t-simpleslides.tex | filetype=tex | foundname=/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/t-simpleslides.tex | usedmethod=database
used files      >    7: filename=t-simpleslides.tex | filetype=tex | format=tex | foundname=/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/t-simpleslides.tex | usedmethod=database
used files      >    8: filename=opt/context-minimals/texmf-modules/tex/context/third/simpleslides/t-simpleslides.tex | foundname=/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/t-simpleslides.tex | usedmethod=qualified
used files      >    9: filename=simpleslides-f-default.tex | filetype=tex | foundname=/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-f-default.tex | usedmethod=database
used files      >   10: filename=simpleslides-f-default.tex | filetype=tex | format=tex | foundname=/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-f-default.tex | usedmethod=database
used files      >   11: filename=opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-f-default.tex | foundname=/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-f-default.tex | usedmethod=qualified
used files      >   12: filename=type-siz.mkiv | filetype=tex | foundname=/opt/context-minimals/texmf-context/tex/context/base/type-siz.mkiv | usedmethod=database
used files      >   13: filename=type-otf.mkiv | filetype=tex | foundname=/opt/context-minimals/texmf-context/tex/context/base/type-otf.mkiv | usedmethod=database
used files      >   14: filename=lm-math.lfg | filetype=tex | foundname=/opt/context-minimals/texmf-context/tex/context/fonts/lm-math.lfg | usedmethod=database
used files      >   15: filename=lm-math.map | filetype=map | format=map | foundname=/opt/context-minimals/texmf-fonts/fonts/map/dvips/lm/lm-math.map | usedmethod=database
used files      >   16: filename=lm-rm.map | filetype=map | format=map | foundname=/opt/context-minimals/texmf-fonts/fonts/map/dvips/lm/lm-rm.map | usedmethod=database
used files      >   17: filename=mkiv-base.map | filetype=map | format=map | foundname=/opt/context-minimals/texmf-fonts/fonts/map/pdftex/context/mkiv-base.map | usedmethod=database
used files      >   18: filename=lmsans10-regular | filetype=otf | format=otf | foundname=/opt/context-minimals/texmf-fonts/fonts/opentype/public/lm/lmsans10-regular.otf | usedmethod=database
used files      >   19: filename=lmmath-regular.otf | filetype=otf | format=otf | foundname=/opt/context-minimals/texmf-fonts/fonts/opentype/public/lm/lmmath-regular.otf | usedmethod=database
used files      >   20: filename=simpleslides-s-default.tex | filetype=tex | foundname=/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-s-default.tex | usedmethod=database
used files      >   21: filename=simpleslides-s-default.tex | filetype=tex | format=tex | foundname=/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-s-default.tex | usedmethod=database
used files      >   22: filename=opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-s-default.tex | foundname=/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-s-default.tex | usedmethod=qualified
used files      >   23: filename=simpleslides-s-BigNumber.tex | filetype=tex | foundname=/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-s-BigNumber.tex | usedmethod=database
used files      >   24: filename=simpleslides-s-BigNumber.tex | filetype=tex | format=tex | foundname=/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-s-BigNumber.tex | usedmethod=database
used files      >   25: filename=opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-s-BigNumber.tex | foundname=/opt/context-minimals/texmf-modules/tex/context/third/simpleslides/simpleslides-s-BigNumber.tex | usedmethod=qualified
used files      >   26: filename=metafun.mpiv | filetype=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/metafun.mpiv | usedmethod=database
used files      >   27: filename=mp-base.mpiv | filetype=mp | format=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/mp-base.mpiv | usedmethod=database
used files      >   28: filename=mp-tool.mpiv | filetype=mp | format=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/mp-tool.mpiv | usedmethod=database
used files      >   29: filename=mp-mlib.mpiv | filetype=mp | format=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/mp-mlib.mpiv | usedmethod=database
used files      >   30: filename=mp-core.mpiv | filetype=mp | format=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/mp-core.mpiv | usedmethod=database
used files      >   31: filename=mp-page.mpiv | filetype=mp | format=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/mp-page.mpiv | usedmethod=database
used files      >   32: filename=mp-butt.mpiv | filetype=mp | format=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/mp-butt.mpiv | usedmethod=database
used files      >   33: filename=mp-shap.mpiv | filetype=mp | format=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/mp-shap.mpiv | usedmethod=database
used files      >   34: filename=mp-grph.mpiv | filetype=mp | format=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/mp-grph.mpiv | usedmethod=database
used files      >   35: filename=mp-grid.mpiv | filetype=mp | format=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/mp-grid.mpiv | usedmethod=database
used files      >   36: filename=mp-form.mpiv | filetype=mp | format=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/mp-form.mpiv | usedmethod=database
used files      >   37: filename=mp-figs.mpiv | filetype=mp | format=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/mp-figs.mpiv | usedmethod=database
used files      >   38: filename=mp-func.mpiv | filetype=mp | format=mp | foundname=/opt/context-minimals/texmf-context/metapost/context/base/mp-func.mpiv | usedmethod=database
used files      >   39: filename=lpdf-pdx.xml | filetype=tex | foundname=/opt/context-minimals/texmf-context/tex/context/base/lpdf-pdx.xml | usedmethod=database

system          > files > stop used files


system          > structure > start used structure

used structure  > text: test-simple

system          > structure > stop used structure


mkiv lua stats  > used config file          - selfautoparent:texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path           - /home/thesarch/texmf-cache/luatex-cache/context/2448223e6631addb83df348d74153606
mkiv lua stats  > resource resolver         - loadtime 0.076 seconds, 0 scans with scantime 0.000 seconds, 0 shared scans, 39 found files, scanned paths: 
mkiv lua stats  > stored bytecode data      - 301 modules, 65 tables, 366 chunks
mkiv lua stats  > cleaned up reserved nodes - 39 nodes, 10 lists of 430
mkiv lua stats  > node memory usage         - 2 glue, 2 penalty, 9 attribute, 44 glue_spec, 3 attribute_list
mkiv lua stats  > node list callback tasks  - 6 unique task lists, 5 instances (re)created, 4640 calls
mkiv lua stats  > used backend              - pdf (backend for directly generating pdf output)
mkiv lua stats  > loaded tex modules        - 4 requested, 4 found (*-simpleslides *-simpleslides-s-BigNumber simpleslides-f-default simpleslides-s-default), 0 missing
mkiv lua stats  > loaded patterns           - en::2
mkiv lua stats  > jobdata time              - 0.000 seconds saving, 0.000 seconds loading
mkiv lua stats  > callbacks                 - 5001 direct, 6411 indirect, 11412 total
mkiv lua stats  > lxml preparation time     - 0.000 seconds, 0 nodes, 11 lpath calls, 0 cached calls
mkiv lua stats  > result saved in file      - test-simple.pdf
mkiv lua stats  > loaded fonts              - 2 files: lmmath-regular.otf lmsans10-regular.otf
mkiv lua stats  > fonts load time           - 0.325 seconds 
mkiv lua stats  > metapost processing time  - 0.051 seconds, loading: 0.083 seconds, execution: 0.048 seconds, n: 3
mkiv lua stats  > luatex banner             - this is luatex, version beta-0.70.1-2011051918 (rev 4277)
mkiv lua stats  > control sequences         - 33307 of 65536 + 100000
mkiv lua stats  > current memory usage      - 43 MB (ctx: 44 MB)
mkiv lua stats  > runtime                   - 21.619 seconds, 2 processed pages, 3 shipped pages, 0.139 pages/second


[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Undefined controle sequence with usemodule[simpleslides]
  2012-01-04  9:34 Undefined controle sequence with usemodule[simpleslides] pol stra
  2011-01-04 17:58 ` Aditya Mahajan
@ 2012-01-04 18:27 ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2012-01-04 18:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: pol stra

On 4-1-2012 10:34, pol stra wrote:

> Dear all,
>
> I tried to compile the first example of the simpleslide module’s documentation, but it doesn’t work:
> ! Undefined control sequence.

> ! Undefined control sequence.
>
> Thanks (I hope I’m not too unpolite)

The simple slide module uses an experimental version of what we call the 
command handler. It is a slightly slower but more flexible way to deal 
with parameters (in practice it's often faster as associated code gets 
updated). Anyhow, the slide module has to be adapted to the latest 
variant which uses a higher level of abstraction.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-04 18:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-04  9:34 Undefined controle sequence with usemodule[simpleslides] pol stra
2011-01-04 17:58 ` Aditya Mahajan
2012-01-04 18:27 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).