[xml/sgml-pkgs] Bug#439214: docbook2x-man runs without error but produces no output

Adrian Mariano radian at cox.net
Thu Aug 23 11:02:15 UTC 2007


Package: docbook2x
Version: 0.8.8-4
Severity: important


I ran 

docbook2x-man units.xml

and got no output file.  

In an effort to troubleshoot I ran this:

% db2x_xsltproc -d -s man units.xml -o units.mxml
/usr/bin/xsltproc --nonet --debug --output units.mxml http://docbook2x.sourceforge.net/latest/xslt/man/docbook.xsl units.xml

No information about errors appears. 

The output units.mxml file is basically empty:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<manpageset xmlns="http://docbook2x.sourceforge.net/xmlns/Man-XML"/>

My input file, units.xml was produced from a texinfo file
automatically and appears here:

<?xml version="1.0"?><!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  <!ENTITY tex "TeX">
  <!ENTITY latex "LaTeX">
]>
<book lang="en">
  <title>Units: A Unit Conversion Program</title>
<!-- %**end of header -->
<!-- noman -->
<!-- man .TH UNITS 1   "12 Dec 2004" -->
<!-- man .SH NAME -->
<!-- man units - unit conversion program -->
<!-- noman -->
<!-- end noman -->
  <chapter label="1" id="Overview">
    <title>Overview of <literal>units</literal></title>
    <para>The <literal>units</literal> program converts quantities expressed in various scales
to their equivalents in other scales.  The <literal>units</literal> program can
handle multiplicative scale changes as well as nonlinear
conversions such as Fahrenheit to
<!-- man Celsius. -->
<!-- noman -->Celsius.<footnote><para>But Fahrenheit to
Celsius is linear, you insist.  Not so.  A transformation T is linear if
T(x+y)=T(x)+T(y) and this fails for T(x)=ax+b.  This transformation is
affine, but not linear. </para></footnote>
<!-- end noman -->Temperature conversions require a special
syntax.
<!-- noman -->See <xref linkend="Temperature-Conversion-Example"></xref>.
<!-- end noman -->
<!-- man See the examples below. -->
The units are defined in an external data file.  You can use the
extensive data file that comes with this program, or you can
provide your own data file to suit your needs.</para>
    <para>You can use the program interactively
with prompts, or you can use it
from the command line.</para>
  </chapter>

  <chapter label="2" id="Interactive-use">
    <title>Interacting with <literal>units</literal></title>
    <para><indexterm role="cp"><primary>interactive use</primary></indexterm>
To invoke units for interactive use, type <userinput>units</userinput> at your shell
prompt.  The program will print something like this:</para>
    <screen>
    2131 units, 53 prefixes, 24 nonlinear units

    You have:
     </screen>
    <para role="continues">At the &lsquo;<literal>You have:</literal>&rsquo; prompt, type the quantity and units that
you are converting <emphasis>from</emphasis>.  For example, if you want to convert ten
meters to feet, type <userinput>10 meters</userinput>.  Next, <literal>units</literal> will print
&lsquo;<literal>You want:</literal>&rsquo;.  You should type the type of units you want to convert
<emphasis>to</emphasis>.  To convert to feet, you would type <userinput>feet</userinput>.  Note that if
the readline library was compiled in then the tab key can be used to
complete unit names.  See <xref linkend="Readline-support"></xref>, for more information
about readline.</para>
    <para>The answer will be displayed in two ways.  The first line of output,
which is marked with a &lsquo;<literal>*</literal>&rsquo; to indicate multiplication,
gives the result of the conversion you have asked for.  The second line
of output, which is marked with a &lsquo;<literal>/</literal>&rsquo; to indicate division, gives
the inverse of the conversion factor.  If you convert 10 meters to feet,
<literal>units</literal> will print</para>
    <screen>
        * 32.808399
        / 0.03048
</screen>
    <para role="continues">which tells you that 10 meters equals about 32.8 feet.
The second number gives the conversion in the opposite direction.
In this case, it tells you that 1 foot is equal to about
0.03 dekameters since the dekameter is 10 meters.
It also tells you that 1/32.8 is about .03.</para>
    <para>The <literal>units</literal> program prints the inverse because sometimes it is a
more convenient number.  In the example above, for example, the inverse
value is an exact conversion: a foot is exactly .03048 dekameters.
But the number given the other direction is inexact.</para>
    <para>If you try to convert grains to pounds, you will see the following:</para>
    <screen>
    You have: grains
    You want: pounds
            * 0.00014285714
            / 7000
</screen>
    <para role="continues">From the second line of the output you can immediately see that a grain
is equal to a seven thousandth of a pound.  This is not so obvious from
the first line of the output.
If you find  the output format  confusing, try using the
&lsquo;<literal>--verbose</literal>&rsquo; option:
<indexterm role="cp"><primary>verbose output</primary></indexterm></para>
    <screen>
    You have: grain
    You want: aeginamina
            grain = 0.00010416667 aeginamina
            grain = (1 / 9600) aeginamina
</screen>
    <para>If you request a conversion between units which measure reciprocal
dimensions, then <literal>units</literal> will display the conversion results with an extra
note indicating that reciprocal conversion has been done:
<indexterm role="cp"><primary>reciprocal conversion</primary></indexterm></para>
    <screen>
    You have: 6 ohms
    You want: siemens
            reciprocal conversion
            * 0.16666667
            / 6
</screen>
    <para>Reciprocal conversion can be suppressed by using the &lsquo;<literal>--strict</literal>&rsquo; option.
As usual, use
the &lsquo;<literal>--verbose</literal>&rsquo; option to get more comprehensible output:
<indexterm role="cp"><primary>verbose output</primary></indexterm><indexterm role="cp"><primary>strict conversion</primary></indexterm></para>
    <screen>
    You have: tex
    You want: typp
            reciprocal conversion
            1 / tex = 496.05465 typp
            1 / tex = (1 / 0.0020159069) typp

    You have: 20 mph
    You want: sec/mile
            reciprocal conversion
            1 / 20 mph = 180 sec/mile
            1 / 20 mph = (1 / 0.0055555556) sec/mile
</screen>
    <para>If you enter incompatible unit types, the <literal>units</literal> program will
print a message indicating that the units are not conformable and
it will display the reduced form for each unit:
<indexterm role="cp"><primary>incompatible units</primary></indexterm><indexterm role="cp"><primary>non-conformable units</primary></indexterm></para>
    <screen>
    You have: ergs/hour
    You want: fathoms kg^2 / day
    conformability error
            2.7777778e-11 kg m^2 / sec^3
            2.1166667e-05 kg^2 m / sec
</screen>
    <para>If you only want to find the reduced form or definition of a unit,
simply press return at the &lsquo;<literal>You want:</literal>&rsquo; prompt.  Here is an example:</para>
    <screen>
    You have: jansky
    You want:
            Definition: fluxunit = 1e-26 W/m^2 Hz = 1e-26 kg / s^2
