• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

conf/12-Jan-2025-2410

images/12-Jan-2025-

lang/en/12-Jan-2025-4423

syntax/12-Jan-2025-554375

LICENSED10-Jan-202517.6 KiB341281

README.mdD10-Jan-20254.3 KiB146107

action.phpD10-Jan-20253.5 KiB7863

example.pngD10-Jan-2025370.8 KiB

example2.pngD10-Jan-202567.2 KiB

helper.phpD10-Jan-2025671 3016

plugin.info.txtD10-Jan-2025246 87

style.lessD10-Jan-20254.9 KiB271229

README.md

1# latexcaption plugin for DokuWiki
2
3Adds syntax for latex-like figure captions and numbering
4
5All documentation for this plugin can be found at
6https://github.com/bennvan/dokuwiki-plugin-latexcaption
7
8
9Originally forked from Till Biskup and mostly re-written. New repo due to change in syntax.
10https://github.com/tillbiskup/dokuwiki-caption
11
12
13Fixes:
14- No string searches to set reference links that appear before a label definition.
15- Change syntax to allow multiple classes to be used eg. left, center, right.
16- Add ability to have subfigures/tables.
17- Add option to change caption tag syntax.
18- Code easy to expand to caption label more tags if needed.
19- Updated some css styles to use flexbox.
20
21The following outputs are using the bootstrap3 template. Please note that the `<caption></caption>` syntax conflicts with bootstraps' caption. I recommend to modify the boostrap3 syntax to use something like `<bscaption></bscaption>`, or alternatively I have provided a setting to change the syntax of this plugin.
22
23Example output:
24-------------
25
26![Example output](example.png "output of Example")
27
28
29New Syntax/ Example:
30-------------
31
32 - Currently supported blocks to caption are: `figure`, `subfigure`, `table`, `subtable`, `codeblock`, `fileblock`.
33
34```
35<figure opts| fig_label>
36 <subfigure opts| subfig_label1>
37	{{image1.jpg?direct&200}}
38	<caption>Subfig caption1</caption>
39 </subfigure>
40 <subfigure opts| subfig_label2>
41	{{image2.jpg?direct&200}}
42	<caption>Subfig caption2</caption>
43 </subfigure>
44 <caption>Main caption</caption>
45</figure>
46```
47
48Options:
49------------
50
51 - 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.
52 - No colon: `blank`. Use this if you dont want to print a ':' after the figure number.
53
54If 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}`.
55
56
57Example with centering and caption number only:
58
59```
60<figure center blank>
61 {{image1.jpg?direct&200}}
62 <caption></caption>
63</figure>
64```
65
66Example subfigure with a long caption:
67```
68<figure center>
69 <subfigure>
70 	{{image1.jpg?direct&200}}
71 <caption>A really long subfigure caption much longer than the image that needs to wrap</caption>
72 </subfigure>
73 <subfigure>
74	{{image2.jpg?direct&200}}
75 <caption>A moderately sized subfigure caption</caption>
76 </subfigure>
77 <caption>Main caption</caption>
78</figure>
79```
80
81This gives the output:
82
83![Example output2](example2.png "output of Example2")
84
85
86It is also possible to have more than one image in a figure/subfigure to group them with one caption:
87```
88<figure center>
89    {{image1.jpg?direct&200}}
90    {{image2.jpg?direct&200}}
91 <caption>A caption</caption>
92</figure>
93```
94
95In text referencing:
96-------------
97To render references with the type and number:
98```
99{{ref>label}} or
100{{autoref>label}}
101```
102To render references with only the number, disable `alwaysautoref` and use:
103```
104{{ref>label}}
105```
106
107If you use the MathJax plugin, enable `mathjaxref`, to have labels not captured by this plugin passed on for rendering in javascript with MathJax. This ensures the referencing syntax in dokuwiki is consistent.
108
109Warning: References may render unexpected results if your labels are not unique across all figures, subfigures, tables etc.!
110
111Set counter:
112-------------
113
114You can set the counter to any integer value at any point on the page.
115
116```
117<!-- Set the figure counter to 5 -->
118{{setcounter>figure=5}}
119
120<!-- Set the table counter to 3 -->
121{{setcounter>table=3}}
122```
123
124-----
125
126If you install this plugin manually, make sure it is installed in
127lib/plugins/latexcaption/ - if the folder is called different it
128will not work!
129
130Please refer to http://www.dokuwiki.org/extensions for additional info
131on how to install extensions in DokuWiki.
132
133----
134Copyright (C) Ben van Magill <ben.vanmagill16@gmail.com>
135
136This program is free software; you can redistribute it and/or modify
137it under the terms of the GNU General Public License as published by
138the Free Software Foundation; version 2 of the License
139
140This program is distributed in the hope that it will be useful,
141but WITHOUT ANY WARRANTY; without even the implied warranty of
142MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
143GNU General Public License for more details.
144
145See the LICENSING file for details
146