Шаблон: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.


{{tlx|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.
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.


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.
{{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.

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 font changes like italicizing does not.


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>{{varserif|I}}</nowiki></code>
: <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:
: {{varserif|I}}
: {{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>{{varserif|I}}</nowiki></code> = {{varserif|I}}
: <code><nowiki>{{var serif|I}}</nowiki></code> = {{var serif|I}}
: <code><nowiki>{{varserif|l}}</nowiki></code> = {{varserif|l}}
: <code><nowiki>{{var serif|l}}</nowiki></code> = {{var serif|l}}
: <code><nowiki>{{varserif|1}}</nowiki></code> = {{varserif|1}}
: <code><nowiki>{{var serif|1}}</nowiki></code> = {{var serif|1}}


Please note that {{tnull|varserif}} is not a panacea; its treatment of the numeral "1" is easily mistaken for the letter "l" (lower-case "L") in many serif fonts.
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>{{varserif|I}}</nowiki></code> = {{varserif|I}}
: <code><nowiki>{{var serif|I}}</nowiki></code> = {{var serif|I}}
: <code><nowiki>{{varserif|l}}</nowiki></code> = {{varserif|l}}
: <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, PLEASE: -->
<!-- Categories below this line; interwikis at Wikidata -->
[[Category:Mathematics templates]]
[[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

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 за овај шаблон, која се користи у TemplateWizard, Визуелном уређивачу и другим алаткама. Погледајте месечни извештај о употреби парамера за овај шаблон у чланцима заснованим на овом TemplateData.

TemplateData за Var serif

Нема описа.

Параметри шаблона

ПараметарОписВрстаСтатус
11

нема описа

непознатнеобавезно
classclass

нема описа

непознатнеобавезно
idid

нема описа

непознатнеобавезно
stylestyle

нема описа

непознатнеобавезно
langlang

нема описа

непознатнеобавезно
titletitle

нема описа

непознатнеобавезно