</screen>
    <para role="continues">The output from <literal>units</literal> indicates that the jansky is defined to be
equal to a fluxunit which in turn is defined to be a certain combination
of watts, meters, and hertz.  The fully reduced (and in this case
somewhat more cryptic) form appears on the far right.</para>
    <para>Some named units are treated as dimensionless in some situations.
These include the radian and steradian.  These units will be treated
as equal to 1 in units conversions.  Power is equal to torque times
angular velocity.  This conversion can only be performed if the radian
is dimensionless.</para>
    <screen>
    You have: (14 ft lbf) (12 radians/sec)
    You want: watts
            * 227.77742
            / 0.0043902509
</screen>
    <para role="continues">Note that named dimensionaless units are not treated as dimensionless
in other contexts.  They cannot be used as exponents
so for example, &lsquo;<literal>meter^radian</literal>&rsquo; is not allowed.
<indexterm role="cp"><primary>dimensionless units</primary></indexterm>
If you want a list of options you can type <userinput>?</userinput> at the
&lsquo;<literal>You want:</literal>&rsquo; prompt.  The program will display a list of named
units which are conformable with the unit that you entered at
the &lsquo;<literal>You have:</literal>&rsquo; prompt above.  Note that conformable unit
combinations will not appear on this list.</para>
    <para>Typing <userinput>help</userinput> at either prompt displays a short help message.
You can also type <userinput>help</userinput> followed by a unit name.  This will
invoke a pager on the units data base at the point where that unit
is defined.  You can read the definition and comments that may
give more details or historical information about the unit.</para>
  </chapter>

  <chapter label="3" id="Command-line-use">
    <title>Using <literal>units</literal> non-interactively</title>
    <para><indexterm role="cp"><primary>command line unit conversion</primary></indexterm><indexterm role="cp"><primary>non-interactive unit conversion</primary></indexterm>
The <literal>units</literal> program can perform units conversions non-interactively
from the command line.  To do this, type the command, type the
original units expression, and type the new units you want.
You will probably need to protect the units expressions from
interpretation by the shell using single quote characters.</para>
    <para>If you type</para>
    <screen>
    units '2 liters' 'quarts'
</screen>
    <para role="continues">then <literal>units</literal> will print</para>
    <screen>
        * 2.1133764
        / 0.47317647
</screen>
    <para role="continues">and then exit.
The output tells you that 2 liters is about 2.1 quarts, or alternatively that
a quart is about 0.47 times 2 liters.</para>
    <para>If the conversion is successful, then <literal>units</literal> will return success (0)
to the calling environment.  If <literal>units</literal> is given non-conformable
units to convert, it will print a message giving the reduced form of
each unit and it will return failure (nonzero) to the calling environment.</para>
    <para>When <literal>units</literal> is invoked with only one argument, it will print out
the definition of the specified unit.  It will return failure if the
unit is not defined and success if the unit is defined.</para>
<!-- node-name,  next,  previous,  up -->
  </chapter>

  <chapter label="4" id="Unit-expressions">
    <title>Unit expressions</title>
    <para><indexterm role="cp"><primary>unit expressions</primary></indexterm>
In order to enter more complicated units or fractions,
you will need to use operations such as powers, products and division.
Powers of units can be specified using the &lsquo;<literal>^</literal>&rsquo; character as shown in
the following example, or by simple concatenation: &lsquo;<literal>cm3</literal>&rsquo; is equivalent to
&lsquo;<literal>cm^3</literal>&rsquo;.
If the exponent is more than one digit, the &lsquo;<literal>^</literal>&rsquo; is required.  An
exponent like &lsquo;<literal>2^3^2</literal>&rsquo; is evaluated right to left.  The &lsquo;<literal>^</literal>&rsquo;
operator has the second highest precedence.
<indexterm role="cp"><primary>powers</primary></indexterm><indexterm role="cp"><primary>products</primary></indexterm></para>
    <screen>
    You have: cm^3
    You want: gallons
            * 0.00026417205
            / 3785.4118

    You have: arabicfoot * arabictradepound * force
    You want: ft lbf
            * 0.7296
            / 1.370614
</screen>
    <para>Multiplication of units can be specified by using spaces, or an asterisk
(&lsquo;<literal>*</literal>&rsquo;).  If <literal>units</literal> is invoked with the &lsquo;<literal>--product</literal>&rsquo;
option then the hyphen (&lsquo;<literal>-</literal>&rsquo;) also acts as a multiplication
operator.  Division of units is indicated
by the slash (&lsquo;<literal>/</literal>&rsquo;) or by &lsquo;<literal>per</literal>&rsquo;.
<indexterm role="cp"><primary>multiplication of units</primary></indexterm><indexterm role="cp"><primary>division of units</primary></indexterm></para>
    <screen>
    You have: furlongs per fortnight
    You want: m/s
            * 0.00016630986
            / 6012.8727
</screen>
    <para>Multiplication has a higher precedence than division and is evaluated
left to right, so
&lsquo;<literal>m/s * s/day</literal>&rsquo; is equivalent to &lsquo;<literal>m / s s day</literal>&rsquo; and has dimensions of
length per time cubed.  Similarly, &lsquo;<literal>1/2 meter</literal>&rsquo; refers to a unit of reciprocal length
equivalent to .5/meter, which is
probably not what you would intend if you entered that expression.
You can indicate division of numbers
with the vertical dash (&lsquo;<literal>|</literal>&rsquo;).  This operator has the highest
precedence so the square root of two thirds could be written &lsquo;<literal>2|3^1|2</literal>&rsquo;.
<indexterm role="cp"><primary>fractions</primary></indexterm><indexterm role="cp"><primary>division of numbers</primary></indexterm></para>
    <screen>
    You have: 1|2 inch
    You want: cm
            * 1.27
            / 0.78740157
</screen>
    <para role="continues">Parentheses can be used for grouping as desired.</para>
    <screen>
    You have: (1/2) kg / (kg/meter)
    You want: league
            * 0.00010356166
            / 9656.0833
</screen>
    <para>Prefixes are defined separately from base units.  In order to get
centimeters, the units database defines &lsquo;<literal>centi-</literal>&rsquo; and &lsquo;<literal>c-</literal>&rsquo; as
prefixes.  Prefixes can appear alone with no unit following them.
An exponent applies only to the immediately preceding unit and its
prefix so that &lsquo;<literal>cm^3</literal>&rsquo; or &lsquo;<literal>centimeter^3</literal>&rsquo; refer to cubic centimeters
but &lsquo;<literal>centi*meter^3</literal>&rsquo; refers to hundredths of cubic meters.  Only one
prefix is permitted per unit, so &lsquo;<literal>micromicrofarad</literal>&rsquo; will fail, but
&lsquo;<literal>micro*microfarad</literal>&rsquo; will work, as will &lsquo;<literal>micro microfarad</literal>&rsquo;..</para>
    <para>For <literal>units</literal>, numbers are just another kind of unit.  They can
