# latexcaption plugin for DokuWiki Adds syntax for latex-like figure captions and numbering All documentation for this plugin can be found at https://github.com/bennvan/dokuwiki-plugin-latexcaption Originally forked from Till Biskup and mostly re-written. New repo due to change in syntax. https://github.com/tillbiskup/dokuwiki-caption 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 ability to have subfigures/tables. - Add option to change caption tag syntax. - Code easy to expand to caption label more tags if needed. - Updated some css styles to use flexbox. The following outputs are using the bootstrap3 template. Please note that the `` syntax conflicts with bootstraps' caption. I recommend to modify the boostrap3 syntax to use something like ``, or alternatively I have provided a setting to change the syntax of this plugin. Example output: ------------- ![Example output](example.png "output of Example") New Syntax/ Example: ------------- - Currently supported blocks to caption are: `figure`, `subfigure`, `table`, `subtable`, `codeblock`, `fileblock`. ```
{{image1.jpg?direct&200}} Subfig caption1 {{image2.jpg?direct&200}} Subfig caption2 Main caption
``` Options: ------------ - Alignment classes: `left`, `center`, `right`, `even`,`w-[40,50,60,70,80]` and can be used in conjunction with optional media queries (`-sm`, `-md`, `-lg`, `-xl`) eg. `right-sm w-80-sm`. `even` may only be used with figures. - No colon: `blank`. Use this if you dont want to print a ':' after the figure number. If you want to apply your own css stying to the figures. Any option input are added as a class in the form `plugin_latexcaption_{option}`. Example with centering and caption number only: ```
{{image1.jpg?direct&200}}
``` Example subfigure with a long caption: ```
{{image1.jpg?direct&200}} A really long subfigure caption much longer than the image that needs to wrap {{image2.jpg?direct&200}} A moderately sized subfigure caption Main caption
``` This gives the output: ![Example output2](example2.png "output of Example2") It is also possible to have more than one image in a figure/subfigure to group them with one caption: ```
{{image1.jpg?direct&200}} {{image2.jpg?direct&200}} A caption
``` In text referencing: ------------- ``` {{ref>label}} ``` Warning: References may render unexpected results if your labels are not unique across all figures, subfigures, tables etc.! Set counter: ------------- You can set the counter to any integer value at any point on the page. ``` {{setcounter>figure=5}} {{setcounter>table=3}} ``` ----- If you install this plugin manually, make sure it is installed in lib/plugins/latexcaption/ - if the folder is called different it will not work! Please refer to http://www.dokuwiki.org/extensions for additional info on how to install extensions in DokuWiki. ---- Copyright (C) Ben van Magill This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. See the LICENSING file for details