At 07:05 AM 5/23/2002 +0200, Denis B. Roegel wrote:

>I have a LaTeX `alltt' environment to simulate in ConTeXt. Here is the piece
>of code in LaTeX:
>
>\def\xxxoe/{\oe}
>\begin{alltt}
>struct stat \{
>      dev_t     st_dev;   /* identificateur du p�riph�rique              */
>                          /* o� se trouve le fichier                     */
>      ino_t     st_ino;   /* num�ro du n\xxxoe/ud 
> d'index                      */
>      mode_t    st_mode;  /* droits d'acc�s du fichier                   */
>      nlink_t   st_nlink; /* nombre de liens effectu�s sur le fichier    */
>      uid_t     st_uid;   /* identificateur du propri�taire              */
>      gid_t     st_gid;   /* identificateur du groupe du propri�taire    */
>      dev_t     st_rdev;  /* type de p�riph�rique                        */
>      off_t     st_size;  /* taille en octets du fichier                 */
>      time_t    st_atime; /* date du dernier acc�s au fichier            */
>      time_t    st_mtime; /* date de la derni�re modification du fichier */
>      time_t    st_ctime; /* date du dernier changement du n\xxxoe/ud 
> d'index  */
>\} ;
>\end{alltt}
>
>In this environment, everything is like in \starttyping/\stoptyping,
>except that commands (\{, \}, \xxxoe/) are interpreted. I need such an
>environment, because of the `oe' ligature. If I write n\oe ud in a
>\starttyping/\stoptyping environment, I will get what I write here.
>Also, if I write this in an `alltt' environment, I will keep the
>space, hence the kludge I used. What would be the best ConTeXt way
>to do this?

The most simple solution i can come up with is the rather kludgeless:

\setuptyping[option=commands,escape=\string\ ]

\starttyping
struct stat {
   dev_t     st_dev;   /* identificateur du priphrique                */
                       /* o se trouve le fichier                      */
   ino_t     st_ino;   /* numro du n\oe ud d'index                      */
   mode_t    st_mode;  /* droits d'accs du fichier                    */
   nlink_t   st_nlink; /* nombre de liens effectus sur le fichier     */
   uid_t     st_uid;   /* identificateur du propritaire               */
   gid_t     st_gid;   /* identificateur du groupe du propritaire     */
   dev_t     st_rdev;  /* type de priphrique                          */
   off_t     st_size;  /* taille en octets du fichier                 */
   time_t    st_atime; /* date du dernier accs au fichier             */
   time_t    st_mtime; /* date de la dernire modification du fichier  */
   time_t    st_ctime; /* date du dernier changement du n\oe ud d'index */
} ;
\stoptyping

watch the normal { and }
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | [EMAIL PROTECTED]
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

Reply via email to