appear as many times as you like and in any order in a unit expression.
For example, to find the volume of a box which is 2 ft by 3 ft by 12 ft
in steres, you could do the following:</para>
    <screen>
    You have: 2 ft 3 ft 12 ft
    You want: stere
            * 2.038813
            / 0.49048148

    You have: $ 5 / yard
    You want: cents / inch
            * 13.888889
            / 0.072
</screen>
    <para role="continues">And the second example shows how the dollar sign in the units conversion
can precede the five.  Be careful:  <literal>units</literal> will interpret
&lsquo;<literal>$5</literal>&rsquo; with no space as equivalent to dollars^5.</para>
    <para>Outside of the SI system, it is often desirable to add values of
different units together.  You may also wish to use <literal>units</literal> as a
calculator that keeps track of units.  Sums of conformable units are written with
the &lsquo;<literal>+</literal>&rsquo; character.
<indexterm role="cp"><primary>sums of units</primary></indexterm><indexterm role="cp"><primary>addition of units</primary></indexterm></para>
    <screen>
    You have: 2 hours + 23 minutes + 32 seconds
    You want: seconds
            * 8612
            / 0.00011611705

    You have: 12 ft + 3 in
    You want: cm
            * 373.38
            / 0.0026782366

    You have: 2 btu + 450 ft lbf
    You want: btu
            * 2.5782804
            / 0.38785542
</screen>
    <para role="continues">The expressions which are added together must reduce to identical
expressions in primitive units, or an error message will be displayed:</para>
    <screen>
    You have: 12 printerspoint + 4 heredium
                                          ^
    Illegal sum of non-conformable units
</screen>
    <para role="continues">Historically &lsquo;<literal>-</literal>&rsquo; has been used for products of units, which complicates
its iterpretation in <literal>units</literal>.  Because <literal>units</literal> provides
several other ways to obtain unit products, and because &lsquo;<literal>-</literal>&rsquo; is a
subtraction operator in general algebraic expressions, <literal>units</literal>
treats the binary &lsquo;<literal>-</literal>&rsquo; as a subtraction operator by default.  This
behavior can be altered using the &lsquo;<literal>--product</literal>&rsquo; option which
causes <literal>units</literal> to treat the binary &lsquo;<literal>-</literal>&rsquo; operator as a product
operator.  Note that when &lsquo;<literal>-</literal>&rsquo; is a multiplication operator it has
the same precedence as &lsquo;<literal>*</literal>&rsquo;, but when &lsquo;<literal>-</literal>&rsquo; is a subtraction operator
it has the lower precedence as the addition operator.</para>
    <para>When &lsquo;<literal>-</literal>&rsquo; is used as a unary operator it negates its operand.
