Page References with Page Numbers

View: New views
6 Messages — Rating Filter:   Alert me  

Page References with Page Numbers

by fips :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I am using docbook 5 with xinclude.

I intend to write books using xinclude very often (each chapter is a separate xml-File, which makes it easy to generate new books for new courses in a short time.)

I have not found a way to generate references from one part to another. They should all look like the following in the pdf-output:

"(See Chapter XYZ "NAME OF CHAPTER" on page. ABC)"

Under latex I had a simple script for that purppose:
\newcommand*\totalref[1]{(S. Kap. \ref{#1} auf Seite \pageref{#1})}
Is there something similar under docbook5?

What is the standard way to do this?
 - Is it a process that can be done with a script after the "*.fo"-Generation?
 - Is it better to generate a single file out of my x-included-sources before generating the references?

Any idea is welcome.

Re: Page References with Page Numbers

by Dave Pawson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

fips wrote:

> Hi
>
> I am using docbook 5 with xinclude.
>
> I intend to write books using xinclude very often (each chapter is a
> separate xml-File, which makes it easy to generate new books for new courses
> in a short time.)
>
> I have not found a way to generate references from one part to another. They
> should all look like the following in the pdf-output:
>
> "(See Chapter XYZ "NAME OF CHAPTER" on page. ABC)"
>
> Under latex I had a simple script for that purppose:
> \newcommand*\totalref[1]{(S. Kap. \ref{#1} auf Seite \pageref{#1})}
> Is there something similar under docbook5?
>
> What is the standard way to do this?


Not sure 'standard' is the right word, but
olink works.

http://www.sagehill.net/docbookxsl/Olinking.html

Very clear, very helpful.




regards

--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe@...
For additional commands, e-mail: docbook-help@...


Re: Page References with Page Numbers

by fips :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

Thanks.
I have read the mentioned page already, but I have not found a tool to generate the olinkdb.xml-File.
This must be automated, because I have a) too many single documents and b) too many changes per week in the structure. It's impossible to generate this olinkdb.xml-File by hand.

Any Ideas?


The second question that goes with that together is still open:
How to generate Pagenumbers, Titles and Chapternumbers in the PDF output?
How do I have to edit/expand the XSL/FO or FO/PDF stylesheets?

I am using
docbook-xsl-ns-1.73.1/fo
and
fop0.94_jdk1.4/fop-0.94/
to produce PDF. (Works great, thanks to Brett.)

thanks in advance

fips

Dave Pawson wrote:
fips wrote:
> Hi
>
> I am using docbook 5 with xinclude.
>
> I intend to write books using xinclude very often (each chapter is a
> separate xml-File, which makes it easy to generate new books for new courses
> in a short time.)
>
> I have not found a way to generate references from one part to another. They
> should all look like the following in the pdf-output:
>
> "(See Chapter XYZ "NAME OF CHAPTER" on page ABC)"
>
> Under latex I had a simple script for that purppose:
> \newcommand*\totalref[1]{(S. Kap. \ref{#1} on page \pageref{#1})}
> Is there something similar under docbook5?
>
> What is the standard way to do this?


Not sure 'standard' is the right word, but
olink works.

http://www.sagehill.net/docbookxsl/Olinking.html

Very clear, very helpful.




regards

--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-help@lists.oasis-open.org

Re: Page References with Page Numbers

by Dave Pawson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

fips wrote:
> Hi
>
> Thanks.
> I have read the mentioned page already, but I have not found a tool to
> generate the olinkdb.xml-File.

AFAIK that is a manual task. I.e. you need to automate it.
(Let's see if Bob comes in on this one)


> This must be automated, because I have a) too many single documents and b)
> too many changes per week in the structure. It's impossible to generate this
> olinkdb.xml-File by hand.

Then look at the syntax of the olink file and see if you
can generate it using xslt?

>
> Any Ideas?
>
>
> The second question that goes with that together is still open:
> How to generate Pagenumbers, Titles and Chapternumbers in the PDF output?
> How do I have to edit/expand the XSL/FO or FO/PDF stylesheets?


I'm less sure on this, but I *think* that will be done
automatically when the 'book' is joined together to create the
xsl-fo file, prior to creating the PDF? I.e. the page numbers
are generated at the formatter (fo to pdf) stage?


regards



regards

--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe@...
For additional commands, e-mail: docbook-help@...


RE: Page References with Page Numbers

by Richard Hamilton-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

As Dave says, olink works and there's a very nice description
in Bob Stayton's book.

If your application is simpler; for example, if you only need
links to work after the xinclude process has pulled together
a complete document, you can get away with xref, provided that
you keep the ids unique across your files.

The caveat is that if you run the stylesheets on an individual
chapter that references outside itself, you'll get ??? in place
of your link.  But, if you only care about having the links work
after everything has been xincluded into your book, that shouldn't
be a problem.

For styling your cross references, Bob's book is once again the
place to go.  Check out the following section for details:

http://www.sagehill.net/docbookxsl/CustomXrefs.html

Hope that helps,
Dick Hamilton


> -----Original Message-----
> From: Dave Pawson [mailto:davep@...]
> Sent: Wednesday, August 29, 2007 4:21 AM
> To: fips
> Cc: docbook@...
> Subject: Re: [docbook] Page References with Page Numbers
>
>
> fips wrote:
> > Hi
> >
> > I am using docbook 5 with xinclude.
> >
> > I intend to write books using xinclude very often (each chapter is a
> > separate xml-File, which makes it easy to generate new
> books for new courses
> > in a short time.)
> >
> > I have not found a way to generate references from one part
> to another. They
> > should all look like the following in the pdf-output:
> >
> > "(See Chapter XYZ "NAME OF CHAPTER" on page. ABC)"
> >
> > Under latex I had a simple script for that purppose:
> > \newcommand*\totalref[1]{(S. Kap. \ref{#1} auf Seite \pageref{#1})}
> > Is there something similar under docbook5?
> >
> > What is the standard way to do this?
>
>
> Not sure 'standard' is the right word, but
> olink works.
>
http://www.sagehill.net/docbookxsl/Olinking.html

Very clear, very helpful.




regards

--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe@...
For additional commands, e-mail: docbook-help@...




---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe@...
For additional commands, e-mail: docbook-help@...


Solved

by fips :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Dick

Your hint worked with docbook 5. I simply use the following stylesheet (which includes docbook.xml) as my stylesheet.


<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version='1.0'
                xmlns="http://www.w3.org/TR/xhtml1/transitional"
                exclude-result-prefixes="#default">

  <xsl:import href="docbook.xsl"/>

  <xsl:variable name="toc.section.depth">3</xsl:variable>
  <!-- Add other variable definitions here -->

  <!-- PHI Style Aug 2007 -->
  <xsl:param name="paper.type">A4</xsl:param>

  <xsl:param name="insert.xref.page.number">yes</xsl:param>
  <xsl:param name="local.l10n.xml" select="document('')"/>
  <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
    <l:l10n language="de">
      <l:context name="xref">
        <l:template name="page.citation" text=" (s. S. %p)"/>
      </l:context>
    </l:l10n>
  </l:i18n>

</xsl:stylesheet>

The link anchors look like this:
<part  .....  xml:id="part_konzepte">

And the links I use are as follows:
<xref linkend="part_konzepte"/>


fips




Dick Hamilton wrote:
As Dave says, olink works and there's a very nice description
in Bob Stayton's book.

If your application is simpler; for example, if you only need
links to work after the xinclude process has pulled together
a complete document, you can get away with xref, provided that
you keep the ids unique across your files.

The caveat is that if you run the stylesheets on an individual
chapter that references outside itself, you'll get ??? in place
of your link.  But, if you only care about having the links work
after everything has been xincluded into your book, that shouldn't
be a problem.

For styling your cross references, Bob's book is once again the
place to go.  Check out the following section for details:

http://www.sagehill.net/docbookxsl/CustomXrefs.html

Hope that helps,
Dick Hamilton


> -----Original Message-----
> From: Dave Pawson [mailto:davep@dpawson.co.uk]
> Sent: Wednesday, August 29, 2007 4:21 AM
> To: fips
> Cc: docbook@lists.oasis-open.org
> Subject: Re: [docbook] Page References with Page Numbers
>
>
> fips wrote:
> > Hi
> >
> > I am using docbook 5 with xinclude.
> >
> > I intend to write books using xinclude very often (each chapter is a
> > separate xml-File, which makes it easy to generate new
> books for new courses
> > in a short time.)
> >
> > I have not found a way to generate references from one part
> to another. They
> > should all look like the following in the pdf-output:
> >
> > "(See Chapter XYZ "NAME OF CHAPTER" on page. ABC)"
> >
> > Under latex I had a simple script for that purppose:
> > \newcommand*\totalref[1]{(S. Kap. \ref{#1} auf Seite \pageref{#1})}
> > Is there something similar under docbook5?
> >
> > What is the standard way to do this?
>
>
> Not sure 'standard' is the right word, but
> olink works.
>
http://www.sagehill.net/docbookxsl/Olinking.html

Very clear, very helpful.




regards

--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-help@lists.oasis-open.org




---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-help@lists.oasis-open.org