l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
April 21: Google Glass
Next Installfest:
TBD
Latest News:
Mar. 18: Google Glass at LUGOD's April meeting
Page last updated:
2002 Jan 16 15:35

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] docbook question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] docbook question



On Tue, Jan 15, 2002 at 06:52:48PM -0800, Peter Jay Salzman wrote:
> how do i reference a previous section in a docbook document?
> 
> 
> <sect1><title>A lesson in logic</title>
> 
> 	<para> ish bibleo outen doten baba ba deeten datten.  hin dickey
> 	wah-wah. </para>
> 
> </sect1>
> 
> 
> 
> <sect1><title>How to apply logic</title>
> 
> 	<para> In section ??? we learned a lesson in logic.  In this section
> 	we learn how to apply logic. </para>
> 
> </sect1>
> 
> 
> 
> how do i make a reference to the first section from the second section?
> 
> pete

Well, I very much prefer <section> to <sect1> or <sect2>, because you
can nest it as deeply as you want (that's been supported since DocBook
3.x - we're at 4.x now, and if you don't have <section> you really
oughta upgrade).

Anyway, you just make sure that you fill in the id attribute for the
section (or figure or example) in question:

  <section id="my-section">
  </section>

And then refer to it using <xref>:

  In section <xref linkend="my-section"/>

The trailing '/' is of course for XML docs - if you're using SGML, the
"recommended practice" is to add a space before that '/', but I still
get parse errors from SGML parsers in that case, so you'd do best to
simply remove it.  If you are using SGML but plan on switching to XML
(I switched only recently - using Apache's Xalan and FOP processors to
convert DocBook to PDF docs.  Unfortunately Norman Walsh's XSLT
stylesheets suck worse than his DSSSL ones), leave 'em in and write a
sed/awk/perl script to remove 'em for ya.

In recent versions of DocBook, you also have the <link> element, which
will produce hyperlinks for you:

  <link linkend="my-section">Click here for more info</link>

HTH,
Micah
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.