【问题标题】:Reference page in printed asciidoc documentation打印的 asciidoc 文档中的参考页
【发布时间】:2017-11-28 13:31:21
【问题描述】:

我想在 asciidoc PDF 中为印刷书籍创建一个链接。正确的做法是这样的:

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

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

通常我希望它在 PDF 中呈现为这样的内容:

Now look at the link (Page 13).

但我得到的链接在打印的 PDF 中没有用...

我为此搜索了很多,但我发现的关键字太笼统了,我只找到了this

我尝试添加:xrefstyle: full,但这也没有真正帮助。

我已经通过 fopub 后端和 PDF 后端看到了这一点。我猜应该有一个 PDF 生成的“打印模式”,但我真的看不出我在这里做错了什么。

【问题讨论】:

    标签: codenameone asciidoc asciidoctor asciidoctor-pdf


    【解决方案1】:

    好吧,那是我太傻了。我忘了包括:

    :doctype: book
    

    这一切都很好。

    编辑

    完整的参考是我的整个标题:

    :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
    

    那么这个文件的主体是:

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

    这似乎工作正常

    【讨论】:

    • 它是否允许您打印链接文本的页码? (因为根据this 似乎不可能)
    • 我现在不记得了,但我记得它确实有效。我记得我最终使用了 asciidoctor-pdf,它有点不稳定,但我能够让它工作。编辑答案以包含最终书中的代码。我还写了这篇关于我在后期处理中必须做的工作:medium.com/sketch-app-sources/…
    【解决方案2】:

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

    我拿了你的例子,但效果不好。

    您还使用了哪些其他设置,例如外部参照样式?

    编辑:看这里:

    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)
    

    我认为这可以解释:

    2017 年 8 月 9 日星期三晚上 11:23,Jeremie Bresson [来自 Asciidoctor :: Discussion] 写道:

    “xrefstyle”功能真的很棒(Asciidoctor 1.5.6.1 的新功能,请参阅http://asciidoctor.org/docs/user-manual/#customizing-the-cross-reference-text

    【讨论】:

    • 我不明白这个答案?我将如何引用该页面。我只能参考不是很好但我可以忍受的部分
    • 嗨,你好,我也有同样的问题。我也解决不了。使用外部参照样式仅适用于 asciidoctor 1.5.6.1 并且不会解决获取页码的问题,但至少可以解决一些标题和文本。
    猜你喜欢
    • 2014-08-25
    • 2015-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多