Bản mẫu:Smallcaps all

Bách khoa toàn thư mở Wikipedia
Buớc tưới chuyển hướng Bước tới tìm kiếm

{{{1}}}

Tài liệu bản mẫu[xem] [sửa] [lịch sử] [làm mới]


This template permanently changes the content in it, first by converting it to lower case, then displaying it in small caps, about the same height as regular lower-case letters. The lower-case conversion happens regardless of user preferences, and the content will copy-paste as lowercase regardless of its displayed appearance. For this reason, it is usually not suitable for article text, and is intended for specialized purposes.

It is primarily for use in other templates, to correct mixed- or uppercase input that should actually be lowercase despite the visual display.

Other templates have been developed to handle content that should actually be upper- or mixed-case, as detailed in #Deprecated uses, below.

This template should not be used for emphasis in articles; see MOS:CAPS and MOS:SMALLCAPS.

Usage[sửa mã nguồn]

Code
{{smallcaps all|Hello World}}
Displayed
HELLO WORLD
Pasted
Correctly as "Hello World" in a few browsers, but incorrectly as "hello world" in many.

To maintain initial full capitals, a second parameter is used. Example:

Code
{{smallcaps all|H|ello}} {{smallcaps all|W|orld}}
Displayed
HELLO WORLD
Pasted
Correctly as "Hello World".

This style is not usually used in Wikipedia. For cases where it is needed, use {{Smallcaps}} (and {{Smallcaps2}} for smaller output), which produce this result without need of additional parameters, and for entire spans of text.

If the template is placed outside a link, it will capitalize the link itself, so in some cases it needs to be placed inside the link.

This template will corrupt HTML character entities, such as  ; if a special character much be used in its content, it must be encoded as a decimal character references (e.g.  ).

If either parameter's content contains an equals sign (=) the parameters needs to be numbered, |1= and (if two are used) |2=, or the template will break. This is a general limitation of MediaWiki syntax.

Legitimate uses[sửa mã nguồn]

This template should only be used for text that is normally all-lowercase regardless of typographic style, but which is desired to be shown in smallcaps for display purposes. An example is indication of stressed syllables in the {{Respell}} template.

It is also capable of mixed-case display with additional parameters, but rarely needed for this purpose since {{Smallcaps}} and {{Smallcaps2}} do this more robustly.

Deprecated uses[sửa mã nguồn]

The default parameter of this template should never be used for strings, such as acronyms, that should be capitalized regardless of typographic style. As noted above, it can be used, but only with additional parameters, to represent mix-case text; this is better done with {{Smallcaps2}} (e.g., TCMoS), or {{Smallcaps}} (e.g., Hello World), both of which work on entire spans of mixed-case text, and neither of which require additional parameters.

Several of the following attempts to lighten ALL-CAPS words, abbreviations, or acronyms, as a matter of typographic style, will corrupt the data; many violate the Manual of Style if used in articles; and those that do not are better done with other templates:

To l)

  • To quasi-mix the case of acronyms, as in UNESCO (instead of UNESCO) – This is not done in Wikipedia articles; see MOS:CAPS, MOS:ACRONYMS.
  • To make acronyms and initialisms, and other all-caps strings like Unicode character names, smaller, as in UNESCO and IDEOGRAPHIC COMMAThis is better done with {{Smallcaps2}}, because the data will not be corrupted and the display will be more legible.
  • A trademark like TIME (instead of TIME) – Do not use this in articles, per MOS:TM.
  • To present smallcaps titles of works, in citation styles that use this format – Use {{Smallcaps}} for this purpose since it can be done in one parameter and with more legible results; don't do it at all in articles outside of such citation styles, nor for headings, table headers, etc. (see MOS:CAPS, WP:CITE).
  • Era abbreviations in dates such as 625 BCEUse {{Smallcaps2}} for this purpose, as it will be more legible.
  • The special case of transliterating YHWH as "the LORD", as in the King James Bible – There is a dedicated template for this, {{LORD}}, with more legible output.

