# வார்ப்புரு:Barlabel/doc

என்ற வார்ப்புருவைப் பயன்படுத்தி, வரும் உயிரின கிளை வரைபடத்தில், குறியீடுகளும், தலைப்புகளும் இணைக்கப்பட, இந்த வார்ப்புரு பயன்படுகிறது.  

## பயன்பாடுகள்

1. First create a cladogram using and , as appropriate.
1. Then embed the cladogram in this template as the value of .

### Example

Suppose you have created the cladogram shown below.  

To provide labels for the two groups identified in the cladogram:  
- Count the number of leaf nodes in the cladogram; here there are 7. The parameter <tt>size</tt> will be set to 7.
- Decide against which leaf nodes you want the labels to go. To centre the labels, the label for the green group should be opposite leaf node 3; the label for the purple group should be between leaf nodes 5 and 6, i.e. opposite leaf node "5.5". The <tt>at</tt> parameters of the template are set to these values.

The full expression required is shown below (excluding the code to create the cladogram).  
<pre></pre>  
This produces  

To reduce the font size of the cladogram and its labels, use the <tt>style</tt> parameter. Thus  
<pre></pre>  
produces  

The cladogram can be aligned to the , with text flowing around it to the , but in this case you must specify the space allowed for the labels using the parameter <tt>labelwidth</tt>, otherwise the labels will appear off the of the page. Trial and error may be needed, but about 60% of the number of characters in the longest label is usually a good starting point. Thus  
<pre></pre>  
produces the cladogram on the below.  

The cladogram can be placed centrally on the page by specifying <tt>|align=</tt> or <tt>|align=centre</tt>. The <tt>labelwidth</tt> parameter is needed to ensure the cladogram is centred; if it is omitted, the labels will be ignored in determining the placement. Thus  
<pre></pre>  
produces  

The cladogram can also be aligned with text flowing around it to the by using <tt>|align=</tt>. Again the <tt>labelwidth</tt> parameter is needed, otherwise the labels will overlap the text.  

(The template can be used to align cladograms without brackets/bars and labels, although offers more options for doing this.)  
<br>  

### Parameters

- <tt>size</tt> must be set to the total number of leaf nodes in the cladogram, e.g. <tt>|size=23</tt>.

Up to five labels can be provided. They are identified by the digit in the name of the parameter. Each label requires three parameters, e.g. <tt>at2</tt>, <tt>label2</tt> and <tt>bar2</tt> for the second label. *There is no connection between these numbers and the numbers used to identify child nodes in or .* The "1" can be omitted, i.e. <tt>at</tt>, <tt>label</tt> and <tt>bar</tt> are equivalent to <tt>at1</tt>, <tt>label1</tt> and <tt>bar1</tt>.  

- <tt>atN</tt> defines the position of label N in terms of position of the leaf node in the whole cladogram, starting from 1 and ending at the value of <tt>size</tt>. The label is placed opposite the chosen leaf node. For a label between two leaf nodes, use the average. Thus to place the first label opposite leaf node 6, use <tt>|at1=6</tt>; to place the third label opposite a point between leaf nodes 6 and 7, use <tt>|at3=6.5</tt>.
- <tt>labelN</tt> defines the text of label N. Thus to give the third label the text "Group 3", use <tt>|label3=Group 3</tt>.
- <tt>barN</tt> defines the colour of label N. Thus to put the second label in green text, use <tt>|bar3=green</tt>. (The name <tt>bar</tt> is consistent with ; however <tt>colourN</tt> or <tt>colorN</tt> can be used instead.)
- <tt>style</tt> The size of the text used in the cladogram and labels can be altered by using the <tt>style</tt> parameter, e.g. <tt>|style=font-size:85%</tt>. *Do not alter the font size in the or templates!* If you do, the cladogram and the labels will not align correctly as they will be of different sizes.
- <tt>align</tt> The cladogram can be aligned centrally by specifying <tt>|align=</tt> or <tt>|align=centre</tt>, or to the or by specifying <tt>|align=</tt> or <tt>|align=</tt>. The last two allow text to flow around the side of the cladogram, i.e. it is embedded in the text.
- <tt>labelwidth</tt> When using <tt>|align=</tt>, you must also specify the space allowed for the labels using <tt>labelnumber''</tt>, otherwise the space occupied by the labels will be ignored in placing the cladogram. Trial and error may be needed, but about 60% of the number of characters in the longest label is usually a good starting point.

## Limitations, debugging

The template works by constructing a hidden table. Different browsers (user agents) have different algorithms for laying out tables, so the precise alignment of the labels differs between browsers and platforms, and is not always exactly opposite the chosen leaf node. Although it's possible to 'tweak' the alignment for one browser/platform combination (e.g. by using fractional positions other than 0.5), this won't work across combinations.  

The template does not check the ranges of the parameters supplied, so make sure that the values of the <tt>atN</tt> parameters are less or equal to the value of the <tt>size</tt> parameters. Label N will only be displayed if <tt>size</tt>, <tt>atN</tt> and <tt>labelN</tt> are defined. The colour of the text of the label (defined by <tt>barN</tt>, <tt>colorN</tt> or <tt>colourN</tt>) defaults to black.  

Setting <tt>labelwidth</tt> is needed whenever the cladogram is aligned to the centre, or . This includes placing <tt></tt> inside and aligning it to the via that template.  

<includeonly>  

</includeonly>