https://wiktenauer.com/index.php?title=Template:Varserif/doc&feed=atom&action=historyTemplate:Varserif/doc - Revision history2024-03-29T06:21:49ZRevision history for this page on the wikiMediaWiki 1.34.2https://wiktenauer.com/index.php?title=Template:Varserif/doc&diff=17911&oldid=prevMichael Chidester: 1 revision2012-09-23T03:07:56Z<p>1 revision</p>
<p><b>New page</b></p><div>{{Documentation subpage}}<br />
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --><br />
<br />
==Usage==<br />
This template is to help facilitate the displaying of variable names (in mathematics, computer source code, etc.) with the semantically correct <code><nowiki><var>...</var></nowiki></code>, which also renders the variable in italics, as is customary, <em>and</em> to do so in a serif font. This is ''specifically'' for the use of the characters "I" (upper-case i) and "l" (lower-case L), which in many sans-serif fonts can be difficult to distinguish. The template also very slightly adjusts the font size of the enclosed variable, to account for typical difference in [[x-height]] between non-fancy serif (e.g., Times and Times New Roman) and sans-serif (e.g. Arial and Helvetica) typefaces. The template should not be used generally, but only for "I" and "l", and perhaps other cases where a known visual ambiguity can be shown to exist in common sans-serif fonts for readers without acute vision. It is recommended to use {{tlx|var|1}} rather than {{tlx|varserif|1}} for "1" (numeral one), as it is usually more clearly distinguishable from "I" and "l" in sans-serif than serif fonts.<br />
<br />
{{tlx|Varserif}} need not be used for variables that simply ''contain'' "I" or "l", only for cases in which readers are likely to be unable to distinguish them visually.<br />
<br />
The {{tlx|varserif}} method is preferred to simply italicizing and using inline style to specify the font, for [[WP:Accessibility|accessibility]], [[Separation of presentation and content|content/presentation separation]], [[semantic Web]], and [[WP:METADATA|metadata]] reasons; XHTML's <code><nowiki><var></nowiki></code> element has semantic meaning, while simple italicization does not.<br />
<br />
Because the font styling in the template is done entirely with [[Cascading Style Sheets|CSS]], it has no effect at all upon content semantics, nor does it change the output for users of [[screen reader]] software.<br />
<br />
Example: <br />
<br />
:<code><nowiki>{{varserif|I}}</nowiki></code><br />
<br />
outputs<br />
<br />
:<code><nowiki><var style="font-family: serif; font-size: 118%;">I</var></nowiki></code><br />
<br />
which renders as:<br />
<br />
:{{varserif|I}}<br />
<br />
;Comparisons:<br />
<br />
:<code><nowiki>{{var|I}}</nowiki></code> = {{var|I}}<br />
:<code><nowiki>{{var|l}}</nowiki></code> = {{var|l}}<br />
:<code><nowiki>{{var|1}}</nowiki></code> = {{var|1}}<br />
:<code><nowiki>{{varserif|I}}</nowiki></code> = {{varserif|I}}<br />
:<code><nowiki>{{varserif|l}}</nowiki></code> = {{varserif|l}}<br />
:<code><nowiki>{{varserif|1}}</nowiki></code> = {{varserif|1}}<br />
<br />
Please note that {{tnull|varserif}} is not a panacea &ndash; it's treatment of the numeral "1" is easily mistaken for the letter "l" (lower-case "L") in many serif fonts.<br />
<br />
;Recommended usage:<br />
<br />
:<code><nowiki>{{varserif|I}}</nowiki></code> = {{varserif|I}}<br />
:<code><nowiki>{{varserif|l}}</nowiki></code> = {{varserif|l}}<br />
:<code><nowiki>{{var|1}}</nowiki></code> = {{var|1}}<br />
:<code><nowiki>{{var|</nowiki>{{var|variable}}<nowiki>}}</nowiki></code> for any other variable<br />
<br />
==See also==<br />
{{Var/seealso}}<br />
<br />
<includeonly><br />
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --><br />
[[Category:Mathematics templates|{{PAGENAME}}]]<br />
[[Category:Programming typing-aid templates|{{PAGENAME}}]]<br />
[[Category:Semantic markup templates|{{PAGENAME}}]]<br />
[[Category:Wikipedia XHTML tag replacing templates|{{PAGENAME}}]]<br />
</includeonly></div>Michael Chidester