ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Commands in verbatim
       [not found] ` <199912211208.NAA24702@fly.srk.fer.hr>
@ 1999-12-21 16:37   ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 1999-12-21 16:37 UTC (permalink / raw)
  Cc: Hans Hagen

At 01:08 PM 12/21/99 +0100, Zeljko Vrba wrote:
>I put this in my file:
>\setuptyping[option=commands,escape=?]
>(I want ? to be escape character because it will not interfere with other
>characters I'll be using in verbatim)
>
>then this:
>\starttyping
>	?underbar{if} expr ..
>\stoptyping
>
>and get this error message:
>
>! Undefined control sequence.
><argument>     \underbar{if}

Since all chars are letters, the {} are not handled. Another escape is
using <<if>> and option=slanted. 

>regular cmr font. BTW, /bf (?bf) works fine. ?underbar if just places a
>single underbar, like this:
>	_if
>(this is typeset by ?underbar if). I'd like
>	if
>	--
>Is it possible to do it?

You could try: 

  \def\Key#1#2x{\underbar{#2}}

(the spaces are important)

  .... ?Key ifx 

that way the x acts as sentinel. 

Even better: 

\def\IfKey{\underbar{if}}

  .... ?IfKey .... 

I would go for the last alternative. 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

* Commands in verbatim
@ 1999-12-17 14:01 Zeljko Vrba
  0 siblings, 0 replies; 2+ messages in thread
From: Zeljko Vrba @ 1999-12-17 14:01 UTC (permalink / raw)


I'm writing a manual for a programming language. All examples should be
in \starttyping \stoptyping pairs. However, I'd like to have underlined
keywords. However, the following doesn't work:

\setuptyping[escape=\\]
\starttyping
  \underbar{keyword}
\stoptyping

I don't get the underlined keyword, but the exact above text.
I've tried other escape characters, but none of them work. Is the escape
option intended for this, anyway? How could I accomplish such a task?


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

end of thread, other threads:[~1999-12-21 16:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3.0.6.32.19991220165848.007e95c0@pop.wxs.nl>
     [not found] ` <199912211208.NAA24702@fly.srk.fer.hr>
1999-12-21 16:37   ` Commands in verbatim Hans Hagen
1999-12-17 14:01 Zeljko Vrba

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).