DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:latexcaption

This is an old revision of the document!


latexcaption Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" yes

plugin Adds syntax for latex-like figure captions and numbering

Last updated on
2022-11-09
Provides
Syntax
Repository
Source

Similar to caption, imagebox

Tagged with caption, figure, tables

A re-write of the caption plugin from Till Biskup. New plugin due to syntax change.

Fixes:

  • No string searches to set reference links that appear before a label definition.
  • Change syntax to allow multiple classes to be used eg. left, center, right.
  • Add the ability to have subfigures/tables.
  • Add an option to change caption tag syntax.
  • Code easy to expand to caption label more tags if needed.
  • Updated some css styles to use flexbox.

All documentation for this plugin can be found at https://github.com/bennvan/dokuwiki-plugin-latexcaption

Examples/Usage

The plugin provides two different syntax elements, similar to the blockquote plugin. One for the outer block/tag (figure, subfigure, table, subtable, codeblock, fileblock), and one for the caption. A caption cannot be used outside one of the main blocks.

A simple centered figure with only a caption number.

  <figure center blank|fig_label>
  {{image.jpg}}
  <caption></caption>
  </figure>

Syntax

   <figure opts|fig_label>
    <subfigure opts|subfig_label1>
       {{image1.jpg}}
       <caption>subfigure caption1</caption>
    </subfigure>
    <subfigure opts|subfig_label2>
       {{image1.jpg}}
       <caption>subfigure caption2</caption>
    </subfigure>
  <caption>Main Caption</caption>
  </figure>

It is also possible to have more than one image in a figure/subfigure to group them with one caption:

  <figure center>
      {{image1.jpg}}
      {{image2.jpg}}
   <caption>A caption</caption>
  </figure>

Referencing

Reference anywhere in text using:

  {{ref>fig_label}}
  

Set counter

Set the counter anywhere on the page using:

  <!-- Set the figure counter to 5 -->
  {{setcounter>figure=5}} 
  <!-- Set the table counter to 3 -->
  {{setcounter>table=3}} 

Example Output

Configuration

  • Signatures begin with abbreviated or advertised “labels” (“Figure” vs. “Fig.” / “Table” vs. “Tab.”).
  • Caption tag syntax to avoid conflicts with bootswrapper plugin.

Installation

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

plugin/latexcaption.1667972331.txt.gz · Last modified: 2022-11-09 06:38 by 159.196.109.209

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki