This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problem getting backslashes


Hi All,

I've just started using sgml after using LaTeX to write technical
documentation for the last eight to ten years and have stumbled across
a small problem (looks like a bug to me, but I'm not too sure it's not
a nasty feature). Yes I have also understood that the CDATA structure
is not particularly nice to use, but life's not perfect.

My environment:

SuSE Linux 7.0


docbk_4-2000.06.27-14
docbk30-3.1-46
docbkdsl-1.54-21
docbkxsl-1.13-20
html_dtd-2000.7.27-1
gv-3.5.8-232
howtodeo-2000.7.16-1
ldp-2000.7.13-2
iso_ent-2000.06.22-18
jadetex-2.19-58
jade_dsl-1.2.1-224
openjade-1.3-135
sgmltool-1.0.9-228
sp-1.3.4-224

Here's the problem - I cannot seem to get a backslash in the
PostScript or PDF output from the tools. In the HTML output from the
same input files the problem isn't there. I know that I could bung in
an entity like ∖ but I want to write documentation with the
minimum of effort and cut and paste from the documentation back to the
screen. Here's some sample input which demonstrates the problem:
_____________________________________________________________________
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" >
<book>
<chapter id="backup">
<title>Backup and restore concept</title>
<sect1><title>Sample text to show problem</title>
<para>
I wish to cut and paste shell scripts and listings with a minimum of
work but somehow the backslashes (shell script line continues) are not
always produced correctly:
</para>
<screen>
<![ CDATA [
#!/bin/sh

# Script to dump partitions using ufsdump (Solaris)
# Allowed parameters are 0 to 9 - the ufsdump values

# Version 1 : Sun Dec 17 13:21:04 CET 2000 : L. Schaefer

TAPE=/dev/rmt/0cn
#TAPE=/dev/nrst0

if [ $# -ne 1 ] ; then
  echo $0": usage  $0 <dump level>  (ufsdump level = 0 - 9)"
  exit 1
fi
if [ \( $1 != "0" \) -a \( $1 -ne 1 \) -a \( $1 -ne 2 \) \
  -a \( $1 -ne 3 \) -a \( $1 -ne 4 \) -a \( $1 -ne 5 \) \
  -a \( $1 -ne 6 \) -a \( $1 -ne 7 \) -a \( $1 -ne 8 \) \
  -a \( $1 -ne 9 \) ]
then
  echo $0": usage  $0 <dump level>  (ufsdump level = 0 - 9)"
  exit 1
fi

#
# Here are the parameters for a DDS3 tape drive
#
echo "Partition ID=c0t0d0s0 : /"
/usr/sbin/ufsdump ${1}dsbf 54000 6000 126 ${TAPE} /dev/rdsk/c0t0d0s0
]]>
</screen>
</sect1>
</chapter>
</book>
_____________________________________________________________________

The HTML output is correct - here a simple cut from the browser
window:
_____________________________________________________________________
 #!/bin/sh

 # Script to dump partitions using ufsdump (Solaris)
 # Allowed parameters are 0 to 9 - the ufsdump values

 # Version 1 : Sun Dec 17 13:21:04 CET 2000 : L. Schaefer

 TAPE=/dev/rmt/0cn
 #TAPE=/dev/nrst0

 if [ $# -ne 1 ] ; then
   echo $0": usage  $0 <dump level>  (ufsdump level = 0 - 9)"
   exit 1
 fi
 if [ \( $1 != "0" \) -a \( $1 -ne 1 \) -a \( $1 -ne 2 \) \
   -a \( $1 -ne 3 \) -a \( $1 -ne 4 \) -a \( $1 -ne 5 \) \
   -a \( $1 -ne 6 \) -a \( $1 -ne 7 \) -a \( $1 -ne 8 \) \
   -a \( $1 -ne 9 \) ]
 then
   echo $0": usage  $0 <dump level>  (ufsdump level = 0 - 9)"
   exit 1
 fi

 #
 # Here are the parameters for a DDS3 tape drive
 #
 echo "Partition ID=c0t0d0s0 : /"
 /usr/sbin/ufsdump ${1}dsbf 54000 6000 126 ${TAPE} /dev/rdsk/c0t0d0s0
_____________________________________________________________________

The PostScript output of the above looks like this:

_____________________________________________________________________
 #!/bin/sh

 # Script to dump partitions using ufsdump (Solaris)
 # Allowed parameters are 0 to 9 - the ufsdump values

 # Version 1 : Sun Dec 17 13:21:04 CET 2000 : L. Schaefer

 TAPE=/dev/rmt/0cn
 #TAPE=/dev/nrst0

 if [ $# -ne 1 ] ; then
   echo $0": usage  $0 <dump level>  (ufsdump level = 0 - 9)"
   exit 1
 fi
 if [ -( $1 != "0" -) -a -( $1 -ne 1 -) -a -( $1 -ne 2 -) -
   -a -( $1 -ne 3 -) -a -( $1 -ne 4 -) -a -( $1 -ne 5 -) -
   -a -( $1 -ne 6 -) -a -( $1 -ne 7 -) -a -( $1 -ne 8 -) -
   -a -( $1 -ne 9 -) ]
 then
   echo $0": usage  $0 <dump level>  (ufsdump level = 0 - 9)"
   exit 1
 fi

 #
 # Here are the parameters for a DDS3 tape drive
 #
 echo "Partition ID=c0t0d0s0 : /"
 /usr/sbin/ufsdump ${1}dsbf 54000 6000 126 ${TAPE} /dev/rdsk/c0t0d0s0
_____________________________________________________________________

i.e. the backslashes are reproduced as - characters. If I generate a
TeX document from the SGML source the respective section of
the .tex file looks like this:
_____________________________________________________________________
{1}}\#!/bin/sh

\# Script to dump partitions using ufsdump (Solaris)
\# Allowed parameters are 0 to 9 -\/ the ufsdump values

\# Version 1 : Sun Dec 17 13:21:04 CET 2000 : L. Schaefer

TAPE=/dev/rmt/0cn
\#TAPE=/dev/nrst0

if [ \$\# -\/ne 1 ] ; then
  echo \$0": usage  \$0 <dump level>  (ufsdump level = 0 -\/ 9)"
  exit 1
fi
if [ -\/( \$1 != "0" -\/) -\/a -\/( \$1 -\/ne 1 -\/) -\/a -\/( \$1 -\/ne
2 -\/) -\/
  -\/a -\/( \$1 -\/ne 3 -\/) -\/a -\/( \$1 -\/ne 4 -\/) -\/a -\/( \$1
-\/ne 5 -\/) -\/
  -\/a -\/( \$1 -\/ne 6 -\/) -\/a -\/( \$1 -\/ne 7 -\/) -\/a -\/( \$1
-\/ne 8 -\/) -\/
  -\/a -\/( \$1 -\/ne 9 -\/) ]
then
  echo \$0": usage  \$0 <dump level>  (ufsdump level = 0 -\/ 9)"
  exit 1
fi

\#
\# Here are the parameters for a DDS3 tape drive
\#
echo "Partition ID=c0t0d0s0 : /"
/usr/sbin/ufsdump \$\{1\}dsbf 54000 6000 126 \$\{TAPE\}
/dev/rdsk/c0t0d0s0\endPar{}\endNode{}\end
_____________________________________________________________________

i.e. backslashes are produced as dashes from jade, which isn't quite
what I need. Also the RTF output is also correct - i.e. the problem
really seems to be restricted to the jadetex system (or its
configuration).

Can anyone help me to get my backslashes without using entities?

Best regards,

     les

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Les E. Schaefer:
Mature student of computer science:
        University of Hamburg, Germany
        E-Mail: Leslie_Schaefer@public.uni-hamburg.de
 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Disclaimer:
  All opinions expressed are personal. I neither speak on behalf of my
  employer or institute of education, nor should anything I express be
  taken as  an  indication  of their views or  policies  on either the
  subject being discussed or on any other  related subjects.  Should I
  wish to  convey  their  policies,  this  will  be expressly  stated.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]