DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:caption

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:caption [2018-05-26 23:39] – [Installation] Klap-inplugin:caption [2024-02-24 17:06] (current) tbiskup
Line 4: Line 4:
 description: Provide figure and table captions with reference and automatic numbering description: Provide figure and table captions with reference and automatic numbering
 author     : Till Biskup author     : Till Biskup
-email      : till@till-biskup.de+email      : till [at] till [minus] biskup [dot] de
 type       : syntax type       : syntax
-lastupdate : 2015-08-04 +lastupdate : 2024-02-24 
-compatible : Weatherwax+,Adora Belle,Angua,Rincewind+compatible : Elenor of TsortFrusterick MannersGreeboHogfather, Igor, Jack Jackrum
 depends    :  depends    : 
 conflicts  : bootswrapper conflicts  : bootswrapper
Line 20: Line 20:
 ---- ----
  
-Please refer to the [[http://till-biskup.de/de/software/dokuwiki/caption|plugin homepage]] for //the original// installation and documentation guide(note that instructions are only available in German).+Please refer to the [[https://www.till-biskup.de/de/software/dokuwiki/caption|plugin homepage]] for //the original// installation and documentation guide (note that instructions are only available in German).
  
-=====Syntax=====+===== Syntax =====
  
-The plugin basically provides two different syntax elements, similar to the [[https://www.dokuwiki.org/plugin:blockquote|blockquote plugin]] :+The plugin basically provides two different syntax elements, similar to the [[plugin:blockquote|blockquote plugin]], one for the outer block (figure, table, codeblock, fileblock), one for the caption:
  
-    <figure></figure> , <table></table> +  <figure> 
-    <caption></caption>+  ... 
 +  <caption>...</caption> 
 +  </figure> 
 + 
 +Besides ''<figure>...</figure>'' as shown aboveyou can use ''<table>...</table>'', ''<codeblock>...</codeblock>'', and ''<fileblock>...</fileblock>'' as well.
  
-''<caption></caption>'' only ever be used within one of the other two environments.+''<caption>...</caption>'' should only ever be used within one of the other two environments.
  
-**Note:** Illustrations always have subscripts, tables always have superscriptions. Place the caption accordingly.+**Note:** Illustrations always have their captions set below the actual illustration, tables (and code/file blocks) always have their captions placed above. Place the caption accordingly.
  
 Within the syntax elements, almost every other DokuWiki markup is allowed. Within the syntax elements, almost every other DokuWiki markup is allowed.
  
-The caption environment provides for automatic numbering and the output of the string "figure" or "figure" (and corresponding to the tables).+The caption environment provides for automatic numbering and the output of the string "Fig." or "Figure" (and corresponding for the tables, code and file blocks).
  
-Whether the abbreviated or spelled notation is to be used can be set via the configuration interface of the plugin. The respective strings are localized, localizations for German and English are currently available, others can be easily installed if necessary ((according to the guidelines and structures of DokuWiki for multilingualism.)) .+Whether the abbreviated or spelled notation is to be used can be set via the configuration interface of the plugin. The respective strings are localized, localizations for GermanEnglish, Korean and Portuguese-Brazil are currently available, others can be easily installed if necessary((According to the guidelines and structures of DokuWiki for multilingualism.)).
  
-**Note:** In DokuWiki almost everything is allowed within a ''<caption>'' , but you should be aware that eg footnotes within a floating environment are not allowed in LaTeX. ((An appropriate automatic handling of footnotes within the scope of the dokulatex plugin within floating environments is (at least for the moment) beyond the possibilities and the reasonable amount of programming effort.))+**Note:** In DokuWiki almost everything is allowed within a ''<caption>'', but you should be aware that e.g. footnotes within a floating environment are not allowed in LaTeX.((An appropriate automatic handling of footnotes within the scope of the dokulatex plugin within floating environments is (at least for the moment) beyond the possibilities and the reasonable amount of programming effort.))
  
-====Labels and references====+==== Labels and references ====
  
 Since the figures and tables are automatically numbered by the plugin, there is a need to be able to refer to these figures / tables automatically in the text without having to change all references by hand each time when regrouping the figures / tables. Since the figures and tables are automatically numbered by the plugin, there is a need to be able to refer to these figures / tables automatically in the text without having to change all references by hand each time when regrouping the figures / tables.
  
-The original restriction by the parser that only references to already defined figures / tables were resolved has been fixed ((The "trick" is a little rough as it is a search & replace in the already parsed part of the current page.)) .+The original restriction by the parser that only references to already defined figures / tables were resolved has been fixed((The "trick" is a little rough as it is a search & replace in the already parsed part of the current page.)).
  
 The syntax looks like this: The syntax looks like this:
-<code>+
   <figure label>   <figure label>
- ... +  ... 
- </ Figure>+  </figure> 
 +   
 +  ... 
 +   
 +  {{ref>label}}
  
- ... 
- 
- {{Ref> label}}  
-</code> 
 The same applies to the tables. This means that the (optional) label is defined in the opening tag of an image / table ((Pay attention to short, concise but meaningful labels. Since the same labels are also used in the case of LaTeX export in LaTeX, all limitations of LaTeX labels apply: no special characters such as umlauts, no spaces)) and via the structure The same applies to the tables. This means that the (optional) label is defined in the opening tag of an image / table ((Pay attention to short, concise but meaningful labels. Since the same labels are also used in the case of LaTeX export in LaTeX, all limitations of LaTeX labels apply: no special characters such as umlauts, no spaces)) and via the structure
  
-  {{Ref> label}} +  {{ref>label}}
  
-referred to. The reference does not differentiate between figures and tables; without exception (like the corresponding LaTeX command ''\ref{}'' ) it outputs the corresponding number. This number is also a link to the corresponding figure / table+referred to. The reference does not differentiate between figures and tables; without exception (like the corresponding LaTeX command ''\ref{}'') it outputs the corresponding number. This number is also a link to the corresponding figure / table.
-** +
-Note:** If a label / table has a label defined, this will be displayed as a "hover" text ("tooltip"), if you move the mouse over the respective beginning of the respective label ("image formation" n "/"). Tab [belle] m ") moves.+
  
-====Example====+**Note:** If a label / table has a label defined, this will be displayed as a "hover" text ("tooltip"), if you move the mouse over the respective beginning of the respective label ("Fig[ure] n" / "Tab[le] m"). 
 + 
 +==== Changing numbering ==== 
 + 
 +Sometimes you would like to control the numbering of your figures/tables/... This is possible as well (new 2021-09-29). You can (re)set the counters everywhere on your dokuwiki page, and independently for all kinds of environments (figures, tables, code and file listings). Suppose you would want to set the counter for figures to 5: 
 + 
 +  {{setcounter figure=5}} 
 + 
 +Note: You can only set the four defined types (''figure'', ''table'', ''codeblock'', ''fileblock''), and you can only use integers. 
 + 
 +==== Example ====
  
 And that's how the DokuWiki markup could look like: And that's how the DokuWiki markup could look like:
 <code xml> <code xml>
-  <figure> +<figure> 
- {{: Stuff: kuschelpanzer.jpg | cuddle tanks}} +{{:Stuff:kuschelpanzer.jpg|cuddle tanks}} 
- <caption> ** The ultimate pink cuddly shell. ** Now I finally have to get one +<caption>**The ultimate pink cuddly shell.** Now I finally have to get one 
- Create a caption, which also contains some // formatting //. +Create a caption, which also contains some // formatting //. 
- Basically, everything is allowed ((footnotes actually?)) </caption > +Basically, everything is allowed ((footnotes actually?))</caption> 
- </figure> +</figure> 
 </code> </code>
 And the result: And the result:
  
-{{ https://web.archive.org/web/20180525110511im_/https://www.till-biskup.de/_media/de/software/dokuwiki/figure-caption-beispiel.png | cuddle tanks}}+{{ https://web.archive.org/web/20180525110511im_/https://www.till-biskup.de/_media/de/software/dokuwiki/figure-caption-beispiel.png?recache |cuddle tanks}}
  
 or analogously for a table: or analogously for a table:
 <code bash> <code bash>
-  <table> +<table> 
- <caption> And a table heading with some ** bold text **.  </caption>+<caption>And a table heading with some **bold text**.</caption>
  
- ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ +^ Heading 1 ^ Heading 2 ^ Heading 3 ^ 
-  Some text |  some more text |  some less text | +|  Some text |  some more text |  some less text | 
-  no idea what to write in here ||| +|  no idea what to write in here ||| 
-  |  But still some idea for here ||+|  |  But still some idea for here ||
  
- </table></code>+</table> 
 +</code>
  
-{{https://web.archive.org/web/20180525110511im_/https://www.till-biskup.de/_media/de/software/dokuwiki/table-caption-beispiel.png |}}+{{https://web.archive.org/web/20180525110511im_/https://www.till-biskup.de/_media/de/software/dokuwiki/table-caption-beispiel.png?recache |}}
  
-====Styles====+==== Styles ====
  
 The individual elements are as far as possible separately addressable and adaptable via changes to the CSS file of the plugin. The individual elements are as far as possible separately addressable and adaptable via changes to the CSS file of the plugin.
  
 The following is an example of the XHTML code generated by the plugin, specifying the appropriate classes. The following is an example of the XHTML code generated by the plugin, specifying the appropriate classes.
-<code xhtml+ 
-  <div class = "figure" > +<code xml
-   <div class = "caption" > +<figure class="plugin_caption_figure"> 
-     <span class = "captionno" > Figure 2: </ span >  +    <figcaption class="plugin_caption_caption"> 
-     <span class = "captiontext" > ... </ span > +        <span class="plugin_caption_caption_number">Figure 2:</span> 
-   </ div +        <span class="plugin_caption_caption_text">...</span> 
- </ div ></code> +    </figcaption
 +</figure> 
 +</code>
  
 Basically, it is important to format the image subheadings and table headings so that they are as clear as possible from the surrounding body text (especially if they span multiple paragraphs, which may be less common, but may well occur). Basically, it is important to format the image subheadings and table headings so that they are as clear as possible from the surrounding body text (especially if they span multiple paragraphs, which may be less common, but may well occur).
  
-====Configuration====+==== Configuration ====
  
-The DokuWiki configuration interface can be used to set whether the over / signatures begin with abbreviated or advertised "labels" ("Figure" vs. "Figure" / "Table" vs. "Tab.").+The DokuWiki configuration interface can be used to set whether the over / signatures begin with abbreviated or advertised "labels" ("Figure" vs. "Fig." / "Table" vs. "Tab.").
  
 The "labels" are initially available in German and English via the standard localization of the plugins, but can also be supplemented for other languages ​​if required.  The "labels" are initially available in German and English via the standard localization of the plugins, but can also be supplemented for other languages ​​if required. 
Line 117: Line 132:
 ===== Installation ===== ===== Installation =====
  
-Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. 
 + 
 +===== Development ===== 
 + 
 +Development takes place via git and GitHub.  
 + 
 +Feel free to fork the repository, change it and submit pull requests. 
 + 
 +=== Change Log === 
 + 
 +{{rss>https://github.com/tillbiskup/dokuwiki-caption/commits/master.atom date}} 
 + 
 +=== Known Bugs and Issues === 
 + 
 +Please report bugs or feature requests at the [[https://github.com/tillbiskup/dokuwiki-caption/issues|bug tracker]]. 
plugin/caption.1527370752.txt.gz · Last modified: 2018-05-26 23:39 by Klap-in

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