LaTeX for the Figure Macro

Last modified by Admin on 2024/02/27 00:29

cogLatex specific code for the Figure macro
Developed by

Manuel Leduc, Vincent Massol, XWiki Development Team

0 Votes
LicenseGNU Lesser General Public License 2.1

XWiki 14.9+

Installable with the Extension Manager


This page describes the LaTeX output produced when this extension is installed, based on the Figure Macro configuration and the page content.


== Block Figure With Caption ==

{{figure type="graph"}}
[[image:Help.Applications.Contributors.Charlie Chaplin@Charlie_Chaplin_portrait.png]]

This is Charlie Chaplin

== Inline Figure With Caption ==

{{figure type="lemma"}}
Geometry Lemma

Given two line segments whose lengths are ##a## and ##b## respectively there is a real number ##r## such that ##b=ra##.

== Inline Figure No Caption ==

{{figure type="lemma"}}
Given two line segments whose lengths are ##a## and ##b## respectively there is a real number ##r## such that ##b=ra##.

XWiki Page result


LaTeX Export result


Block Figure Export

Unless the type of the figure is of type figure or table, which are build in LaTeX by default, exporting a figure with style block will affect the export in different ways:

  1. Import: \usepackage{newfloat} is added to the list of packages
  2. Prelude: A new floating floating environment is generated for the configured block figure types (e.g., \DeclareFloatingEnvironment{graph})
  3. FigureBlock: The figure block is slightly adapted: the name of the environment matched the id of the figure type, and a \captionsetup is inserted before the caption, allowing the label to be displayed in the right locale. For instance
    Block Figure Content.


    \caption[Block Figure Caption.]{Block Figure Caption.}

Inline Figure Export

When the type of the figure is block, the export is affects in the following ways:

  1. Prelude: A \newtheorem declaration is done for each inline figure (e.g., \newtheorem{lemma}{Lemma}}}
  2. FigureBlock:
    • When the figure contains a caption, the content of the caption is moved as the parameter of the block, for instance:
      \begin{lemma}[Inline Figure Caption]

      Inline Figure Content.
    • Otherwise, the block does not have a parameter, for instance:
      Figure Content

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).

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.


Dependencies for this extension (org.xwiki.contrib:figure-latex 15.4.2):


Get Connected