Regardless of the <literal>units</literal> options, if
&lsquo;<literal>-</literal>&rsquo; appears after &lsquo;<literal>(</literal>&rsquo; or after
&lsquo;<literal>+</literal>&rsquo; then it will act as a negation operator.  So you can always compute 20
degrees minus 12 minutes by entering &lsquo;<literal>20 degrees + -12 arcmin</literal>&rsquo;.
You must use this construction when you define new units because you
cannot know what options will be in force when your definition is
processed.</para>
    <para>The &lsquo;<literal>+</literal>&rsquo; character sometimes appears in exponents like
&lsquo;<literal>3.43e+8</literal>&rsquo;.  This leads to an ambiguity in an expression like
&lsquo;<literal>3e+2 yC</literal>&rsquo;.  The unit &lsquo;<literal>e</literal>&rsquo; is a small unit of charge, so this
can be regarded as equivalent to &lsquo;<literal>(3e+2) yC</literal>&rsquo; or &lsquo;<literal>(3 e)+(2 yC)</literal>&rsquo;.
This ambiguity is resolved by always interpreting &lsquo;<literal>+</literal>&rsquo; as part
of an exponent if possible.</para>
    <para><indexterm role="cp"><primary>functions, built in</primary></indexterm>Several built in functions are provided: &lsquo;<literal>sin</literal>&rsquo;, &lsquo;<literal>cos</literal>&rsquo;,
&lsquo;<literal>tan</literal>&rsquo;, &lsquo;<literal>ln</literal>&rsquo;, &lsquo;<literal>log</literal>&rsquo;, &lsquo;<literal>log2</literal>&rsquo;, &lsquo;<literal>exp</literal>&rsquo;, &lsquo;<literal>acos</literal>&rsquo;,
&lsquo;<literal>atan</literal>&rsquo; and &lsquo;<literal>asin</literal>&rsquo;.  The &lsquo;<literal>sin</literal>&rsquo;, &lsquo;<literal>cos</literal>&rsquo;, and &lsquo;<literal>tan</literal>&rsquo;
functions require either a dimensionless argument or an argument with
dimensions of angle.</para>
    <screen>
    You have: sin(30 degrees)
    You want:
            Definition: 0.5

    You have: sin(pi/2)
    You want:
            Definition: 1

    You have: sin(3 kg)
                      ^
    Unit not dimensionless
</screen>
    <para role="continues">The other functions on the list require dimensionless arguments.  The
inverse trigonometric functions return arguments with dimensions of
angle.</para>
    <para><indexterm role="cp"><primary>roots</primary></indexterm><indexterm role="cp"><primary>square roots</primary></indexterm>If you wish to take roots of units, you may use the &lsquo;<literal>sqrt</literal>&rsquo; or
&lsquo;<literal>cuberoot</literal>&rsquo; functions.  These functions require that the argument
have the appropriate root.  Higher roots can  be obtained by using
fractional exponents:</para>
    <screen>
    You have: sqrt(acre)
    You want: feet
            * 208.71074
            / 0.0047913202

    You have: (400 W/m^2 / stefanboltzmann)^(1/4)
    You have:
            Definition: 289.80882 K

    You have: cuberoot(hectare)
                              ^
    Unit not a root
</screen>
    <sect3 label="" xreflabel="Temperature Conversion Example">
      <title>Temperature Conversion Example</title>
      <para><indexterm role="cp"><primary>temperature conversions</primary></indexterm>
Nonlinear units are represented using functional notation.  They make
possible nonlinear unit conversions such temperature.  This is different
from the linear units that convert temperature differences.  Note the
difference below.  The absolute temperature conversions are handled by
units starting with &lsquo;<literal>temp</literal>&rsquo;, and you must use functional notation.
The temperature differences are done using units starting with
&lsquo;<literal>deg</literal>&rsquo; and they do not require functional notation.</para>
      <screen>
    You have: tempF(45)
    You want: tempC
            7.2222222

    You have: 45 degF
    You want: degC
            * 25
            / 0.04
</screen>
      <para>Think of &lsquo;<literal>tempF(x)</literal>&rsquo; not as a function but as a notation which
indicates that &lsquo;<literal>x</literal>&rsquo; should have units of &lsquo;<literal>tempF</literal>&rsquo; attached to
it.  See <xref linkend="Nonlinear-units"></xref>.  The first conversion shows that if it's 45
degrees Fahrehneit outside it's 7.2 degrees Celsius.  The second
conversions indicates that a change of 45 degrees Fahrenheit corresponds
to a change of 25 degrees Celsius.</para>
      <para>Some other examples of nonlinears units are ring size and wire gauge.
There are numerous different gauges and ring sizes.  See the units
database for more details.  Note that wire gauges
with multiple zeroes are signified using negative numbers where two
zeroes is -1.  Alternatively, you can use the synonyms &lsquo;<literal>g00</literal>&rsquo;,
&lsquo;<literal>g000</literal>&rsquo;, and so on that are defined in the units database.</para>
      <screen>
    You have: wiregauge(11)
    You want: inches
            * 0.090742002
            / 11.020255

    You have: brwiregauge(g00)
    You want: inches
            * 0.348
            / 2.8735632

    You have: 1 mm
    You want: wiregauge
            18.201919
</screen>
    </sect3>
  </chapter>

  <chapter label="5" id="Invoking-units">
    <title>Invoking <literal>units</literal></title>
    <para><indexterm role="cp"><primary>invoking units</primary></indexterm><indexterm role="cp"><primary>command line options</primary></indexterm>
You invoke <literal>units</literal> like this:</para>
    <screen>
    units [<replaceable>options</replaceable>] [<replaceable>from-unit</replaceable> [<replaceable>to-unit</replaceable>]]
</screen>
    <para role="continues">If the <replaceable>from-unit</replaceable> and <replaceable>to-unit</replaceable> are omitted, then the program
will use interactive prompts to determine which conversions to perform.
See <xref linkend="Interactive-use"></xref>.
If both <replaceable>from-unit</replaceable> and <replaceable>to-unit</replaceable> are given, <literal>units</literal> will
print the result of that single conversion and then exit.
If only <replaceable>from-unit</replaceable> appears on the command line, <literal>units</literal> will
display the definition of that unit and exit.
Units specified on the command line will need
to be quoted to protect them from shell interpretation and to group
them into two arguments.  See <xref linkend="Command-line-use"></xref>.</para>
    <para>The following options allow you to read in an alternative units file,
check your units file, or change the output format:</para>
    <variablelist>
      <varlistentry>
        <term>&lsquo;<literal>-c</literal>&rsquo;</term>
        <term>&lsquo;<literal>--check</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>-c (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;check (option for <literal>units</literal>)</primary></indexterm>Check that all units and prefixes defined in the units data file reduce
to primitive units.  Print a list of all units that
cannot be reduced.  Also display some other diagnostics about
suspicious definitions in the units data file.  Note that only
definitions active in the current locale are checked.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>--check-verbose</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>&ndash;check-verbose (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;verbose-check (option for <literal>units</literal>)</primary></indexterm>Like the &lsquo;<literal>-check</literal>&rsquo; option, this option prints a list of units that
cannot be reduced.  But to help find unit  definitions that cause
endless loops,
it lists the units as they are checked.
If <literal>units</literal> hangs, then the last unit to be printed has a bad
definition.  Note that only
definitions active in the current locale are checked.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>-o format</literal>&rsquo;</term>
        <term>&lsquo;<literal>--output-format format</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>-o (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;output-format (option for <literal>units</literal>)</primary></indexterm>Use the specified format for numeric output.  Format is the same
as that for the printf function in the ANSI C standard.
For example, if you want more precision you might use &lsquo;<literal>-o %.15g</literal>&rsquo;.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>-f filename</literal>&rsquo;</term>
        <term>&lsquo;<literal>--file filename</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>-f (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;file (option for <literal>units</literal>)</primary></indexterm>Instruct <literal>units</literal> to load the units file <literal>filename</literal>.
If <literal>filename</literal> is the empty string (&lsquo;<literal>-f ''</literal>&rsquo;)
then the default units file will
be loaded.  This enables you to load the default file plus a personal
units file.  Up to 25 units files may be specified on the command line.
This option overrides the <literal>UNITSFILE</literal> environment variable.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>-h</literal>&rsquo;</term>
        <term>&lsquo;<literal>--help</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>-h (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;help (option for <literal>units</literal>)</primary></indexterm>Print out a summary of the options for <literal>units</literal>.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>-m</literal>&rsquo;</term>
        <term>&lsquo;<literal>--minus</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>-m (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;minus (option for <literal>units</literal>)</primary></indexterm>Causes &lsquo;<literal>-</literal>&rsquo; to be interpreted as a subtraction operator.  This is
usually the default behavior.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>-p</literal>&rsquo;</term>
        <term>&lsquo;<literal>--product</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>-p (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;product (option for <literal>units</literal>)</primary></indexterm>Causes &lsquo;<literal>-</literal>&rsquo; to be interpreted as a multiplication operator when it
has two operands.  It will as a negation operator when it has only one
operand: &lsquo;<literal>(-3)</literal>&rsquo;.  Note that by default &lsquo;<literal>-</literal>&rsquo; is treated as a
subtraction operator.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>--compact</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>&ndash;compact (option for <literal>units</literal>)</primary></indexterm>Give compact output featuring only the conversion factor.  This turns
off the &lsquo;<literal>--verbose</literal>&rsquo; option.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>-q</literal>&rsquo;</term>
        <term>&lsquo;<literal>--quiet</literal>&rsquo;</term>
        <term>&lsquo;<literal>--silent</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>-q (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;quiet (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;silent (option for <literal>units</literal>)</primary></indexterm>Suppress prompting of the user for units and the display of statistics
about the number of units loaded.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>-s</literal>&rsquo;</term>
        <term>&lsquo;<literal>--strict</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>-s (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;strict (option for <literal>units</literal>)</primary></indexterm>Suppress conversion of units to their reciprocal units.  For
example, <literal>units</literal> will normally convert hertz to seconds
because these units are reciprocals of each other.  The strict option
requires that units be strictly conformable to perform a conversion, and
will give an error if you attempt to convert hertz to seconds.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>-1</literal>&rsquo;</term>
        <term>&lsquo;<literal>--one-line</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>-1 (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;one-line (option for <literal>units</literal>)</primary></indexterm>Give only one line of output (the forward conversion).  Do not print
the reverse conversion.  Note that if a reciprocal conversion is
performed then <literal>units</literal> will print still print the &ldquo;reciprocal
conversion&rdquo; line.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>-t</literal>&rsquo;</term>
        <term>&lsquo;<literal>--terse</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>-t (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;terse (option for <literal>units</literal>)</primary></indexterm>Give terse output when converting units.  This option can be used when
calling <literal>units</literal> from another program so that the output is easy to
parse.  This option has the combined
effect of these options:  &lsquo;<literal>--strict</literal>&rsquo; &lsquo;<literal>--quiet</literal>&rsquo; &lsquo;<literal>--one-line</literal>&rsquo;
&lsquo;<literal>--compact</literal>&rsquo;.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>-v</literal>&rsquo;</term>
        <term>&lsquo;<literal>--verbose</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>-v (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;verbose (option for <literal>units</literal>)</primary></indexterm>Give slightly more verbose output when converting units.  When combined
with the &lsquo;<literal>-c</literal>&rsquo; option this gives the same effect as
&lsquo;<literal>--check-verbose</literal>&rsquo;.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>-V</literal>&rsquo;</term>
        <term>&lsquo;<literal>--version</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="op"><primary>-V (option for <literal>units</literal>)</primary></indexterm><indexterm role="op"><primary>&ndash;version (option for <literal>units</literal>)</primary></indexterm>Print program version number, tell whether the readline library
has been included, and give the location of the default units
data file.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </chapter>

  <chapter label="6" id="Unit-definitions">
    <title>Unit definitions</title>
    <para><indexterm role="cp"><primary>unit definitions</primary></indexterm>
The conversion information is read from a units data file which
is called <filename>units.dat</filename> and is probably located in
the <filename>/usr/local/share</filename> directory.
If you invoke <literal>units</literal> with the &lsquo;<literal>-V</literal>&rsquo; option, it will print
the location of this file.
The default
file includes definitions for all familiar units, abbreviations and
metric prefixes.  It also includes many obscure or archaic units.</para>
    <para>Many constants of nature are defined, including these:
<!-- noman --></para>
    <screen>
pi          <lineannotation>ratio of circumference to diameter</lineannotation>
c           <lineannotation>speed of light</lineannotation>
e           <lineannotation>charge on an electron</lineannotation>
force       <lineannotation>acceleration of gravity</lineannotation>
mole        <lineannotation>Avogadro's number</lineannotation>
water       <lineannotation>pressure per unit height of water</lineannotation>
Hg          <lineannotation>pressure per unit height of mercury</lineannotation>
au          <lineannotation>astronomical unit</lineannotation>
k           <lineannotation>Boltzman's constant</lineannotation>
mu0         <lineannotation>permeability of vacuum</lineannotation>
epsilon0    <lineannotation>permitivity of vacuum</lineannotation>
G           <lineannotation>Gravitational constant</lineannotation>
mach        <lineannotation>speed of sound</lineannotation>
</screen>
    <para role="continues">
<!-- end noman -->
<!-- man .RS -->
<!-- man .TS -->
<!-- man l l. -->
<!-- man pi	ratio of circumference to diameter -->
<!-- man c	speed of light -->
<!-- man e	charge on an electron -->
<!-- man force	acceleration of gravity -->
<!-- man mole	Avogadro's number -->
<!-- man water	pressure per unit height of water -->
<!-- man Hg	pressure per unit height of mercury -->
<!-- man au	astronomical unit -->
<!-- man k	Boltzman's constant -->
<!-- man mu0	permeability of vacuum -->
<!-- man epsilon0	permitivity of vacuum -->
<!-- man G	gravitational constant -->
<!-- man mach	speed of sound -->
<!-- man .TE -->
<!-- man .RE -->The database includes atomic masses for all of the elements and numerous
other constants.  Also included are the densities of various ingredients
used in baking so that &lsquo;<literal>2 cups flour_sifted</literal>&rsquo; can be converted
to &lsquo;<literal>grams</literal>&rsquo;.  This is not an exhaustive list.  Consult the units
data file to see the complete list, or to see the definitions that are
used.</para>
    <para>The unit &lsquo;<literal>pound</literal>&rsquo; is a unit of mass.  To get force, multiply by the
force conversion unit &lsquo;<literal>force</literal>&rsquo; or use the shorthand &lsquo;<literal>lbf</literal>&rsquo;.
(Note that &lsquo;<literal>g</literal>&rsquo; is already taken as the standard abbreviation for
the gram.)  The unit &lsquo;<literal>ounce</literal>&rsquo; is also a unit of mass.  The fluid
ounce is &lsquo;<literal>fluidounce</literal>&rsquo; or &lsquo;<literal>floz</literal>&rsquo;.  British capacity units that
differ from their US counterparts, such as the British Imperial gallon,
are prefixed with &lsquo;<literal>br</literal>&rsquo;.  Currency is prefixed with its country
name: &lsquo;<literal>belgiumfranc</literal>&rsquo;, &lsquo;<literal>britainpound</literal>&rsquo;.</para>
    <para>The US Survey foot,
yard, and mile can be obtained by using the &lsquo;<literal>US</literal>&rsquo; prefix.
These units differ slightly from the international length units.
They were in general use until 1959, and are still used
for geographic surveys.
The acre is officially defined in terms of the US Survey foot.
If you want an acre
defined according to the international foot, use &lsquo;<literal>intacre</literal>&rsquo;.  The
difference between these units is
about 4 parts per million.
The British also used a slightly different length measure before 1959.
These can be obtained with the prefix &lsquo;<literal>UK</literal>&rsquo;.</para>
    <para>When searching for
a unit, if the specified string does not appear exactly as a unit
name, then the <literal>units</literal> program will try to remove a
trailing &lsquo;<literal>s</literal>&rsquo; or a trailing &lsquo;<literal>es</literal>&rsquo;.  If that fails, <literal>units</literal>
will check for a prefix.
All of the standard metric prefixes are defined.</para>
    <para>To find out what units and prefixes are available, read the standard
units data file.</para>
  </chapter>

  <chapter label="7" id="Defining-new-units">
    <title>Defining new units</title>
    <para><indexterm role="cp"><primary>defining units</primary></indexterm><indexterm role="cp"><primary>units, redefinition of</primary></indexterm><indexterm role="cp"><primary>changing units definitions</primary></indexterm>
All of the units and prefixes that <literal>units</literal> can convert are defined
in the units data file.  If you want to add your own units, you can
supply your own file.</para>
    <para>A unit is specified on a single line by giving its name and an
equivalence.  Comments start with a &lsquo;<literal>#</literal>&rsquo; character, which can appear
anywhere in a line.  The backslash character (&lsquo;<literal>\</literal>&rsquo;)
acts as a continuation
character if it appears as the last character on a line, making it
possible to spread definitions out over several lines if desired.
A file can be included by giving the command &lsquo;<literal>!include</literal>&rsquo; followed by
the file's name.  The file will be sought in the same directory as the
parent file unless a full path is given.
<indexterm role="cp"><primary>include files</primary></indexterm>
Unit names must not contain any of the operator characters &lsquo;<literal>+</literal>&rsquo;,
&lsquo;<literal>-</literal>&rsquo;, &lsquo;<literal>*</literal>&rsquo;, &lsquo;<literal>/</literal>&rsquo;, &lsquo;<literal>|</literal>&rsquo;, &lsquo;<literal>^</literal>&rsquo; or the parentheses.
They cannot begin with a digit or a decimal point (&lsquo;<literal>.</literal>&rsquo;), nor can
they end with a digit (except for zero).
Be careful to define
new units in terms of old ones so that a reduction leads to the
primitive units, which are marked with &lsquo;<literal>!</literal>&rsquo; characters.
Dimensionless units are indicated by using the string
&lsquo;<literal>!dimensionless</literal>&rsquo; for the unit definition.
<indexterm role="cp"><primary>dimensionless units</primary></indexterm>
When adding new units, be sure to use the &lsquo;<literal>-c</literal>&rsquo; option to check that
the new units reduce properly.
If you create a loop in the units definitions, then <literal>units</literal> will
hang when invoked with the &lsquo;<literal>-c</literal>&rsquo; options.  You will need to
use the &lsquo;<literal>--check-verbose</literal>&rsquo; option which prints out each unit as it
checks them.  The program will still hang, but the last unit printed
will be the unit which caused the infinite loop.</para>
    <para>If you define any units which contain
&lsquo;<literal>+</literal>&rsquo; characters, carefully check them because the &lsquo;<literal>-c</literal>&rsquo; option
will not catch non-conformable sums.  Be careful with the &lsquo;<literal>-</literal>&rsquo;
operator as well.  When used as a binary operator, the &lsquo;<literal>-</literal>&rsquo;
character can perform addition or multiplication
depending on the options used to invoke <literal>units</literal>.
To ensure consistent behavior use &lsquo;<literal>-</literal>&rsquo; only as a unary negation
operator when writing units definitions.  To multiply two units leave a
space or use the &lsquo;<literal>*</literal>&rsquo; operator.  To compute the difference
of &lsquo;<literal>foo</literal>&rsquo; and &lsquo;<literal>bar</literal>&rsquo; write &lsquo;<literal>foo+(-bar)</literal>&rsquo; or even &lsquo;<literal>foo+-bar</literal>&rsquo;.</para>
    <para>Here is an example of a short units file that defines some basic
units:
<!-- noman --></para>
    <screen>
m       !               # The meter is a primitive unit
sec     !               # The second is a primitive unit
rad     !dimensionless  # A dimensionless primitive unit
micro-  1e-6            # Define a prefix
minute  60 sec          # A minute is 60 seconds
hour    60 min          # An hour is 60 minutes
inch    0.0254 m        # Inch defined in terms of meters
ft      12 inches       # The foot defined in terms of inches
mile    5280 ft         # And the mile
</screen>
<!-- end noman -->
<!-- man .RS -->
<!-- man .TS -->
<!-- man l l l. -->
<!-- man m	!	# The meter is a primitive unit -->
<!-- man sec	!	# The second is a primitive unit -->
<!-- man rad	!dimensionless	# The second is a primitive unit -->
<!-- man micro-	1e-6	# Define a prefix -->
<!-- man minute	60 sec	# A minute is 60 seconds -->
<!-- man hour	60 min	# An hour is 60 minutes -->
<!-- man inch	0.0254 m	# Inch defined in terms of meters -->
<!-- man ft	12 inches	# The foot defined in terms of inches -->
<!-- man mile	5280 ft	# And the mile -->
<!-- man .TE -->
<!-- man .RS -->
    <para role="continues">A unit which ends with a &lsquo;<literal>-</literal>&rsquo; character is a prefix.  If a prefix
definition contains any &lsquo;<literal>/</literal>&rsquo; characters, be sure they are protected
by parentheses.  If you define &lsquo;<literal>half- 1/2</literal>&rsquo; then &lsquo;<literal>halfmeter</literal>&rsquo;
would be equivalent to &lsquo;<literal>1 / 2 meter</literal>&rsquo;.</para>
  </chapter>

  <chapter label="8" id="Nonlinear-units">
    <title>Defining nonlinear units</title>
    <para><indexterm role="cp"><primary>defining nonlinear units</primary></indexterm><indexterm role="cp"><primary>nonlinear units, redefinition of</primary></indexterm><indexterm role="cp"><primary>changing nonlinear unit definitions</primary></indexterm><indexterm role="cp"><primary>nonlinear unit conversions</primary></indexterm>Some units conversions of interest are nonlinear; for
example, temperature conversions between the Fahrenheit and Celsius
scales cannot be done by simply multiplying by conversions factors.</para>
    <para>When you give a linear unit definition such as &lsquo;<literal>inch 2.54 cm</literal>&rsquo; you
are providing information that <literal>units</literal> uses to convert values in
inches into primitive units of meters.  For nonlinear units, you give
a functional definition that provides the same information.</para>
    <para>Nonlinear units are represented using a functional notation.
It is best to regard this notation not as a function call but
as a way of adding units to a number, much the same way that
writing a linear unit name after a number adds units to that number.
Internally, nonlinear units are defined by a pair of functions
which convert to and from linear units in the data file, so that
an eventual conversion to primitive units is possible.</para>
    <para>Here is an example nonlinear unit definition:</para>
    <screen>
tempF(x) [1;K] (x+(-32)) degF + stdtemp ; (tempF+(-stdtemp))/degF + 32
</screen>
    <para role="continues">A nonlinear unit definition comprises a unit name, a dummy parameter
name, two functions, and two corresponding units.  The functions tell
<literal>units</literal> how to convert to and from the new unit.  In order to
produce valid results, the arguments of these functions need to have
the correct dimensions.  To facilitate error checking, you may specify
the dimensions.</para>
    <para>The definition begins with the unit name followed immediately (with no
spaces) by a &lsquo;<literal>(</literal>&rsquo; character.  In parentheses is the name of the
parameter.  Next is an optional specification of the units required by
the functions in this definition.  In the example above, the
&lsquo;<literal>tempF</literal>&rsquo; function requires an input argument conformable with
&lsquo;<literal>1</literal>&rsquo;.  For normal nonlinear units definitions the forward
function will always take a dimensionless argument.
The inverse function requires an input argument conformable
with &lsquo;<literal>K</literal>&rsquo;.  In general the inverse function will need units
that match the quantity measured by your nonlinear unit.
The sole purpose of the expression in brackets to enable
<literal>units</literal> to perform error checking on function arguments.</para>
    <para>Next the function definitions appear.  In the example above, the
&lsquo;<literal>tempF</literal>&rsquo; function is defined by</para>
    <screen>
    tempF(x) = (x+(-32)) degF + stdtemp
</screen>
    <para role="continues">This gives a rule for converting &lsquo;<literal>x</literal>&rsquo; in the units &lsquo;<literal>tempF</literal>&rsquo;
to linear units of absolute temperature, which makes it possible to
convert from tempF to other units.</para>
    <para>In order to make conversions to Fahrenheit possible, you must give
a rule for the inverse conversions. The inverse will be &lsquo;<literal>x(tempF)</literal>&rsquo; and
its definition appears after a &lsquo;<literal>;</literal>&rsquo; character.
In our example, the inverse is</para>
    <screen>
    x(tempF) = (tempF+(-stdtemp))/degF + 32
</screen>
    <para role="continues">This inverse definition takes an absolute temperature as its argument
and converts it to the Fahrenheit temperature.  The inverse can be
omitted by leaving out the &lsquo;<literal>;</literal>&rsquo; character, but then conversions to
the unit will be impossible.  If the inverse is omitted then the
&lsquo;<literal>--check</literal>&rsquo; option will display a warning.  It is up to you to
calculate and enter the correct inverse function to obtain proper
conversions.  The &lsquo;<literal>--check</literal>&rsquo; option tests the inverse at one point
and print an error if it is not valid there, but this is not a guarantee
that your inverse is correct.</para>
    <para>If you wish to make synonyms for nonlinear units, you still need to define
both the forward and inverse functions.  Inverse functions can be
obtained using the &lsquo;<literal>~</literal>&rsquo; operator.  So to create a synonym
for &lsquo;<literal>tempF</literal>&rsquo; you could write</para>
    <screen>
    fahrenheit(x) [1;K] tempF(x); ~tempF(fahrenheit)
</screen>
    <para><indexterm role="cp"><primary>units functions</primary></indexterm><indexterm role="cp"><primary>functions of units</primary></indexterm>You may occasionally wish to define a function that operates on units.
This can be done
using a nonlinear unit definition.  For example, the definition below
provides conversion between radius and the area of a circle.  Note
that this definition requires a length as input and produces an
area as output, as indicated by the specification in brackets.</para>
    <screen>
    circlearea(r) [m;m^2] pi r^2 ; sqrt(circlearea/pi)
</screen>
    <para><indexterm role="cp"><primary>linear interpolation</primary></indexterm><indexterm role="cp"><primary>units, piecewise linear</primary></indexterm><indexterm role="cp"><primary>piecewise linear units</primary></indexterm>Sometimes you may be interested in a piecewise linear unit such as
many wire gauges.  Piecewise linear units can be defined by specifying
conversions to linear units on a list of points.
Conversion at other points will be done by linear interpolation.
A partial definition of zinc gauge is</para>
    <screen>
    zincgauge[in] 1 0.002, 10 0.02, 15 0.04, 19 0.06, 23 0.1
</screen>
    <para role="continues">In this example, &lsquo;<literal>zincgauge</literal>&rsquo; is the name of the piecewise linear
unit.  The definition of such a unit is indicated by the
embedded &lsquo;<literal>[</literal>&rsquo; character.  After the bracket, you should indicate the
units to be attached to the numbers in the table.
No spaces can appear before the
&lsquo;<literal>]</literal>&rsquo; character, so a definition like &lsquo;<literal>foo[kg meters]</literal>&rsquo; is
illegal; instead write &lsquo;<literal>foo[kg*meters]</literal>&rsquo;.  The definition of the
unit consists of a list of pairs optionally separated by commas.
This list defines a function for converting from the piecewise linear
unit to linear units.  The
first item in each pair is the function argument; the second item is the
value of the function at that argument (in the units specified in brackets).
In this example,
we define &lsquo;<literal>zincgauge</literal>&rsquo; at five points.  For example, we set
&lsquo;<literal>zincgauge(1)</literal>&rsquo; equal to &lsquo;<literal>0.002 in</literal>&rsquo;.  Definitions like this
may be  more readable  if written using  continuation characters as
<!-- noman --></para>
    <screen>
    zincgauge[in] \
         1 0.002  \
        10 0.02   \
        15 0.04   \
        19 0.06   \
        23 0.1
</screen>
<!-- end noman -->
<!-- man .RS -->
<!-- man .nf -->
<!-- man zincgauge[in]         \\ -->
<!-- man         1        0.002 \\ -->
<!-- man         10        0.02 \\ -->
<!-- man         15        0.04 \\ -->
<!-- man         19        0.06 \\ -->
<!-- man         23        0.1 -->
<!-- man .fi -->
<!-- man .RE -->
    <para>With the preceeding definition, the following conversion can be
performed:</para>
    <screen>
    You have: zincgauge(10)
    You want: in
        * 0.02
        / 50
    You have: .01 inch
    You want: zincgauge
        5
</screen>
    <para>If you define a piecewise linear unit that is not strictly
monotonic, then the inverse will not be well defined.  If the inverse is
requested for such a unit, <literal>units</literal> will return the smallest
inverse.  The &lsquo;<literal>--check</literal>&rsquo; option will print a warning if a
non-monotonic piecewise linear unit is encountered.</para>
  </chapter>

  <chapter label="9" id="Localization">
    <title>Localization</title>
    <para><indexterm role="cp"><primary>localization</primary></indexterm>
Some units have different values in different locations.  The
localization feature accomodates this by allowing the units database to
specify region dependent definitions.   A locale region in the units
database begins with &lsquo;<literal>!locale</literal>&rsquo; followed by the name of the locale.
The leading &lsquo;<literal>!</literal>&rsquo; must appear in the first column of the units
database.  The locale region is terminated by &lsquo;<literal>!endlocale</literal>&rsquo;.  The
following example shows how to define a couple units in a locale.</para>
    <screen>
!locale en_GB
ton                     brton
gallon                  brgallon
!endlocale
</screen>
    <para role="continues">The current locale is specified
by the <literal>LOCALE</literal> environment variable.  Note that the &lsquo;<literal>-c</literal>&rsquo;
option only checks the definitions which are active for the current locale.</para>
  </chapter>

  <chapter label="10" id="Environment-vars">
    <title>Environment variables</title>
    <para><indexterm role="cp"><primary>environment variables</primary></indexterm>
The <literal>units</literal> programs uses the following environment variables.</para>
    <variablelist>
      <varlistentry>
        <term>&lsquo;<literal>LOCALE</literal>&rsquo;</term>
        <listitem>
          <para role="continues"><indexterm role="cp"><primary>LOCALE environment variable</primary></indexterm>Specifies the locale.  The default is &lsquo;<literal>en_US</literal>&rsquo;.  Sections of the
units database are specific to certain locales.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>PAGER</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="cp"><primary>PAGER environment variable</primary></indexterm>Specifies the pager to use for help and for displaying the conformable
units.  The help function browses the units database and calls
the pager using the <literal>+nn</literal> syntax for specifying a line number.  The
default pager is <literal>more</literal>, but <literal>less</literal>, <literal>emacs</literal>, or
<literal>vi</literal> are possible alternatives.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>&lsquo;<literal>UNITSFILE</literal>&rsquo;</term>
        <listitem>
          <para><indexterm role="cp"><primary>UNITSFILE environment variable</primary></indexterm>Specifies the units database file to use (instead of the default). This
will be overridden by the &lsquo;<literal>-f</literal>&rsquo; option.  Note that you can only
specify a single units database using this environment variable.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </chapter>

  <chapter label="11" id="Readline-support">
    <title>Readline support</title>
    <para><indexterm role="cp"><primary>readline, use with <literal>units</literal></primary></indexterm>
If the <literal>readline</literal> package has been compiled in, then when
<literal>units</literal> is used interactively, numerous command line editing
features are available.  To check if your version of <literal>units</literal>
includes the readline, invoke the program with the &lsquo;<literal>--version</literal>&rsquo;
option.</para>
    <para>For complete information about readline, consult the documentation for
the readline package.  Without any configuration, <literal>units</literal> will
allow editing in the style of emacs.  Of particular use with
<literal>units</literal> are the completion commands.</para>
    <para>If you type a few characters and then hit &lsquo;<literal>ESC</literal>&rsquo; followed by the
<userinput>?</userinput> key then <literal>units</literal> will display a list of all the units which
start with the characters typed.  For example, if you type <userinput>metr</userinput> and
then request completion, you will see something like this:
<indexterm role="cp"><primary>unit name completion</primary></indexterm></para>
    <screen>
You have: metr
metre             metriccup         metrichorsepower  metrictenth
metretes          metricfifth       metricounce       metricton
metriccarat       metricgrain       metricquart       metricyarncount
You have: metr
</screen>
    <para role="continues">If there is a unique way to complete a unitname, you can hit the tab key
and <literal>units</literal> will provide the rest of the unit name.  If <literal>units</literal>
beeps, it means that there is no unique completion.  Pressing the tab
key a second time will print the list of all completions.</para>
  </chapter>
<index xreflabel="Index" id="Index">
    <title>Index</title>
  <indexdiv>
    <indexentry>
      <primaryie>&ndash;check (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;check-verbose (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;compact (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;file (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;help (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;minus (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;one-line (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;output-format (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;product (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;quiet (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;silent (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;strict (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;terse (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;verbose (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;verbose-check (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>&ndash;version (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>-1 (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>-c (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>-f (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>-h (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>-m (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>-o (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>-p (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>-q (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>-s (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>-t (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>-V (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>-v (option for <literal>units</literal>), see <xref linkend="Invoking-units"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>A</title>
    <indexentry>
      <primaryie>addition of units, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>C</title>
    <indexentry>
      <primaryie>changing nonlinear unit definitions, see <xref linkend="Nonlinear-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>changing units definitions, see <xref linkend="Defining-new-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>command line options, see <xref linkend="Invoking-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>command line unit conversion, see <xref linkend="Command-line-use"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>D</title>
    <indexentry>
      <primaryie>defining nonlinear units, see <xref linkend="Nonlinear-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>defining units, see <xref linkend="Defining-new-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>dimensionless units, see <xref linkend="Defining-new-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>dimensionless units, see <xref linkend="Interactive-use"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>division of numbers, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>division of units, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>E</title>
    <indexentry>
      <primaryie>environment variables, see <xref linkend="Environment-vars"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>F</title>
    <indexentry>
      <primaryie>fractions, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>functions of units, see <xref linkend="Nonlinear-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>functions, built in, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>I</title>
    <indexentry>
      <primaryie>include files, see <xref linkend="Defining-new-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>incompatible units, see <xref linkend="Interactive-use"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>interactive use, see <xref linkend="Interactive-use"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>invoking units, see <xref linkend="Invoking-units"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>L</title>
    <indexentry>
      <primaryie>linear interpolation, see <xref linkend="Nonlinear-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>LOCALE environment variable, see <xref linkend="Environment-vars"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>localization, see <xref linkend="Localization"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>M</title>
    <indexentry>
      <primaryie>multiplication of units, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>N</title>
    <indexentry>
      <primaryie>non-conformable units, see <xref linkend="Interactive-use"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>non-interactive unit conversion, see <xref linkend="Command-line-use"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>nonlinear unit conversions, see <xref linkend="Nonlinear-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>nonlinear units, redefinition of, see <xref linkend="Nonlinear-units"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>P</title>
    <indexentry>
      <primaryie>PAGER environment variable, see <xref linkend="Environment-vars"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>piecewise linear units, see <xref linkend="Nonlinear-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>powers, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>products, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>R</title>
    <indexentry>
      <primaryie>readline, use with <literal>units</literal>, see <xref linkend="Readline-support"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>reciprocal conversion, see <xref linkend="Interactive-use"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>roots, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>S</title>
    <indexentry>
      <primaryie>square roots, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>strict conversion, see <xref linkend="Interactive-use"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>sums of units, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>T</title>
    <indexentry>
      <primaryie>temperature conversions, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>U</title>
    <indexentry>
      <primaryie>unit definitions, see <xref linkend="Unit-definitions"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>unit expressions, see <xref linkend="Unit-expressions"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>unit name completion, see <xref linkend="Readline-support"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>units functions, see <xref linkend="Nonlinear-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>units, piecewise linear, see <xref linkend="Nonlinear-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>units, redefinition of, see <xref linkend="Defining-new-units"></xref></primaryie></indexentry>
    <indexentry>
      <primaryie>UNITSFILE environment variable, see <xref linkend="Environment-vars"></xref></primaryie></indexentry></indexdiv>
  <indexdiv>
    <title>V</title>
    <indexentry>
      <primaryie>verbose output, see <xref linkend="Interactive-use"></xref></primaryie></indexentry></indexdiv></index></book><!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-indent-step:1
sgml-indent-data:nil
End:
-->



-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages docbook2x depends on:
ii  libc6                     2.6-2          GNU C Library: Shared libraries
ii  libtext-wrapi18n-perl     0.06-5         internationalized substitute of Te
ii  libxml-sax-expat-perl     0.37-3         Perl module for a SAX2 driver for 
ii  perl                      5.8.8-7        Larry Wall's Practical Extraction 
ii  sp                        1.3.4-1.2.1-47 James Clark's SGML parsing tools
ii  texinfo                   4.8.dfsg.1-6   Documentation system for on-line i
ii  xml-core                  0.11           XML infrastructure and XML catalog
ii  xsltproc                  1.1.21-1       XSLT command line processor

Versions of packages docbook2x recommends:
ii  docbook-xml              4.5-4           standard XML documentation system,
ii  docbook-xsl              1.72.0.dfsg.1-2 stylesheets for processing DocBook

-- no debconf information




More information about the debian-xml-sgml-pkgs mailing list