【问题标题】:Example of using unfloat::[] macro in asciidoc在 asciidoc 中使用 unfloat::[] 宏的示例
【发布时间】:2011-05-10 16:49:18
【问题描述】:

我在 AsciiDoc 中有以下标记:

[[过滤器示例]] .过滤器是通过矩阵运算创建的 image::figs/filter_example.png[scaledwidth="90%"]

我想对这张图片使用 unfloat::[] 宏,但我找不到任何示例说明如何使用。有人有什么建议吗?

【问题讨论】:

    标签: asciidoc


    【解决方案1】:

    A Block macro reference must be contained in a single line separated either side by a blank line or a block delimiter.

    在 image-blockmacro 之前或之后使用 unfloat-blockmacro,f.e.像这样:

    unfloat::[] 
    [[filter-example]] 
    .Filters are created through matrix operations    
    image::figs/filter_example.png["alt text", scaledwidth="90%"]
    

    在默认的 AsciiDoc 安装中,unfloat-blockmacro 仅对 html 后端有效。在xhtml11-backend中,示例代码会被翻译成

    <div style="clear:both;"></div>        <!-- line was added by using unfloat::[] -->
    <div id="filter-example" class="imageblock">
    <div class="content">
    <img alt="alt text" src="filter_example.png">
    </div>
    <div class="image-title">Abbildung 1: Filters are created through matrix operations</div>
    </div>
    

    在文件 asciidoc.conf 中,您将找到未实现 unfloat-blockmacro 的定义:

    [unfloat-blockmacro]
    # Implemented in HTML backends.
    

    在文件 html4.conf 中,您将找到 html 后端的 unfloat 实现:

    [unfloat-blockmacro]
    <br clear="all">
    

    在 xhtml11.conf 文件中,您将找到 xhtml 后端的 unfloat 实现:

    [unfloat-blockmacro]
    <div style="clear:both;"></div>
    

    如果您希望 html-backend 中出现其他结果,请更改这些行。

    【讨论】:

    • 完美!正是我想要的。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多