सामग्री पर जाएँ

साँचा:Dropinitial

विकिस्रोत से
(साँचा:Drop initial से अनुप्रेषित)

साँचा:High-use

This template is for creating the "drop initial" effect that is common in both modern and antiquated typography:

Used with parameters {{dropinitial|L|2.4em|0em|.05em}} within a block of Times New Roman text.

{{dropinitial| content | font-size | margin-top | margin-right | margin-bottom | margin-left | 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 'em' units.

The only necessary parameter is the first one (the initial). If no others are set, the defaults are:

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

Using images

[सम्पादन]

You can use the image parameter and the text in parameter 1 will be the alt text. If this is not provided, the page will be added to Category:Dropinitials with image but no alt text. Use imgsize for the image size (this has to end in "px").

You can also use an image as the contents in 1. When doing this,you must 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|L|image=Chronica Polonorum L.jpg|imgsize=50px}}{{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 using the fl parameter:

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

" P

If you need to set a text indent, use the text-indent parameter. Generally, drop initials have zero indent, even if "normal" paragraphs have them, and this is therefore the default.

Example

{{dropinitial|L|text-indent=2em}}{{lorem ipsum}}

{{dropinitial|L|fl="|text-indent=2em}}{{lorem ipsum}}

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

" LLorem 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 within a list

[सम्पादन]

When using a drop initial within a list, an adjustment will need to be made from

* {{dropinitial|I}}Tem
* Item 2 
* Item 3
  • ITem
  • Item 2
  • Item 3

to the following,

* [[Example link|{{{{BASEPAGENAME}}|I}}Tem]] 
* <li style="position:relative; left:1em; margin-left:-1em;">Item 2 
* Item 3

Otherwise the list marker will overlap the bottom of the Drop initial. The values needed will vary depending on the size of the Dropinitial, and content immediately preceding it in a list item.

  • ITem
  • Item 2
  • Item 3

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}}:

साँचा:Largeinitialorem 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

Tracking categories

[सम्पादन]

Template data

[सम्पादन]

साँचा:TemplateDataHeader

Add a 'drop capital', either text or an image

साँचे के पैरामीटर्स[साँचा डेटा सम्पादित करें]

इस साँचे के लिए पैरामीटरों के इनलाइन प्रारूपण को प्राथमिकता दी जाती है।

पैरामीटरविवरणप्रकारस्थिति
11

The text of the drop capital.

पंक्तिआवश्यक
flfl

Float-left content, if any (often a quote mark)

उदाहरण
"
पंक्तिवैकल्पिक
font-sizefont-size 2

Font size (in CSS units). Has no meaning if an image is set.

डिफ़ॉल्ट
3em
उदाहरण
2em
पंक्तिवैकल्पिक
imageimage

The image to use, if any.

फ़ाइलवैकल्पिक
imgsizeimgsize

The image size

उदाहरण
50px
पंक्तिवैकल्पिक
margin-topmargin-top 3

Top margin (in CSS units)

डिफ़ॉल्ट
0em
उदाहरण
1em
पंक्तिवैकल्पिक
margin-rightmargin-right 4

Right margin (in CSS units)

डिफ़ॉल्ट
0.1em
उदाहरण
1em
पंक्तिवैकल्पिक
margin-bottommargin-bottom 5

Bottom margin (in CSS units)

डिफ़ॉल्ट
0
उदाहरण
1em
पंक्तिवैकल्पिक
margin-leftmargin-left 6

Left margin (in CSS units)

डिफ़ॉल्ट
0
उदाहरण
1em
पंक्तिवैकल्पिक
z-indexz-index

Element z-index

उदाहरण
2
संख्यावैकल्पिक
  • {{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
  • {{Img float#Polygon shape outlines}}, for a large initial a with polygonal outline; needed when the image has a non-rectangular shape around which the surrounding text flows.