Шаблон:Var serif/док — разлика између измена
Нова страница: {{Documentation subpage}} <!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE --> This template is to help facilitate the displaying of variable name… |
Нема описа измене |
||
Ред 1: | Ред 1: | ||
{{Documentation subpage}} |
{{Documentation subpage}} |
||
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> |
|||
<!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE --> |
|||
==Usage== |
|||
⚫ | 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, ''and'' 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|var serif|1}} for "1" (numeral one), as it is usually more clearly distinguishable from "I" and "l" in sans-serif than serif fonts. |
||
⚫ | |||
⚫ | 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, |
||
⚫ | The {{tlx|var serif}} 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 font changes like italicizing does not. |
||
⚫ | |||
⚫ | The {{tlx| |
||
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. |
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. |
||
Example: |
Example: |
||
: <code><nowiki>{{ |
: <code><nowiki>{{var serif|I}}</nowiki></code> |
||
outputs: |
outputs: |
||
: <code><nowiki><var style="font-size:118%;font-family:serif;">I</var></nowiki></code> |
: <code><nowiki><var style="font-size:118%;font-family:serif;">I</var></nowiki></code> |
||
which renders as: |
which renders as: |
||
: {{ |
: {{var serif|I}} |
||
;Comparisons: |
;Comparisons: |
||
Ред 21: | Ред 21: | ||
: <code><nowiki>{{var|l}}</nowiki></code> = {{var|l}} |
: <code><nowiki>{{var|l}}</nowiki></code> = {{var|l}} |
||
: <code><nowiki>{{var|1}}</nowiki></code> = {{var|1}} |
: <code><nowiki>{{var|1}}</nowiki></code> = {{var|1}} |
||
: <code><nowiki>{{ |
: <code><nowiki>{{var serif|I}}</nowiki></code> = {{var serif|I}} |
||
: <code><nowiki>{{ |
: <code><nowiki>{{var serif|l}}</nowiki></code> = {{var serif|l}} |
||
: <code><nowiki>{{ |
: <code><nowiki>{{var serif|1}}</nowiki></code> = {{var serif|1}} |
||
Please note that {{tnull| |
Please note that {{tnull|var serif}} is not a panacea; its treatment of the numeral "1" is easily mistaken for the letter "l" (lower-case "L") in many serif fonts. |
||
; Recommended usage: |
; Recommended usage: |
||
: <code><nowiki>{{ |
: <code><nowiki>{{var serif|I}}</nowiki></code> = {{var serif|I}} |
||
: <code><nowiki>{{ |
: <code><nowiki>{{var serif|l}}</nowiki></code> = {{var serif|l}} |
||
: <code><nowiki>{{var|1}}</nowiki></code> = {{var|1}} |
: <code><nowiki>{{var|1}}</nowiki></code> = {{var|1}} |
||
: <code><nowiki>{{var|</nowiki>{{var|variable}}<nowiki>}}</nowiki></code> for any other variable |
: <code><nowiki>{{var|</nowiki>{{var|variable}}<nowiki>}}</nowiki></code> for any other variable |
||
==TemplateData== |
|||
{{TemplateDataHeader}} |
|||
<templatedata> |
|||
{ |
|||
"params": { |
|||
"1": {}, |
|||
"class": {}, |
|||
"id": {}, |
|||
"style": {}, |
|||
"lang": {}, |
|||
"title": {} |
|||
} |
|||
} |
|||
</templatedata> |
|||
{{Semantic markup templates}} |
{{Semantic markup templates}} |
||
<includeonly> |
<includeonly>{{Sandbox other|| |
||
<!-- |
<!-- Categories below this line; interwikis at Wikidata --> |
||
[[Category: |
[[Category:Mathematical formatting templates]] |
||
[[Category:Programming typing-aid templates]] |
[[Category:Programming typing-aid templates]] |
||
[[Category:Semantic markup templates]] |
[[Category:Semantic markup templates]] |
||
[[Category:Wikipedia XHTML tag-replacing templates]] |
[[Category:Wikipedia XHTML tag-replacing templates]] |
||
</includeonly> |
}}</includeonly> |
Верзија на датум 11. јануар 2021. у 01:36
Ово је документациона подстраница за Шаблон:Var serif. Садржи информације о коришћењу, категоријама и другом садржају који није део оригиналне странице. |
Usage
This template is to help facilitate the displaying of variable names (in mathematics, computer source code, etc.) with the semantically correct <var>...</var>
, which also renders the variable in italics, as is customary, and 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 {{var|1}}
rather than {{var serif|1}}
for "1" (numeral one), as it is usually more clearly distinguishable from "I" and "l" in sans-serif than serif fonts.
{{Var serif}}
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.
The {{var serif}}
method is preferred to simply italicizing and using inline style to specify the font, for accessibility, content/presentation separation, semantic Web, and metadata reasons; XHTML's <var>
element has semantic meaning, while simple font changes like italicizing does not.
Because the font styling in the template is done entirely with CSS, it has no effect at all upon content semantics, nor does it change the output for users of screen reader software.
Example:
{{var serif|I}}
outputs:
<var style="font-size:118%;font-family:serif;">I</var>
which renders as:
- I
- Comparisons
{{var|I}}
= I{{var|l}}
= l{{var|1}}
= 1{{var serif|I}}
= I{{var serif|l}}
= l{{var serif|1}}
= 1
Please note that {{var serif}}
is not a panacea; its treatment of the numeral "1" is easily mistaken for the letter "l" (lower-case "L") in many serif fonts.
- Recommended usage
{{var serif|I}}
= I{{var serif|l}}
= l{{var|1}}
= 1{{var|variable}}
for any other variable
TemplateData
TemplateData за Var serif
Нема описа.
Параметар | Опис | Врста | Статус | |
---|---|---|---|---|
1 | 1 | нема описа | непознат | необавезно |
class | class | нема описа | непознат | необавезно |
id | id | нема описа | непознат | необавезно |
style | style | нема описа | непознат | необавезно |
lang | lang | нема описа | непознат | необавезно |
title | title | нема описа | непознат | необавезно |