Re: Clarification on <samp> element

In message <>, Lydja Williams writes:
>I'm looking for clarification on the <samp> element.  The HTML 2.0 
>specification describes <samp> as follows:
>	"The SAMP type indicates a sequence of literal characters."
>How is this tag commonly used?

It derives from the GNU TeXinfo system:
(disregard the TeXinfo syntax)

File:,  Node: samp,  Next: var,  Prev: key,  Up: Indicating


   Use the `@samp' command to indicate text that is a literal example
or `sample' of a sequence of characters in a file, string, pattern, etc.
Enclose the text in braces.  The argument appears within single
quotation marks in both the Info file and the printed manual; in
addition, it is printed in a fixed-width font.

     To match @samp{foo} at the end of the line,
     use the regexp @samp{foo$}.


     To match `foo' at the end of the line, use the regexp `foo$'.

   Any time you are referring to single characters, you should use
`@samp' unless `@kbd' is more appropriate.  Use `@samp' for the names
of command-line options.  Also, you may use `@samp' for entire
statements in C and for entire shell commands--in this case, `@samp'
often looks better than `@code'.  Basically, `@samp' is a catchall for
whatever is not covered by `@code', `@kbd', or `@key'.

   Only include punctuation marks within braces if they are part of the
string you are specifying.  Write punctuation marks outside the braces
if those punctuation marks are part of the English text that surrounds
the string.  In the following sentence, for example, the commas and
period are outside of the braces:

     In English, the vowels are @samp{a}, @samp{e},
     @samp{i}, @samp{o}, @samp{u}, and sometimes

This produces:

     In English, the vowels are `a', `e', `i', `o', `u',  and sometimes

>  How should I expect the following 
>markup to be displayed in a Web client?
>	<samp>black &amp; white</samp>
>Alternative A:
>	black & white
>Alternative B:
>	black &amp; white


This is an SGML question. If you are implementing a web browser,
and you don't have sgmls installed to test out questions like this,
you're doing everyone a disservice.

You can use the HTML Validation service to ask questions like this:

HTML Validation Service Response

$Id:,v 1.6 1994/11/14 20:55:09 markg Exp $ 

Check Complete

No errors found.



<samp>black &amp; white</samp>

Parsed Output (Element Structure Information Set)

-black & white

You can also use our HTML Check Toolkit as an easy way to
install sgmls at your site:

We currently have custom-built distributions for:

  Sun OS 4.1.3  IRIX-4.0.5  Solaris2.x  BSD V1.1
  HP-UX 9.03  SCO UNIX 3.2.2 and up & SCO Open Desktop 2.0 and up 


Daniel W. Connolly        "We believe in the interconnectedness of all things"
Software Engineer, Hal Software Systems, OLIAS project   (512) 834-9962 x5010

Received on Monday, 21 November 1994 17:27:36 UTC