Reference page in printed asciidoc documentation

385 views Asked by At

I want to create a link within an asciidoc PDF for a printed book. The right way to do this is something like:

[[LinkUniqueCode]]
Here is the stuff I'm linking to...
Lots of document here...

Now look <<LinkUniqueCode,at the link>>.

Normally I would expect this to render as something like this in PDF:

Now look at the link (Page 13).

But instead I'm getting a link which is useless in a printed PDF...

I've searched a lot for this but the keywords I found are too generic and I only found this.

I've tried adding :xrefstyle: full but that didn't really help either.

I've seen this both through the fopub backend and the PDF backend. I'm guessing there should be a "print mode" for the PDF generation but I can't really see what I'm doing wrong here.

2

There are 2 answers

2
Shai Almog On

OK, that was me being stupid. I forgot to include:

:doctype: book

Which made it all good.

Edit:

For full reference here's my entire header:

:xrefstyle: full
:listing-caption: Listing
:sectnums:
:pdf-page-size: [8.125in, 10.25in]
:doctype: book
:media: prepress
:icons: font
:source-highlighter: rouge
:toc: macro
:toclevels: 4
:toc-title: Contents
:toc-placement: manual
:tip-caption: :bulb:
:autofit-option:
:hide-uri-scheme:
:uuid: 92CA37B2-EB2B-4B8F-AC7C-XXXXXXXXX
:front-cover-image: image:images/ebook.png[Front Cover,1000,1600]
:lang: en-US
:revdate: 2018-07-22
:doctitle: My Title
:author: Shai Almog
:producer: Codename One Academy
:description: My Description
:keywords: My Keywords,Other Words
:copyright: Shai Almog, all rights reserved
:publication-type: book

Then the body of this file is:

include::file-names-for-each-chapter.asciidoc[]

[index]
== Index

This seemed to work correctly

2
Hendrik Timmermann On

look at: https://stackoverflow.com/questions/47312831/asciidoctor-page-number-usable

I took your example and it was not made good.

What other settings like xrefstyle you used?

EDIT: look here:

asciidoctor-pdf -v
Asciidoctor PDF 1.5.0.alpha.16 using Asciidoctor **1.5.4** [http://asciidoctor.org]
Runtime Environment (ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)

I think this explains:

On Wed, Aug 9, 2017 at 11:23 PM, Jeremie Bresson [via Asciidoctor :: Discussion] <[hidden email]> wrote:

The "xrefstyle" feature is really great (new with Asciidoctor 1.5.6.1, see http://asciidoctor.org/docs/user-manual/#customizing-the-cross-reference-text )