LaTeX for the Figure Macro

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

cogLatex specific code for the Figure macro
Recommended
TypeJAR
CategoryAPI
Developed by

Manuel Leduc, Vincent Massol, XWiki Development Team

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Compatibility

XWiki 14.9+

Installable with the Extension Manager

Description

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

Example

== Block Figure With Caption ==

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

{{figureCaption}}
This is Charlie Chaplin
{{/figureCaption}}
{{/figure}}

== Inline Figure With Caption ==

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

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

== 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##.
{{/figure}}

XWiki Page result

figure-macro-latex.png

LaTeX Export result

figure-macro-latex-export.png

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
    \begin{graph}[h]
    Block Figure Content.

    \captionsetup{name=Graph}

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

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.
      \end{lemma}
    • Otherwise, the block does not have a parameter, for instance:
      \begin{lemma}
      Figure Content
      \end{lemma}

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

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

Tags:
    

Get Connected