Next / Previous / Contents / Shipman's homepage

7. Inline markup

DocBook has a number of elements that are useful for marking up content within a paragraph. By inline markup, we refer to tags that appear within a paragraph and do not change or interrupt its basic paragraph shape.

acronym

An abbreviation, generally made from the initial letters of words, and sometimes pronounceable. For example:

  <acronym>PEBKAC</acronym> stands for: Problem exists
  between keyboard and chair.

PEBKAC stands for: Problem exists between keyboard and chair.

application

Names of packages. Example:

Start <application>emacs</application>.

Start emacs.

citetitle

Used for citing works by their title. Example:

Have you read <citetitle>Ringworld</citetitle>?

Have you read Ringworld?

code

For program source code. Example:

Next we define the <code >panic()</code > function.

Next we define the panic() function.

computeroutput

Computer-generated output. Example:

<computeroutput>OA210I OLD PSW WAS FF04230C 1200234B</computeroutput>

OA210I OLD PSW WAS FF04230C 1200234B

emphasis

Used for emphasized text. Example:

Don't <emphasis>do</emphasis> that then.

Don't do that then.

For boldface, add the attribute role='strong'. Example:

A five-ounce bird could <emphasis role='strong'>not</emphasis>
hold a one-pound coconut.

A five-ounce bird could not hold a one-pound coconut.

filename

For file names and path names. Example:

Packages live in <filename>/fs/packages</filename>.

Packages live in /fs/packages.

firstterm

For the first use of a term just being defined. Example:

The term <firstterm >spam</firstterm > refers to unsolicited
commercial e-mail.

The term spam refers to unsolicited commercial e-mail.

foreignphrase

Used to set off words in a different language than the surrounding text.

These sharks are in genus <foreignphrase>Squalus</foreignphrase>.

These sharks are in genus Squalus.

guibutton

Buttons in a graphical user interface. Example:

To exit, click on the <guibutton>Quit</guibutton> button.

To exit, click on the Quit button.

guiicon

An icon in a graphical user interface.

guilabel

A label in a graphical user interface.

guimenu

A menu in a graphical user interface. Example:

Pull down the <guimenu>Team</guimenu> menu.

Pull down the Team menu.

keysym

For names of keys on a keyboard. Example:

Press <keysym>Enter</keysym>.

Press Enter.

quote

For in-line quotations. One could simply use the double-quote characters “…”, but the advantage of the quote element is that it correctly handles quotes within quotes. For example:

I said, <quote>As Carol Schaffer used to say,
<quote>common sense isn't</quote>.</quote>

I said, As Carol Schaffer used to say, common sense isn't.

replaceable

Use this tag for parts of a template, pattern, or general case that will are to be replaced with specific items in practice. Example:

  Call your input file <filename><replaceable
  >f</replaceable >.tex</filename >, where
  <filename ><replaceable >f</replaceable
  ></filename > is some name of your choice.

Call your input file f.tex, where f is some name of your choice.

subscript

Displays the contents below the baseline. Example:

Drink more H<subscript>2</subscript>O.

Drink more H2O.

superscript

Displays the contents above the baseline. Example:

Celebrate the 4<superscript>th</superscript> of July.

Celebrate the 4th of July.

tag

Use this element when you are discussing the various kinds of things in the XML world. The class attribute identifies what kind of thing you are talking about. Here are some examples.

InputAs displayed
<tag class="attribute">align</tag> align, an attribute name.
<tag class="attvalue">left</tag> left, an attribute value.
<tag class="comment">shoes for industry</tag> <!--shoes for industry-->, an XML comment.
<tag class="element">h3</tag> h3, an XML element name.
<tag class="emptytag">hr</tag> <hr/>, an empty XML tag.
<tag class="endtag">h3</tag> </h3>, an XML end tag.
<tag class="genentity">nbsp</tag> &nbsp;, a general entity.
<tag class="localname">mineral</tag> mineral, an XML local name.
<tag class="namespace">xlink</tag> xlink, an XML namespace name.
<tag class="numcharref">x262e</tag> &#x262e;, an XML numeric character reference, the character ☮.
<tag class="paramentity">chapt1</tag> %chapt1;, an XML parameter entity.
<tag class="starttag">ul</tag> <ul>, an XML start tag.
<tag class="xmlpi">xml version='1.0' encoding='utf-8'</tag> <?xml version='1.0' encoding='utf-8'?>, an XML processing instruction.
userinput

For commands or other user input. Example:

Type the command <userinput>make trouble</userinput>.

Type the command make trouble.

varname

For variable names in programs. Example:

Add one to <varname>sheepCount</varname>.

Add one to sheepCount.