Перейти до вмісту

Шаблон:Dropinitial

Матеріал з Вікіджерел
{{i}} Документація шаблону[перегляд] [редагувати] [історія] [очистити кеш]

Використання

[ред.]


Цей шаблон призначений для створення ефекту "Ініціалу (Бу́квиці)", який поширений як у сучасній, так і в застарілій типографіці:

використовується з параметрами {{dropinitial|L|2.4em|0em|.05em}}

To use

[ред.]

{{dropinitial| content | font-size | margin-top | margin-right | margin-bottom | margin-left | fontfam=font-family | z-index=#}}.

Note that positional parameters 2 through 6, also have corresponding named parameters aligning with their function as shown in the above example.

The font-size parameter and margin value parameters should be specified with relative units, i.e. as a percent or in 'en' or 'em' units.


None of the parameters are necessary, in which case the defaults are:

  • content = A
  • font-size = 3em
  • margin-right = .1em


Which should produce a drop initial approximately the height of two lines in the current Wikisource default font:

{{dropinitial|L}}{{Small-caps|orem}} ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis 
natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium 
quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, 
rhoncus ut, imperdiet a, venenatis vitae, justo.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.

Notes :
Dropped initials are typically used with small capitals for the other letters of the word starting with this initial. See {{Small-caps}}.
Fonts can be rendered slightly differently in different browsers and on different operating systems. You may wish to check your work in Mozilla Firefox, Apple Safari, Opera, Windows Internet Explorer or other web browsers on different computers to ensure that the text wraps around the initial in the way you expect it to if you are not using the default values.

You can also use an image as the contents. When doing this,you should set the "alt" attribute to the letter in question. This allows people with text readers to see the text, and allows the text to be copied properly.

{{dropinitial|[[File:Chronica Polonorum L.jpg|50px|alt=L]]}}{{Small-caps|orem}} ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula
 eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis,
 ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec,
 vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.

Margin examples

[ред.]
Default Top, 0.1em Bottom, 1em Left, −0.5em
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.

Use with quotes

[ред.]

Occasionally these works will have a quote (") that appears with the drop initial. The means to handle this is like …

Correct:

{{float left|"}}{{dropinitial|P|4em}} gives

"P

Incorrect:

{{dropinitial|"P|4em}} gives

"P

This basically forces the quote before the drop initial coding. Extra formatting can be applied to the quote as required.

Alternative method:

The named parameter fl can be used.

{{Dropinitial|P|fl="}} gives:

P

Typography notes

[ред.]

If you simply need to have an enlarged initial in a text, which is not dropped below the baseline, use the template {{largeinitial}}:

Lorem ipsum sit amet...

Technical notes

[ред.]

This template simply generates a left-floated span (w/style display: block;) containing content with the proper CSS styles applied to it. Unfortunately the CSS 3 styles specifically directed at formatting drop initials are implemented only in Safari at this point (see this documentation at MDN Web Docs). In planning for the future this template applies a class "dropinitial" to the output span.

As a floated element, this template may interact with other floated elements in an manner which editors may not expect, especially if they are unfamiliar with CSS float positioning. In such cases, the following may be useful:

  • Use of the fl parameter
  • Careful use of {{float left/s}} to consolidate preceding floated blocks into a single container.
  • Asking for assistance at WS:Scriptorium/Help

Див. також

[ред.]
  • {{Largeinitial}}, for large initials that sit on the same baseline as surrounding text and extend upwards
  • {{Initial}}, to simplify drop initials, small caps, numbering etc. from the start of paragraphs into a single template