cogProvides numbered headings, figures and tables and references to them
Recommended
TypeJAR
CategoryMacro
Developed by

Vincent Massol

Active Installs104
Rating
Rate!
1 Votes
LicenseGNU Lesser General Public License 2.1
Compatibility

Since v1.2 requires XWiki 10.2RC1+

Installable with the Extension Manager

Description

Provides numbered headings, figures and tables. Also allows to create reference links to those numbered elements.

Numbered Headings

Example usage:

See section {{reference section="D"/}}. Invalid {{reference section="invalid"/}}.

= heading A

= heading B =

{{include reference="NumberedHeadings.Test.WebHome"/}}

== heading C ==

== {{id name="D"/}}heading D ==

=== heading E ===

= heading F =

Generates the following when viewing the page:

example.png

Numbered Figures & Tables

Example usage:

See figure {{reference figure="f1"/}}.

{{figure}}
[[image:http://www.clker.com/cliparts/3/m/v/Y/E/V/small-red-apple-md.png||width=100]]

{{figureCaption}}{{id name="f1"/}}An image{{/figureCaption}}
{{/figure}}

See table {{reference figure="t1"/}}.

{{figure}}
|a|b
|c|d

{{figureCaption}}{{id name="t1"/}}A table{{/figureCaption}}
{{/figure}}

Generates the following when viewing the page (with this CSS used):

example-figures.png

Translations

The Numbered Figure transformation generate some labels which can be internationalized. The following translation keys are used:

  • transformation.numberedReferences.figurePrefix
  • transformation.numberedReferences.tablePrefix

Default English translations:

transformation.numberedReferences.figurePrefix = Figure {0}:
transformation.numberedReferences.tablePrefix = Table {0}:

Limitations

  • When using the {{reference}} macro to reference a heading, the section value must point to either an auto-generated heading anchor or the name parameter of an {{id}} macro located inside the heading.
  • When using the {{reference}} macro to reference a figure or table, the figure and table values must point to the name parameter of an {{id}} macro located inside the {{figureCaption}} macro.
  • The elements are numbered thanks to several Rendering Transformations and at the moment of writing, Transformations are global. Thus if you activate this transformation on your wiki, you'll get numbered elements for all pages of your wiki and subwikis.

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.


This extension contributes two Transformations which need to be activated. This is done by editing your xwiki.properties file and making sure you have a  rendering.transformations property with the numberedheadings id in the list for the heading numbering feature and the numberedfigures id for the figure/table numbering feature. For example:

rendering.transformations = macro, icon, numberedheadings, numberedfigures

Release Notes

v1.3.4

  • Closed NBREF-10 Numbered figure transformation fails when using a wikimacro which does not use {{wikimacrocontent}}

v1.3.3

  • Closed NBREF-9 Transformation fails when the reference macro is used inside a wiki macro which does not use {{wikimacrocontent}}

v1.3.2

  • Closed NBREF-8 Figure Caption May Not Start With Italics

v1.3.1

  • Closed NBREF-7 References in figure captions are no longer working on XWiki 10.11

v1.3

  • Closed NBREF-5 Protect against duplicate numbered entities

v1.2

  • Closed NBREF-3 Add ability to number figures created using the {{figure}} macro

v1.1

  • Closed NBREF-2 Don't remove the MacroMarkerBlock

v1.0

Dependencies

Dependencies for this extension (org.xwiki.contrib:macro-numbered-references 1.3.4):

Tags:
Created by Vincent Massol on 2018/03/05 21:04
    

Get Connected