Hi,

I've found another test example, that may be pointing out another
problem (related with the ms .NH macro possibly).

In any event if you run:

groff -ms -mhtml -e -t -Thtml bug.doc.so > bug.html

you'll see that the links at the top are all broken as is all the text
(not to mention the complete absence of equations).

groff -ms -e -t bug.doc.so > bug.ps

shows you what it's supposed to look like.  

Funny thing is that I have similar documents that seem to work just
fine.

Any chance this can be fixed soon?  I'm in the process of using this for
a course I'm teaching, and I have to put disclaimers and links to PDF
versions of the documents on the course web site.

In any event, thanks for your help.


David


 



On Sat, 2006-12-23 at 19:31 +0000, Gaius Mulley wrote:
> 
> Hi David and Werner,
> 
> I've examined the test code and observe two main problems:
> 
>   (i)   equations within .tl don't work - I suspect this could be made
>         to work..
>   (ii)  the division by zero is occurring because the following
>         characters appear to have zero height in the html device
> 
>         parenlefttp   
>         parenleftex   
>         parenleftbt   
>         parenrighttp  
>         parenrightex  
>         parenrightbt  
>         bracketlefttp 
>         bracketleftex 
>         bracketleftbt 
>         bracketrighttp
>         bracketrightex
>         bracketrightbt
> 
>         ie
>         .nr 0dwidth 0\w\(EQ\[parenrightex]\(EQ
>         .nr 0eh 0\n[rst]
>         .nr 0ed 0-\n[rsb]
> 
>         gives 0eh and 0eh a value of 0 which later are summed and used
>         as the divisor.  I think the correct solution is to modify eqn
>         to check division by zero and skip if necessary..
>         I'll have a look and experiment..
> 
> regards,
> Gaius
> 
.lf 1 ./bug.doc
.lf 1 ./header
.lf 1 /home/ronis/.edit/defines
.EQ
gsize 12
delim $$
ndefine nonmember %{"\o'\(mo/'"}%
tdefine nonmember %{"\o'\(mo/'"}%
ndefine angst %{"A\v'-1m'\h'-1n'\s-2o\s+2\v'1m'"}%
tdefine angst %{"A\v'-1m'\h'-1n'\s-2o\s+2\v'1m'"}%
tdefine ppd '{{fat | back 41 \(ru}}'
ndefine ninf '{- inf}'
tdefine ninf '{- inf}'
ndefine -+ '{up 37 - back 75 down 5 +}'
tdefine -+ '{up 37 - back 75 down 5 +}'
ndefine // '{/ back 35 / }'
tdefine // '{/ back 35 / }'
ndefine <=> '{ ~< back 55 {= back 50{ = back 50{ = back 70 >}}}~}'
tdefine <=> '{ ~< back 55 {= back 50{ = back 50{ = back 70 >}}}~}'
tdefine <-> '{cpile {down 50 -> above up 50 <-}}'
ndefine <-> '{cpile {down 50 -> above up 50 <-}}'
ndefine ndash %-%
tdefine ndash %-%
ndefine 3sprime % ''' %
tdefine 3sprime % ''' %
ndefine 2sprime % '' %
tdefine 2sprime % '' %
ndefine sprime % ' %
tdefine sprime % ' %
ndefine rangle '>'
tdefine rangle '>'
ndefine rangle2 '>'
tdefine rangle2 'down 50 {size 20 >}'
ndefine case ''
tdefine case 'size -2'
ndefine langle '<'
tdefine langle '<'
ndefine langle2 '<'
tdefine langle2 'down 50 {size 20 <}'
ndefine open1 'fat 1'
tdefine open1 'fat 1'
ndefine scrF 'F'
tdefine scrF 'F'
ndefine scrD 'D'
tdefine scrD 'D'
ndefine scrH 'H'
tdefine scrH 'H'
ndefine scrI 'I'
tdefine scrI 'I'
ndefine scrL 'L'
tdefine scrL 'L'
ndefine scrN 'N'
tdefine scrN 'N'
ndefine vec %"\h'-1'\v'-1n'\(->\v'1n'"%
ndefine dyad %"\v'-1n'\h'-1.2'\(<-\h'-0.7'\(->\h'0.1'\v'1n'"%
ndefine approx %{"\v'-0.2m'\(ap\h'-1.0m'\v'+0.4m'\(ap\v'-0.2m'"}%
ndefine cdot %{"\v'-0.4m'\.\v'0.4m'"}%
ndefine ... %{"\v'-0.4m'\...\v'0.4m'"}%
tdefine ... %{"\v'-0.4m'\...\v'0.4m'"}%
ndefine int %{"\v'-0.5m'\(bs\v'1.0m'\h'-1.0m'\(co\v'-0.5m'"}%
ndefine sum '{pile {\(rg above \(ct }}'
ndefine >wig %{"\z>\v'0.75n'\h'\w'\(ap'u*3/16'\(ap\v'-0.75n'"}%
tdefine >wig 
%{">\kz\v'0.75n'\h'((-(\w'>'u)-(\w'\(ap'u))*1/2)'\(ap\v'-0.75n'\h'|\nzu'"}%
tdefine <wig 
%{"<\kz\v'0.75n'\h'((-(\w'<'u)-(\w'\(ap'u))*1/2)'\(ap\v'-0.75n'\h'|\nzu'"}%
ndefine >< %{"\v'0.4m'>\h'-1.0m'\v'-0.8m'<\v'0.4m'"}% 
tdefine >< %{"\v'0.4m'>\h'-1.0m'\v'-0.8m'<\v'0.4m'"}% 
ndefine <> %{"\v'0.4m'<\h'-1.0m'\v'-0.8m'>\v'0.4m'"}% 
tdefine <> %{"\v'0.4m'<\h'-1.0m'\v'-0.8m'>\v'0.4m'"}% 
ndefine dashl '{-~-~-}'
tdefine dashl '{-~-~-}'
ndefine dotted %{"\v'-0.3m'....\v'0.3m'"}%
tdefine dotted %{"\v'-0.3m'....\v'0.3m'"}%
ndefine sline '{up 50 ____}'
tdefine sline '{up 50 ____}'
ndefine dotdash %{"-\v'-0.3m'.\v'0.3m'-\v'-0.3m'.\v'0.3m'-\v'-0.3m'.\v'0.3m'"}%
tdefine dotdash %{"-\v'-0.3m'.\v'0.3m'-\v'-0.3m'.\v'0.3m'-\v'-0.3m'.\v'0.3m'"}%
ndefine hbar %{"h\h'-1.25n'\v'-0.65m'-\v'0.65m'\h'0.25n'"}%
define hbar %{h {back 70 up 28 -} }%
ndefine prop '{\(pt }'
tdefine prop '{\(pt }'
ndefine lcurl 'roman "{"'
tdefine lcurl 'roman "{"'
ndefine rcurl 'roman "}"'
tdefine rcurl 'roman "}"'
ndefine star '{*}'
tdefine star '{*}'
ndefine lstar '{down 25 *}'
tdefine lstar '{down 25 *}'
ndefine umld %"\h'-1.2m'\v'-1.0m'.\h'-0.6m'.\h'-0.2m'\v'1.0m'"%
tdefine umld %"\h'-1.2m'\v'-1.0m'.\h'-0.6m'.\h'-0.2m'\v'1.0m'"%
ndefine osl 'o back 50 /'
tdefine osl 'o back 50 /'
define dsl '{d back 63 up 25 -}'
define cint '{int back 75 o}'
define dag '\(dg'
tdefine simeq '{ ^ up 40 \(ul back 50 size +1 \(ap ^ }'
.EN
.lf 2 ./header
.ds RH Chemistry 180-213B
.ds CF Winter Term 2001-2002
.ds CP regular
.nr LL 6.5i
.nr PO 1.0i
.nr PS 12
.nr VS 14.4
.ps \n(PS
.ll 6.5i
.po 1.0i
.vs \n(VS
.lf 2 ./bug.doc
.ds LH Thermochemistry
.ie '\*(CP'course_pac' \{\
.bp
.SH
THERMOCHEMISTRY
.XS
\*(SN Thermochemistry
.XE
\}
.el \{
.TL
THERMOCHEMISTRY
\*(RH
.AU
David Ronis
.AI
McGill University
\}
.NH
Enthalpy Calculations: Chemical Reactions and Hess' Law
.XS
\*(SN Enthalpy Calculations: Chemical Reactions and Hess' Law
.XE
.PP
The enthalpy change for a process, $DELTA H$, is equal to the heat
absorbed by the system if that process is done under constant
pressure conditions (and assuming that only P-V work is possible).
Since the enthalpy of a system, H = E + PV, is a state function, we
can systematize enthalpy calculations by considering a path whereby
the compounds first turn into their constituent elements in their
standard states (by convention at 25 \uo\dC and 1 atm pressure) and
then recombine to form the products.  The enthalpy change in the
latter step is just the enthalpy of formation of the products and the
former is the enthalpy of destruction (i.e., the negative of the
enthalpy of formation) of the reactants.  Hence,
.EQ (1)
DELTA H = sum left [ DELTA H sub f sup 0 ( products )~-~DELTA H sub f
sup 0 ( reactants ) right ] .
.EN
.PP
Since we are interested in calculating a difference, the absolute
enthalpy of the elements in their standard states is unimportant [it
cancels out of Eq. (1)], and we adopt the convention that the
enthalpy of formation of an element in its standard state is zero.
.PP
Consider the following example (reduction of iron oxide):
.EQ
Fe sub 2 O sub 3 (s) + 3 H sub 2 (g) -> to { 25 ~"" sup o C,~1~ roman atm} 2Fe 
(s)
+ 3H sub 2 O (l) .
.EN
A table of thermochemical data gives:
.KS
.TS
center;
c s .

Enthalpies of Formation at 1 atm and 25 C
=
.T&
c c.

Compound        $DELTA H sub f sup 0$ (kJ/mole)
_

.T&
l n.
$Fe sub 2 O sub 3$(s)   -824.2
$H sub 2$(g)    0.0
Fe(s)   0.0
$H sub 2 O$(l)  -285.830
=
.TE
.KE
By using these in Eq. (1), we find that
.EQ L
DELTA H mark = roman { [ 3(-285.830) -(-824.2)] kJ/mole}
.EN
.EQ L
lineup
= - 33.29 roman kJ/mole .
.EN
Note that the calculated enthalpy change depends on how the reaction
was written.  For example, if we wrote
.EQ
1 over 2 Fe sub 2 O sub 3 (s) + 3 over 2 H sub 2 (g) -> to { 25 ~""
sup o C, ~1~ roman atm} Fe (s) + 3 over 2 H sub 2 O (l) ,
.EN
then $DELTA H = - 16.65$ kJ/mole.
.NH
Measuring $DELTA H sub f sup 0$
.XS
\*(SN Measuring $DELTA H sub f sup 0$
.XE
.PP
There are a number of ways in which to measure the enthalpy of
formation of a compound; here are two.  The most obvious is to simply
carry out the formation reaction from the constituent elements in
their standard states in a constant pressure calorimeter (recall that
$DELTA H = Q sub p$).  
.PP
For example, consider the combustion of graphite to form carbon
dioxide
.EQ 
C(graphite) + O sub 2 (g) ~-> to {25~"" sup o C,~1~ roman atm}~CO sub 2 (g) .
.EN
The heat released in this reaction is $- DELTA H sub f sup 0 ( CO sub
2 )$, since the standard enthalpy of formation of the reactants is
zero.
.PP
For this method to work, two conditions must be met:  1)  the
reaction goes to completion and 2) only one product is formed.
Thus, the reaction
.EQ
C( graphite ) + 2 H sub 2 (g) ~-> to {25~"" sup o C,~1~ roman atm}~CH sub 4
(g)
.EN
is not suitable for this method since it doesn't readily go to
completion and we get a complicated mixture of hydrocarbons.
.PP
In order to get around this, note that it is often possible to burn
something to completion (and measure $DELTA H sub combustion$, the
heat released).  Thus consider
.EQ
CH sub 4 (g) + 2O sub 2 ~-> to {25~"" sup o C,~1~ roman atm}~CO sub 2 (g) + 2H
sub 2 O (l) .
.EN
Equation (1) gives
.EQ
DELTA H sub combustion = DELTA H sub f sup 0 ( C O sub 2 (g) ) + 2
DELTA H sub f sup 0 ( H sub 2 O(l)) - DELTA H sub f sup 0 (CH sub 4
(g)) .
.EN
The standard enthalpies of formation of carbon dioxide and water can
be measured using the first method; hence, once we measure the heat
of combustion, the only unknown is the standard enthalpy of formation
of methane (CH\d4\u) and a little algebra gives:
.EQ L
DELTA H sub f sup 0 (CH sub 4 (g)) mark = DELTA H sub f sup 0 ( C O sub 2
(g) ) + 2 DELTA H sub f sup 0 ( H sub 2 O(l)) - DELTA H sub
combustion .
.EN
.EQ L
lineup = roman { [ -398.51 +2(-285.83) -(-890.36)]  kJ/mole}
.EN
.EQ L
lineup = roman { -74.81 kJ/mole.}
.EN
.PP
In general, in order to measure the enthalpy of formation, all you
need to to is find any reaction where all but one of the standard
enthalpies of formation are known and where the reaction goes to
completion.  These sorts of manipulations are valid because the
enthalpy is a state function, and are referred to as Hess's law.
Also note that the same arguments could be made for the energy
changes (under constant volume conditions).
.NH
Reactions at Different Temperatures: Kirchoff's Law
.XS
\*(SN Reactions at Different Temperatures: Kirchoff's Law
.XE
.PP
What happens if the temperature at which you perform the reaction
(either at constant P or V) is different than that of your table of
enthalpies of formation.  Since the enthalpy is a state function, an
alternate path can be found whereby the enthalpy change, calculated
using the temperature of your table, can be used.  Consider the
constant pressure case depicted below
\".PSPIC thermochemistry.1.eps 3.0i 2.0i
.LP
The enthalpy change for the reaction at $T sub 1$ is equal to the
enthalpy change at $T sub 0$ plus the enthalpy change for paths 1 and
2.  However, on 1 or 2, only the constant pressure heating or cooling of
the reactants or products is performed (i.e., no chemical reaction
takes place).  Since the constant pressure heat capacity, $C sub P$
was defined as
.EQ
C sub P == left ( {partial H} over {partial T} right ) sub P,N ,
.EN
the incremental heat absorbed by the system on 1 or 2 is $C sub P
dT$. Integrating gives:
.EQ
DELTA H sub 1 = int from {T sub 1} to {T sub 0} C sub P ( reactants )
dT = - int from {T sub 0} to {T sub 1} C sub P ( reactants )
dT
.EN
and
.EQ
DELTA H sub 2 = int from {T sub 0} to {T sub 1} C sub P ( products )
dT .
.EN
Adding the contributions together gives
.EQ
DELTA H ( T sub 1 ) = DELTA H ( T sub 0 ) + int from {T sub 0} to {T
sub 1} left [ C sub P ( products ) - C sub P (reactants) right ] .
.EN
This is known as Kirchoff's law.  What changes must be made for the
energy?
.PP
Consider our example of the reduction of $Fe sub 2 O sub 3$.  What is
the enthalpy change at 358K?  We will assume that the heat capacities
are constant over the temperature range 298 - 358 K.
.KS
.TS
center;
c s .

Constant Pressure Heat Capacities at 1 atm and 25 C
=
.T&
c c.

Compound        $C sub P$ (J/mole/K)
_

.T&
l n.
$Fe sub 2 O sub 3$(s)   103.8
$H sub 2$(g)    28.8
Fe(s)   25.1
$H sub 2 O$(l)  75.3
=
.TE
.KE
Note that elements in their standard states do \fInot\fR have zero
heat capacities.  Using the data in the table, and the result of our
earlier calculation gives
.EQ L
DELTA H sub rxn ( 358K) mark = roman { -33.29 + { [
2(25.1)+3(75.3)-103.8-3(28.8)][358-298]} over 1000 }
.EN
.EQ L
lineup = -28.1 roman kJ/mole .
.EN
.PP
Note that no change in phase occurred when we cooled (heated) the
reactants (products).  What changes would have to be made if the
reaction was carried out at 400 K?
.NH
Bond Energies
.XS
\*(SN Bond Energies
.XE
.PP
A useful, albeit very approximate, way to calculate enthalpy changes
in chemical reactions is through the concept of bond energies.
Consider the following reaction
.EQ
C H sub 4 -> C H sub 3 + H ;
.EN
i.e., one C-H bond is broken.  Experimentally, $DELTA H$ for this
reaction is 102 kcal/mole.  Similarly, $DELTA H$ = 96 kcal/mole for
.EQ
C sub 2 H sub 6 -> C sub 2 H sub 5 + H .
.EN
A survey of such reactions will show that the heat required to break
a single C-H bond is in the range 96-102 kcal/mole.  We can thus
assign 98 kcal/mole as an average bond energy for the C-H bond.
Similar tends are observed in the bond strength of other types of
bonds, and the results are summarized in the following table
.KS
.TS
box, center;
c s s s
c c c c
c c c c
c n c n.
Average Bond Energies
=
Bond    Energy  Bond    Energy
\^      (kcal/mole)     \^      (kcal/mole)
_
H-H     103     C-H     98
C-C     80      N-H     92
C=C     145     O-H     109
$C == C$        198     Cl-H    102
N-N     37      Br-H    87
$N == N$        225     I-H     71
O-O     34      C-Cl    78
O=O     117     C-N     66
Cl-Cl   57      $C == N$        210
Br-Br   45      C-O     79
I-I     35      C=O     173
.TE
.KE
.PP
How can this be used?  Consider the hydrogenation of ethlyene:
.EQ
 H sub 2 C=C H sub 2 + H-H -> H sub 3 C-C H sub 3 .
.EN
At the molecular level, we break one H-H and one C=C bond, and form
one C-C and two C-H bonds.  The energy change is just the net energy
left in the molecule in such a process.  From the table, the bond
breaking steps take 145+103=248 kcal/mole.  The bond formation will give
off 80+2(98)=276 kcal/mole.  Hence the net energy change in the system is
248-276 = -28 kcal/mole.   To get the enthalpy change, note that at
constant pressure,
.EQ
DELTA H = DELTA E + P DELTA V .
.EN
For this reaction, all reactants and products are gases. If we assume
that the gases are ideal, we can compute $DELTA V$; i.e.,
.EQ
DELTA V = RT over P DELTA N .
.EN
Here $DELTA N = -1$ and thus 
.EQ L
DELTA H = -28 - {1.9872 times 10 sup -3 roman kcal/mole /K times 298 K}
.EN
.EQ L
lineup = -28.6~ roman kcal/mole .
.EN
(Note that here the difference between $DELTA H$ and $DELTA E$ is
relatively small).  The correct answer is -32.7 kcal/mole.  Thus
while, the bond energy method is not exact it gives a reasonable
estimate.  The reason for the discrepancy is the assumption that the
bond energy doesn't depend on what other bonds are present in the
molecule--in general this is not true.
.NH
Some Manipulations Involving Thermodynamic Functions
.XS
\*(SN Some Manipulations Involving Thermodynamic Functions
.XE
.NH 2
The relationship between $C sub P$ and $C sub V$
.XS
\*(SN The relationship between $C sub P$ and $C sub V$
.XE
.PP
We know that
.EQ
C sub V = left ( {partial E} over {partial T} right ) sub N,V
.EN
and that
.EQ
C sub P = left ( {partial H} over {partial T} right ) sub N,P .
.EN
How these two quantities are related is a good exercise in
manipulating thermodynamic functions.  Since H=E+PV,
.EQ
C sub P = left ( {partial E} over {partial T} right ) sub N,P + P
left ( {partial V} over {partial T} right ) sub N,P ,
.EN
where the last derivative should be recognized as $V alpha$, where
$alpha$ is the thermal expansion coefficient,
.EQ 
alpha == 1 over V left ( {partial V} over {partial T} right ) sub N,P .  
.EN
If we view the energy as a function of N,V,T,
.EQ L
left ( {partial E} over {partial T} right ) sub N,P mark = left (
{partial E} over {partial T} right ) sub N,V + left ( {partial E}
over {partial V} right ) sub N,T left ( {partial V} over {partial T}
right ) sub N,P
.EN
.EQ L
lineup = C sub V + alpha V left ( {partial E}
over {partial V} right ) sub N,T .
.EN
Hence,
.EQ L
C sub P - C sub V mark = left [ P +  left ( {partial E}
over {partial V} right ) sub N,T right ] alpha V
.EN 
.EQ L
lineup = {VT alpha sup 2} over beta ,
.EN
where 
.EQ
beta == - 1 over V left ( {partial V} over {partial P} right ) sub T,N 
.EN
is the isothermal compressibility, and where the last equality will be
proven later.  The compressitility must be positive (i.e., things get
smaller when squeezed) and this implies that $C sub P >= C sub V$.
For an ideal gas, Joule showed that the internal energy per mole did
not depend on the volume.  In this case,
.EQ
C bar sub P - C bar sub V = alpha P V bar = R .
.EN
.NH 2
The Joule-Thompson Experiment
.XS
\*(SN The Joule-Thompson Experiment
.XE
.PP
Consider the following adiabatic (i.e, Q=0) process, whereby a gas is
squeezed through a porous, rigid plug
.KS
\".PSPIC thermochemistry.2.eps 5.0 2.0
.DS C
Fig. 1.  The Joule-Thompson Experiment
.DE
.KE
Since, by assumption, Q=0,
.EQ
DELTA E = E ( P sub 2 , V sub 2 ) - E ( P sub 1 , V sub 1 ) = -W = P
sub 1 V sub 1 - P sub 2 V sub 2 .
.EN
By rearranging this expression we show that
.EQ
E ( P sub 1 , V sub 1 ) + P sub 1 V sub 1 = E ( P sub 2 , V sub 2 ) +
P sub 2 V sub 2 ;
.EN
i.e., the enthalpy, $H$ is constant in the Joule-Thompson expansion.
.PP
In practice, large temperature changes can be obtained in this type
of expansion (which can be used in designing a refrigerator).
The key parameter is the so-called Joule-Thompson coefficient
.EQ (2)
mu sub JT == left ( {partial T} over {partial P} right ) sub H,N .
.EN
.PP
In order to express $mu sub JT$ in terms of more readily measurable
quantities, note that
.EQ
left ( {partial y} over {partial x} right ) sub f = - {left ( { partial
f} over {partial x} right ) sub y } over { left ( {partial f} over
{partial y} right ) sub x} ,
.EN
which is sometimes known as the "cyclic rule" or "implicit function
differentiation."  It is proved by noting that
.EQ
df = left ( { partial f} over {partial x} right ) sub y dx + left (
{ partial f} over {partial y} right ) sub x dy ,
.EN
setting df=0, and by solving for the ratio dy/dx.
.PP
By using the cyclic rule on Eq. (2), we find that
.EQ L
mu sub JT mark = - {left ( {partial H} over {partial P} right ) sub
T,N} over { left ( {partial H} over {partial T} right ) sub P,N}
.EN
.EQ L
lineup = - 1 over {C sub P} left ( {partial H} over {partial P}
right ) sub N,T
.EN
.EQ L
lineup = - V over {C sub P} left { 1 - beta left [ P + left (
{partial E} over {partial V} right ) sub N,T right ] right }
.EN
.EQ L
lineup = - V over {C sub P} left [ 1 - beta over {alpha V} left ( C
sub P - C sub V right ) right ] = - V over {C sub p} [ 1 - alpha T ] ,
.EN
where the second to last equality follows when the definition of the
enthalpy in terms of the energy is used and the manipulations used in
calculating $C sub P - C sub V$ are repeated.  $beta$ is the
isothermal compressibility.  Note that the Joule-Thompson
coefficient vanishes for an ideal-gas.
.ex
\"LocalWords:  atm CO CH Hess's Kirchoff's dT int Fe rxn kJ Cl Br ethlyene RT PV
\"LocalWords:  roman VT mu JT df dx dy
_______________________________________________
Groff mailing list
Groff@gnu.org
http://lists.gnu.org/mailman/listinfo/groff

Reply via email to