Technical notes[sửa mã nguồn]

  • This template's main parameter is a wrapper for <span class="allcaps" style="text-transform: lowercase;">...</span> – This method cannot be relied upon because it does not work at least in Internet Explorer 5 and 6, which are still fairly common browsers, and it is implemented inconsistently in others, such that it copy-pastes as the original text in Firefox, but as the altered text in Chrome, Safari, Opera, and text-only browsers.
  • This template should not be directly substituted because the result will not be just the intended text, but the original text wrapped in HTML and wikitemplate code. It is better to use other templates like {{smallcaps}}, {{smallcaps2}}, or a combination of them, to achieve the desired result, and to correct the actual case of the content while doing so.
  • Diacritics (å, ç, é, ğ, ı, ñ, ø, ş, ü, etc.) are handled. However, because the job is performed by each reader's browser, inconsistencies in CSS implementations can lead to some browsers not converting certain rare diacritics.
  • Use of this template does not generate any automatic categorization. As with most templates, if the argument contains an = sign, the sign should be replaced with {{=}}, or the whole argument be prefixed with 1=. And for wikilinks, you need to use piping. There is a parsing problem with MediaWiki which causes unexpected behavior when a template with one style is used within a template with another style.
  • There is a problem with dotted and dotless I. {{Lang|tr|{{Smallcaps|ı i}}}} gives you ı i, although the language is set to Turkish.
  • Do not use this inside Chú thích kiểu 1 or Chú thích kiểu 2 templates, or this template's markup will be included in the COinS metadata. This means that reference management software such as Zotero will have entries corrupted by the markup. For example, if {{smallcaps}} is used to format the surname of Bloggs, Joe in {{cite journal}}, then Zotero will store the name as <span style="font-variant:small-caps;">Bloggs</span>, Joe. This is incorrect metadata. If the article that you are editing uses a citation style that includes small caps, either format the citation manually (see examples below) or use a citation template that specifically includes small caps in its formatting, like {{Cite LSA}}.
  • This template will not affect the use of HTML character entities like &nbsp;.

Comparison of the case transformation templates[sửa mã nguồn]

Template Shortcut Purpose Example Output Copy-pastes as
{{Smallcaps}} {{sc1}}
{{SC}}
No conversion, small-caps display, mixed case.
No font size change (acronyms are unaffected).
Common mixed-case heading style (not in Wikipedia).
Uses: Rendering publication titles in citation styles that require them in small-caps.
{{sc1|UNICEF}} and 312&nbsp;{{sc1|BCE}}

{{sc1|Mixed Case}}

Bản mẫu:Sc1 and 312 Bản mẫu:Sc1

Bản mẫu:Sc1

UNICEF and 312 BCE

Mixed Case

{{Smallcaps2}} {{sc2}} No conversion, small-caps display, mixed case.
Slightly reduced font size.
This is the conventional display of smallcaps for acronyms/initialisms in modern book typography.
Other uses: Unicode character names (use {{Unichar}}).
{{sc2|UNICEF}} and 312&nbsp;{{sc2|BCE}}

{{sc2|Mixed Case}}

UNICEF and 312 BCE

Mixed Case

UNICEF and 312 BCE

Mixed Case

{{Smallcaps all}} {{sc}} Lowercase conversion, small-caps display, all uppercase.
The size of lowercase letters.
Uses: Stressed syllables (in {{Respell}}); and ???.
Warning: Default use will permanently change UPPER- or Mixed-Case data,
does not work consistently across different browsers,
and is not compatible with named HTML character entities.
{{sc|UNICEF}} and 312&nbsp;{{sc|BCE}}

{{sc|Mixed Case}}

UNICEF and 312 BCE

Mixed Case

unicef and 312 bce

mixed case
(in many browsers)

{{Allcaps}} {{caps}} Uppercase conversion, all-caps display.
The size of uppercase letters.
Uses: ???.
Warning: Will permanently change lower- or Mixed-Case data,
does not work consistently across different browsers,
and is not compatible with named HTML character entities.
{{caps|UNICEF}} and 312&nbsp;{{caps|BCE}}

{{caps|Mixed Case}}

UNICEF and 312 BCE

Mixed Case

UNICEF and 312 BCE

MIXED CASE
(in many browsers)

{{Nocaps}}   Lowercase conversion, all-lowercase display.
The size of lowercase letters.
Uses: ???.
Warning: Will permanently change UPPER- or Mixed-Case data,
and does not work consistently across different browsers.
{{nocaps|UNICEF}} and 312&nbsp;{{nocaps|BCE}}

{{nocaps|Mixed Case}}

UNICEF and 312 BCE

Mixed Case

unicef and 312 bce

mixed case
(in many browsers)

See also[sửa mã nguồn]

  • {{Fixcaps}} – capitalizes or lowercases words (mostly used to repair paragraphs written by new editors in all-caps or all-lowercase {{fixcaps|pLAy/tHE/GamE}} → Play the Game
  • {{Capitalization}} – banner-style template indicating an article needs capitalization cleanup
  • {{R from other capitalisation}} – for categorizing WP:Redirects from titles to article (or other pages) where the redirect is just a different capitalization
  • {{Template capitalization}} – ??

Magic words that rewrite the output (copy-paste will get the text as displayed, not as entered):

  • {{lc:}} – lower case output of the full text
  • {{uc:}} – upper case output of the full text
  • {{lcfirst:}} – lower case output of the first character only
  • {{ucfirst:}} – upper case output of the first character only