User:Rochefoucauld/Formatting

From Wikisource
Jump to navigation Jump to search

Formatting Templates[edit]

Formatting templates are used to change the way that text displays when being read.

Text Case[edit]

Change text case with {{uc}} (upper case), {{lc}} (lower case), {{small-caps}} and {{capitalize}}. While it is OK to omit the use of the upper case, lower case, and capitalize templates altogether, where they are used they should only be inserted where the choice of case in the work is a formatting decision (ex. special formatting in a work's title), rather than as required for spelling or grammar (ex. in an acronym).

Template Example Result
{{uc}} {{uc|uppercase}} uppercase
{{lc}} {{lc|LOWERCASE}} LOWERCASE
{{small-caps}}, {{sc}} {{sc|Small Caps}} Small Caps
{{capitalize}} {{capitalize|capitalize}} capitalize

Text Size[edit]

All Wikisource size templates are relative to the default size. There are two kinds of sizing template: inline and block templates. Inline templates are suitable for use within a paragraph, but can't handle paragraph breaks, and do not adjust line spacing. Block templates can handle paragraph breaks, and adjust line spacing, but are not suitable for use within a paragraph, as they will cause a paragraph break. See H:DIVSPAN for more details.

Font size definition by relative differences using words[edit]

Inline template Block template Size 12pt/16px
default base[1]
Sample
{{xx-smaller}} {{xx-smaller block}} 58% 7pt/9px Lorem ipsum dolor sit amet,
{{x-smaller}} {{x-smaller block}} 69% 8pt/11px Lorem ipsum dolor sit amet,
{{smaller}} {{smaller block}} 83% 10pt/13px Lorem ipsum dolor sit amet,
{{fine}} {{fine block}} 92% 11pt/15px Lorem ipsum dolor sit amet,
100% 12pt/16px Lorem ipsum dolor sit amet,
{{m-larger}} {{m-larger block}} 110% 13pt/18px Lorem ipsum dolor sit amet,
{{larger}} {{larger block}} 120% 14pt/19px Lorem ipsum dolor sit amet,
{{x-larger}} {{x-larger block}} 144% 17pt/23px Lorem ipsum dolor sit amet,
{{xx-larger}} {{xx-larger block}} 182% 22pt/29px Lorem ipsum dolor sit amet,
{{xxx-larger}} {{xxx-larger block}} 207% 25pt/33px Lorem ipsum dolor sit amet,
{{xxxx-larger}} {{xxxx-larger block}} 249% 30pt/40px Lorem ipsum dolor sit amet,
  1. Contemporary web browsers have largely standardized on a default base font size of 12pt or 16px.



Indenting and Alignment[edit]

Text is by default aligned left, but where it is required to manually align text to the left, use {{left}}. To float a block of text to the left without affecting text alignment within the block, use {{float left}} or {{block left}}.

To align text to the right, use {{right}}. To float a block of text to the right without affecting text alignment within the block, use {{float right}} or {{block right}}.

To center text, use {{center}} (or {{c}}). To float a block of text to the center without affecting text alignment within the block, use {{block center}}.

Template Example Result
{{left}} {{left|this text<br/>is left justified}}
this text
is left justified
{{center}}, {{c}} {{center|this text<br/>is center justified}}

this text
is center justified

{{right}} {{right|this text<br/>is right justified}}
this text
is right justified
{{block left}}, {{float left}} {{block left|this block of text<br/>is left justified}}
this block of text
is left justified
{{block center}} {{block center|this block of text<br/>is center justified}}

this block of text text
is center justified

{{block right}}, {{float right}} {{block right|this block of text<br/>is right justified}}

this block of text
is right justified


To indent the first line of a paragraph, the template {{text-indent}} is available. Use {{nodent}} to "un-indent" a paragraph within the block. Note replicating indented paragraphs is typically not done in works transcribed here, and paragraphs are separated by a blank line.

To indent every line of a paragraph except the first, use {{hanging indent}} (or {{hi}}) or {{outdent}}. To indent a block of text left, use the colon (:) before the block. For more control, the template {{left margin}} is available. Template {{dent}} combines the functionality of {{left margin}}, {{text-indent}} and {{hi}}

To insert a fixed gap in text, use {{gap}}

Template Example Result
{{text-indent}}, {{nodent}} {{text-indent|2em|

This paragraph of text has its initial line indented. This is not standard practice. Only use where there is a specific reason to do so.

This paragraph, and any following paragraphs, will also have its initial line indented.

{{nodent|Unless you use "nodent". This paragraph does not have its initial line indented.}}

}}

This paragraph of text has its initial line indented. This is not standard practice. Only use where there is a specific reason to do so.

This paragraph, and any following paragraphs, will also have its initial line indented.

Unless you use "nodent". This paragraph does not have its initial line indented.

{{hanging indent}}, {{hi}}, {{outdent}} {{outdent|This paragraph of text has a hanging indent, often used on long entries in tables or lists}}
This paragraph of text has a hanging indent, often used on long entries in tables or lists
{{left margin}}, : {{left margin|2em|This block of text is indented left 2 "ems", to offset it from the main body}}

This block of text is indented left 2 "ems", to offset it from the main body

{{dent}} {{dent|4em|-2em|This block of text is formatted with both a left margin and a hanging indent}}

This block of text is formatted with both a left margin and a hanging indent

Character formatting[edit]

To drop the initial character of a paragraph, use {{dropinitial}}. To replicate a large initial character that does not descend into the paragraph, use {{largeinitial}}

The m-dash, with the appropriate hair spaces surrounding it, can be entered using {{}}. The spaces do not always appear correctly however, so use with caution. To replicate a inline straight line (usually indicating missing or redacted text) use {{bar}} as multiple m-dashes sometimes render as a dashed line.

To create a large brace spanning multiple lines of text, use {{brace}} or {{brace2}}. "brace" is limited to use with or in a table, "brace2" may be used anywhere.

Some works, especially older ones, use ligatures, diacritics, and alternate letterforms. Whether or not to transcribe this formatting is left up to the transcriber. These characters may be hard coded, or entered with templates. Where it is desireable to replicate the long s (s, s) in older works, templates {{long s}} or {{ls}} and {{long S}} or {{lS}} are available. Note these templates now require the addition of some lines to your CSS or Javascript pages to display. For the descending f, (ƒ), use {{f}}. Ligatures of various letter combinations can be found in Category:Ligature templates. Templates to assist in the entering of diacritics can be found in Category:Diacritic templates

Templates {{'}}, {{(}} and {{)}} allow for the insertion of the special characters ', {, and } where it would otherwise be difficult or impossible due to wikimarkup.

Display of Greek quotes, etc. can be improved with the use of {{polytonic}}.

Template Example Result
{{dropinitial}}, {{di}} {{di|D}}ropped initials are used quite often in many types of works Dropped initials are used quite often in many types of works
{{largeinitial}} {{largeinitial|L}}arge initials are less common, but are usually easier to format Large initials are less common, but are usually easier to format.
{{}} An m-dash—with hair spaces An m-dash—with hair spaces
{{bar}} Use bar {{bar|3}} for multiple m-dashes Use bar ——— for multiple m-dashes
{{brace}} {| cellspacing=0 cellpadding=0 style="background-color:transparent"

|Foo||{{brace|r|t}}||<tt><nowiki>{{brace|r|t}}
|-
|Bar||{{brace|r|s}}||<tt><nowiki>{{brace|r|s}}
|-
|Spam||{{brace|r|mt}}||<tt><nowiki>{{brace|r|mt}}
|-
|Eggs||{{brace|r|mb}}||<tt><nowiki>{{brace|r|mb}}
|-
|Bread||{{brace|r|s}}||<tt><nowiki>{{brace|r|s}}
|-
|Text||{{brace|r|m}}||<tt><nowiki>{{brace|r|m}}
|-
|Text||{{brace|r|b}}||<tt><nowiki>{{brace|r|b}}
|-
|Stuff||{{brace|r|ht}}||<tt><nowiki>{{brace|r|ht}}
|-
|Things||{{brace|r|hb}}||<tt><nowiki>{{brace|r|hb}}
|}

Foo {{brace|r|t}}
Bar {{brace|r|s}}
Spam {{brace|r|mt}}
Eggs {{brace|r|mb}}
Bread {{brace|r|s}}
Text {{brace|r|m}}
Text {{brace|r|b}}
Stuff {{brace|r|ht}}
Things {{brace|r|hb}}
{{brace2}} {{brace2|}} {{brace2|2}} {{brace2|4|r}} {{brace2|1|l}} {{brace2|3|l}}
{{long s}}, {{ls}}, {{long S}}, {{lS}}, {{f}} minuscule long s: {{ls}}; capital long S: {{lS}}; descending f: {{f}} minuscule long s: s; capital long S: s; descending f: ƒ
{{'}}, {{(}} and {{)}} apostrophe: {{'}}; open and close brackets: {{(}} {{)}} apostrophe: '; open and close brackets: { };
{{polytonic}} Normal: Οἱ ἄνθρωποι πρὸς τὸ ἀληθὲς πεφύκασιν ἱκανῶς, καὶ τὰ πλείω τυγχάνουσι τῆς ἀληθείας.

Polytonic: {{polytonic|Οἱ ἄνθρωποι πρὸς τὸ ἀληθὲς πεφύκασιν ἱκανῶς, καὶ τὰ πλείω τυγχάνουσι τῆς ἀληθείας.}}

Normal: Οἱ ἄνθρωποι πρὸς τὸ ἀληθὲς πεφύκασιν ἱκανῶς, καὶ τὰ πλείω τυγχάνουσι τῆς ἀληθείας.

Polytonic: Οἱ ἄνθρωποι πρὸς τὸ ἀληθὲς πεφύκασιν ἱκανῶς, καὶ τὰ πλείω τυγχάνουσι τῆς ἀληθείας.

{{oe}} Check out that Ph{{subst:oe}}nician pottery! Check out that Phœnician pottery!
{{ae}} All hail Athenæ! All hail Athenæ!

Separations[edit]

Use {{rule}} in preference of "----" for the creation of horizontal lines spanning the page. In addition, rule can create horizontal seperators of any length. For more fancy lines, {{custom rule}} is available.

For breaking up discontinuous runs of pages, for example when seperating blocks of transluded front and end matter (ex. Title Page, Dedication, Contents) to one page, use {{page break}}

Template Example Result
{{rule}} {{rule}}{{rule}}


{{rule|height=4px}}{{rule}}


{{rule|5em}}








{{custom rule}} {{Custom rule|sp|100|d|6|sp|10|d|10|sp|10|d|6|sp|100}}

{{custom rule|c|6|sp|40|do|7|fy1|40|do|7|sp|40|c|6}}

{{separator}} {{separator}}
· · · · ·
{{***}} {{***}}

{{***|5|3em|char=@}}

***

@@@@@

{{page break}} {{page break}} page

General formatting[edit]

Text can be colored using the {{greyed}} and {{red}} templates. Red text was often used as a highlight in older works, especially on the title page. Greyed text can be used to indicate (important) text that has been written or typed onto the original document. {{RunningHeader}} or {{rh}} creates a left justified, a centered, and a right justified block of text all on the same line, and is most often used in the Page namespace, in the header field to replicate page headers. {{gap}} is used wherever a gap of greater than one space is required.

Template Example Result
{{greyed}}, {{red}}, {{green}} {{greyed|grey text}}, {{red|red text}}, {{green|green text}} grey text, red text, green text
{{RunningHeader}} or {{rh}} {{RunningHeader|Left text|Center text|Right text}}
Left text
Center text
Right text
{{gap}} text with a{{gap|5em}}gap! text with agap!

Column formatting[edit]

Multiple Columns[edit]
{{Multicol}}
Example
 {{Multicol}}
 This text appears in the first column.
 {{Multicol-break}}
 This text appears in the second column.
 {{Multicol-break}}
 This text appears in the third column.
 {{Multicol-end}}
Result
Text in the first column.
 
Text in the second column.
 
Text in the third column.
 

  • {{div col}}, {{div col end}}, which uses CSS3 properies to create columns dynamically. The reader's browser will choose where best to put the breaks, so the layout cannot be guaranteed not to change. This one is good for lists, as you don't need to worry about placing {{multicol-break}}s.



Letter Spacing[edit]

This template simplifies formatting text that has letter-spacing.

There is a shorthand named {{sp}} that only takes one parameter and always uses the spacing .15em.

Examples[edit]

{{letter-spacing|2px|your text goes here}} produces:

your text goes here


{{letter-spacing|1.5em|your text goes here}} produces:

your text goes here


Images[edit]

{{FI
 | type         =
 | file         =
 | width        =
 | cclass       =
 | cstyle       =
 | float        =
 | margin-left  =
 | margin-right =
 | clear        =
 | caption      =
 | tmleft       =
 | indent       =
 | tstyle       =
 | talign       =
 | alt          =
 | link         =
 | page         =
}}
Example

Table Kludge[edit]

margin-right:auto !important; margin-left:auto !important;

See: Here