Template:Interlinear: Difference between revisions
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
If you came here looking for a way to change one of the links produced by this template, then all you need to know is in the "Glossing abbreviations" section of the documentation. Though probably you're better off simply asking for help on the talk page. | If you came here looking for a way to change one of the links produced by this template, then all you need to know is in the "Glossing abbreviations" section of the documentation. Though probably you're better off simply asking for help on the talk page. | ||
--> | --> | ||
{{ | |||
== Basic usage == | |||
This template formats a linguistic [[Interlinear gloss|interlinear glossed text]]: | |||
<div style="margin-left:1.5em;"> | |||
{{demo|br=0|<nowiki>{{interlinear | |||
|Nginda-rni ngaja-mi jurliji-rdarra diyim ka-rdu | |||
|DEM(M)-FOC see-IRR bird-PL fly 3SG-go | |||
|'Look at all the birds flying!'}}</nowiki>}}</div> | |||
{{red|Important}}: On lines to be interlinearised, any [[Help:Wiki markup|wiki markup]] or [[Help:Template|templates]] should never span word boundaries. Мarkup or templates that apply to a sequence of words must be repeated for each word: (It is also possible to apply formatting to an entire line, see [[#Line formatting|below]]) | |||
<div style="margin-left:1.5em;"> | |||
{{demo|br=0|<nowiki>{{interlinear | |||
|Te ni-ke'''koo''' '''te̱e''' '''ún''' | |||
|And past-arrived.PL man he | |||
|"The men arrived"}}</nowiki>}}</div> | |||
The characters {{code|<}}, {{code|>}} and {{code|{{=}}}} should not be used directly. They can be substituted as follows: | |||
{|class="wikitable" | |||
|- | |||
! Character | |||
! Substitute | |||
|- | |||
| < | |||
| &lt; | |||
|- | |||
| > | |||
| &gt; | |||
|- | |||
| = | |||
| <nowiki>{{=}}</nowiki> | |||
|} | |||
To let a multi-word expression be treated as a single word, surround it in {curly brackets}. Similarly, use {{code|{} }} for an empty word:<ref>An alternative in each case is to use a [[Template:nbsp|non-breaking space]]: the example sentence would then be: ''This is a little&nbsp;example in &nbsp; Dutch.''</ref> | |||
<div style="margin-left:1.5em;"> | |||
{{demo|br=0|<nowiki>{{interlinear | |||
|Dit is een voorbeeldje in het Nederlands | |||
|This is a {little example} in {} Dutch.|}}</nowiki>}}</div> | |||
The template can be invoked with any number of unnamed parameters, which are interpreted as lines of text. If there is only one unnamed parameter, then it will be rendered in-line and treated as a gloss line: <code><nowiki>{{interlinear|house-ATTR master-ABS}}</nowiki></code> gives: {{interlinear|house-ATTR master-ABS}}. If there are more than one, then all will be interlinearised except the last one, which is assumed to be the free translation. To force the interlinearisation of ''all'' lines, supply an empty last unnamed parameter: | |||
<div style="margin-left:1.5em;"> | |||
{{demo|br=0|<nowiki>{{interlinear | |||
|Ù-dììny Juáàny bèʔcw. | |||
|COMPL-hit Juan dog|}}</nowiki>}}</div> | |||
== Layout == | |||
A line of text to be displayed '''above''' the interlinear block is given using {{para|top}}, one to be displayed immediately '''below''' the free translation is set using {{para|bottom}}. If any of these need to contain more than a singe line, then line breaks can be introduced using {{tl|br}}. | |||
'''Example numbering''' can be set using {{para|number}}. The parameter consists of one or more characters to be displayed in the left margin. | |||
<div style="margin-left:1.5em;"> | |||
{{demo|br=0|<nowiki>{{interlinear|number=(15a)|top=Potential mood: {{br}} ''Kʼetʼuq ɣˤay ħaƛułxo.'' | |||
|kʼetʼu-q ɣˤay ħaƛu-'''ł'''-xo | |||
|cat-POSS:ESS milk:ABS drink-'''POT'''-PRS | |||
|"The cat can drink milk."}}</nowiki>}}</div> | |||
The '''indentation''' of the interlinear block (measured in [[Em (CSS)|ems]]) can be modified using {{para|indent}}. | |||
Currently, the default value is 3 if {{para|number}} is set, and 0 otherwise. This behaviour is set to change: the next version of the template will apply indentation by default. | |||
The '''spacing''' between consecutive word stacks can be adjusted using {{para|spacing}}; it is measured in [[Em (CSS)|ems]] and its default value is ''1''. | |||
To '''visually set off''' the interlinear display from surrounding text, the {{para|box|yes}} parameter can be used. It surrounds the whole interlinear text in a box with a wikitable-like background colour. | |||
<div style="margin-left:1.5em;"> | |||
{{demo|br=0|<nowiki>{{interlinear|lang=jig|spacing = 3| box = yes | |||
|Nyama-baji imimikin-bili-rni-rni ardalakbi-wurru-ju | |||
|DEM-PL old.woman-ANIM.DU-F-ERG hot-3PL-do | |||
|'The two old women feel hot.'}}</nowiki>}}</div> | |||
To add a comment after a given line, use {{para|c''N''}} (where ''N'' is the sequence of the line: the content of {{para|c1}} will be appended at the end of first line, {{para|c2}} – at the end of the second line etc.): | |||
<div style="margin-left:1.5em;"> | |||
{{demo|br=0|<nowiki>{{interlinear | |||
|Shte da e vidiyal | |||
|FUT COMPL AUX see.PTC.M.SG | |||
|'He must have seen it.' | |||
|c1 = (rare in spoken usage)}} | |||
</nowiki>}}</div> | |||
== <span id="Line formatting">Line formatting</span> == | |||
Formatting can be set for an entire line using the {{para|style''N''}} parameter, which applies CSS style properties<ref name="CSSnote"/> to line ''N'' ({{para|style1}} for the first line, {{para|style2}} for the second one, etc):<!--better use character-spacing?--> | |||
<div style="margin-left:1.5em;"> | |||
{{demo|br=0|<nowiki>{{interlinear|style1 = font-size:120%|style2 = color:DarkMagenta; | |||
|Įxę̀ę eya ı̨-lè | |||
|yesterday sick/painful PFV.3.SBJ-COP.PFV | |||
|'Yesterday he was sick.'}}</nowiki>}}</div> | |||
Similarly, CSS '''classes'''<ref>See [[WP:CLASS]] for a list of available classes. See also [[Help:User style]] for setting up customised display of classes.</ref> can be specified for line ''N'' using {{para|class''N''}}. Classes should be given ''without'' any quotation marks. | |||
'''Italics''' are by default applied to the first line, unless disabled by {{para|italics1|no}}. Any line can be italicised using {{para|italics''N''|yes}} (where ''N'' is the number of the line). On italicised lines, '''tone numbers'''<ref>Any single digit following an alphabetical character is treated as a tone number.</ref> will be formatted as superscripts, unless {{para|tone-superscripting}} is set to {{code|no}}. To turn off italics for a particular word within an italicised line, use {{tl|noitalic}}. | |||
To specify the '''language''' of a given line, you can use {{para|lang''N''}} (with ''N'' being ''1'' for the first line, ''2'' for the second one etc.).<ref>At this stage, the resulting behaviour does not necessarily match that of the {{tl|lang}} template/s.</ref> The parameter should be the ISO code of the language, as in the familiar [[Template:Lang]]. If the unnumbered {{para|lang}} is given, then it is applied to the first line. If line ''N'' employs '''IPA''', then the effect of [[Template:IPA]] can be mimicked by setting {{para|ipa''N''|yes}}.<ref>This only applies the IPA CSS class.</ref> If transliteration has been used, then the transliteration scheme can be specified with the {{para|transl''N''}} parameter (similarly to [[Template:Transl]]). | |||
== Glossing abbreviations == | |||
Linguistic glosses typically abbreviate grammatical category labels, like this: {{gcl|ACC}}, instead of the full name 'accusative'. The line containing such glosses is specified using {{para|glossing''N''|yes}} (where ''N'' is the number of the line within the interlinear text). If no line is specified, then it is assumed such glosses are found in the second line (this can be bypassed with {{para|glossing2|no}}). Within the lines so specified, any sequence of upper case letters will be interpreted as a grammar gloss and formatted in {{small caps|small caps}}. | |||
Additionally, the template will attempt to recognise the meaning of each abbreviation by looking it up in several places (more details [[#Custom abbreviations|below]]), and if the abbreviation is found, it will be formatted with a dotted underline and the "label" of this abbreviation will be displayed in a tooltip, like this: {{gcl|DAT}}. Alternatively, the abbreviation can be turned into a link to the wikipedia article about the corresponding grammatical category, like this: {{gcl|DAT|glossing=link}}. To choose the latter behvaiour, use the following parameter: {{para|glossing|link}}. It is possible for separate lines to employ different styles, in this case the parameters used will be {{para|glossing2}}, {{para|glossing3}}, etc. | |||
{{anchor|gcl}} | |||
If a particular glossing abbreviation is to be treated differently from the rest, then {{tl|gcl}} can be used: | |||
<div style="margin-left:1.5em;"> | |||
<syntaxhighlight lang="wikitext">{{interlinear|ngagun-yi nga-nanda-yi nung | |||
|{{gcl|1sg}}.NOM-{{gcl|ERG||}} {{gcl|1sgA|1st-person singular "agent"}}.3sgO-see-{{gcl|'''P'''ST}} {{gcl|3sg}}.ACC | |||
|'I saw him/her.'}}</syntaxhighlight></div> | |||
{{interlinear|ngagun-yi nga-nanda-yi nung | |||
|1sg.NOM-{{gcl|ERG||}} {{gcl|1sgA|1st-person singular "agent"}}.3sgO-see-{{gcl|'''P'''ST}} {{gcl|3sg}}.{{gcl|acc}} | |||
|'I saw him/her.'}} | |||
In this example, {{tlc|gcl|acc}} marks up ''acc'' as a glossing abbreviation (it wouldn't have otherwise been interpreted as such because it is lower-case). {{tlc|gcl|1sgA|1st-person singular "agent"}} is used to define the meaning of the unusual abbreviation ''1sgA'', which wouldn't be recognised even in upper case. {{tlc|gcl|ERG||}} displays the abbreviation as a link to the Wikipedia article. {{tlc|gcl|<nowiki>'''P'''ST</nowiki>}} applies formatting to a part of a glossing abbreviation; if {{tlc|gcl}} weren't used here then the wikimarkup would have forced ''P'' to be treated as a separate abbreviation from ''ST''. | |||
If the grammatical category labels are not abbreviated but written out in full (like that: {{gcl|ACCUSATIVE|glossing=no abbr}}) then {{para|glossing}} should be set to {{code|no abbr}}, which will only apply small-caps formatting: | |||
<div style="margin-left:1.5em;"> | |||
{{demo|br=0|<nowiki>{{interlinear|glossing=no abbr | |||
|wǒ yǐjing jiàn-guò {Zhāng Sān} le. | |||
|I already see-EXPERIENTIAL {Zhang San} RESULTATIVE.|}}</nowiki>}}</div> | |||
Additional style<ref name="CSSnote">See https://www.w3schools.com/html/html_styles.asp, with the caveat that not all html features are available in wikitext, see [[Help:HTML in wikitext]].</ref> parameters can be applied to all gloss abbreviations using {{para|glossing-style}}. The default formatting using small caps can be disabled with {{para|small-caps|no}}, and the default underlining can be turned off using {{para|underline|no}}. To exempt a particular abbreviation from being treated as a grammatical gloss, use {{tl|no gloss}}. | |||
The pesky boxes with glossing messages that are shown in preview mode can be turned off with {{para|display-messages|no}}. | |||
=== <span id="Custom abbreviations">Custom abbreviations</span> === | |||
The template recognises some of the most commonly used abbreviations. However, it is recommended to always specify the meaning of each abbreviation used. There are several ways to do that: | |||
*Defining '''at the article level'''. If an article uses a number of interlinearised examples and they share a set of abbreviations, then these can be defined once for the whole article using the following format: | |||
*<syntaxhighlight lang="html"> | |||
<section begin="list-of-glossing-abbreviations"/><div style="display:none;"> | |||
ABBR1:meaning1 | |||
ABBR2:meaning2</div><section end="list-of-glossing-abbreviations"/> | |||
</syntaxhighlight> | |||
The list can contain any number of abbreviations; if a wikipedia article needs to be specified, it is added after a colon, for example: {{code|NEG:negator:Negation (linguistics)}}. This whole code can be placed anywhere in the article, but it is customary to put it at the end, after the references but before any categories. It is visible only in edit mode, it is not displayed in the article. | |||
*Defining '''at the level of a single instance of the template'''. This is done using {{para|abbreviations}} (or {{para|ablist}}). The list of custom abbreviations takes the same format as above: {{code|ABBREVIATION1:meaning1:wikipedia_article1; ABBREVIATION2:meaning2:wikipedia_article2}}... (specifying a Wikipedia article is optional and has no effect unless {{para|glossing|link}}): | |||
<div style="margin-left:1.5em;"> | |||
{{demo|br=0|<nowiki>{{interlinear|abbreviations=RES:resultative; EXP:experiential aspect | |||
|wǒ yǐjing jiàn-guò {Zhāng Sān} le. | |||
|I already see-EXP {Zhang San} RES.|}}</nowiki>}}</div> | |||
*Defining '''a single instance of an abbreviation'''. This is done using {{tl|gcl}}, as seen [[#gcl|above]] | |||
*Defining an abbreviation '''globally'''. This is done by the addition of an entry to [[Module:Interlinear/data|the module's data page]]. The abbreviation will be recognised by any use of the templates, anywhere on the English wikipedia. This should be done only for completely unambiguous abbreviations. | |||
== Troubleshooting == | |||
This is a list of problems that are likely to be encountered: | |||
* One of the lines went missing. | |||
*:Does this line contain anywhere an equals sign? If yes, then all instances of the equals sign should be replaced with {{tlx|1==}}. | |||
*I've applied bolding/italics to a phrase and now the formatting is all over the place. | |||
*:Any formatting should be applied separately to each word. | |||
* {{anchor|mismatch}} I receive the error "Mismatch in the number of words". | |||
*:Interlinearised lines don't contain the same number of words. If this is intended, then consider filling the empty slots with {{code|{} }}. If this is not intended, then the following points might help track down the cause: | |||
*:*if formatting or a template is applied to a piece of text then this text is treated as a single word: | |||
*:*non-breaking spaces are not treated as word separators; | |||
*:*if a sequence of words is enclosed in {curly brackets} then it's treated as a single word. | |||
* {{anchor|gloss abbr}} I receive the error "Unknown glossing abbreviation(s)". | |||
*:See [[#Glossing abbreviations|above]] for details, but in short: | |||
*:*If this was not intended as a glossing abbreviation, enclose it in {{tl|no gloss}}. | |||
*:*To set the meaning of one instance of a glossing abbreviation, format that instance with {{tl|gcl}}, for example {{tlc|gcl|PF|perfective aspect}}. | |||
*:*If the abbreviation occurs several times within the same example then it might be easier to use the {{para|abbreviations}} parameter, for example: {{para|abbreviations|PF:perfective aspect}}. | |||
==Tracking categories== | |||
*{{clc|Pages using interlinear with unknown parameters}} | |||
*{{clc|Pages with interlinear glosses using two unnamed parameters}} | |||
*{{clc|Pages with interlinear glosses using more than three unnamed parameters}} | |||
*{{clc|Pages with errors in interlinear text}} | |||
*{{clc|Articles with ambiguous glossing abbreviations}} | |||
== Notes == | |||
{{Reflist}} | |||
== See also == | |||
* {{tl|fs interlinear}}, a version of this template which makes it easier to set up glosses with separate lines for a '''f'''oreign-'''s'''cript text and a transliteration | |||
* {{tl|gcl}}, for formatting individual glossing abbreviations | |||
==TemplateData== | |||
{{Format TemplateData|1= | |||
<templatedata> | |||
{ | |||
"params": { | |||
"1": { | |||
"label": "First line of interlinear text", | |||
"type": "string", | |||
"required": true, | |||
"description": "It is italicised by default (unless the parameter \"italics1\" is set to \"no\")." | |||
}, | |||
"2": { | |||
"label": "Second line of interlinear text", | |||
"type": "string", | |||
"suggested": true, | |||
"description": "By default, this is expected to contain the glosses. If there are any glossing abbreviations, they will be expanded (unless the parameter \"glossing2\" is set to \"no\")." | |||
}, | |||
"3": { | |||
"label": "Third line of text", | |||
"type": "string", | |||
"suggested": true, | |||
"description": "If it is the last line, it is assumed to be the translation and so will not be interlinearised. To force the last line to be interlinearised, then add a new, empty, line after it." | |||
}, | |||
"4": { | |||
"label": "Fourth line of text.", | |||
"type": "string" | |||
}, | |||
"5": { | |||
"label": "Fifth line of text", | |||
"type": "string" | |||
}, | |||
"lang": { | |||
"label": "Language of the text", | |||
"description": "ISO 639 code of the language.", | |||
"type": "string" | |||
}, | |||
"indent": { | |||
"description": "Indentation amount, in units of em.", | |||
"type": "number" | |||
}, | |||
"italics1": { | |||
"description": "Whether to italicize |1=", | |||
"type": "boolean", | |||
"label": "Italicize line 1" | |||
}, | |||
"italics2": { | |||
"description": "Whether to italicize |2=", | |||
"type": "boolean", | |||
"label": "Italicize line 2" | |||
}, | |||
"italics3": { | |||
"description": "Whether to italicize |3=", | |||
"type": "boolean", | |||
"label": "Italicize line 3" | |||
}, | |||
"class1": { | |||
"label": "CSS class for |1=", | |||
"type": "string" | |||
}, | |||
"class2": { | |||
"label": "CSS class for |2=", | |||
"type": "string" | |||
}, | |||
"class3": { | |||
"label": "CSS class for |3=", | |||
"type": "string" | |||
}, | |||
"lang1": { | |||
"description": "Language code for |1=", | |||
"type": "string" | |||
}, | |||
"lang2": { | |||
"description": "Language code for |2=", | |||
"type": "string" | |||
}, | |||
"lang3": { | |||
"description": "Language code for |3=", | |||
"type": "string" | |||
}, | |||
"ipa1": { | |||
"description": "Whether |1= is IPA", | |||
"type": "boolean", | |||
"label": "Line 1 is IPA" | |||
}, | |||
"ipa2": { | |||
"description": "Whether |2= is IPA", | |||
"type": "boolean", | |||
"label": "Line 2 is IPA" | |||
}, | |||
"ipa3": { | |||
"description": "Whether |3= is IPA", | |||
"type": "boolean", | |||
"label": "Line 3 is IPA" | |||
}, | |||
"transl1": { | |||
"description": "Whether |1= is transliteration", | |||
"type": "boolean", | |||
"label": "Line 1 is transliteration" | |||
}, | |||
"transl2": { | |||
"description": "Whether |2= is transliteration", | |||
"type": "boolean", | |||
"label": "Line 2 is transliteration" | |||
}, | |||
"transl3": { | |||
"description": "Whether |3= is transliteration", | |||
"type": "boolean", | |||
"label": "Line 3 is transliteration" | |||
}, | |||
"glossing1": { | |||
"description": "Whether |1= is gloss", | |||
"type": "boolean", | |||
"label": "Line 1 is glossing" | |||
}, | |||
"glossing2": { | |||
"description": "Whether |2= is gloss", | |||
"type": "boolean", | |||
"label": "Line 2 is glossing" | |||
}, | |||
"glossing3": { | |||
"description": "Whether |3= is gloss", | |||
"type": "boolean", | |||
"label": "Line 3 is glossing" | |||
}, | |||
"glossing-style": { | |||
"label": "CSS style for glossing abbreviations", | |||
"type": "string" | |||
}, | |||
"top": { | |||
"type": "content", | |||
"label": "Text to place on top" | |||
}, | |||
"bottom": { | |||
"type": "content", | |||
"label": "Text to place on bottom" | |||
}, | |||
"number": { | |||
"type": "string", | |||
"label": "Example number", | |||
"suggestedvalues": [ | |||
"(1)", | |||
"(21a)" | |||
] | |||
}, | |||
"spacing": { | |||
"description": "spacing between consecutive word stacks, set in em", | |||
"default": "1", | |||
"type": "number" | |||
}, | |||
"box": { | |||
"description": "Whether to add a box border", | |||
"type": "boolean" | |||
}, | |||
"c1": { | |||
"label": "Comment after line 1", | |||
"type": "content" | |||
}, | |||
"c2": { | |||
"label": "Comment after line 2", | |||
"type": "content" | |||
}, | |||
"c3": { | |||
"label": "Comment after line 3", | |||
"type": "content" | |||
}, | |||
"tone-superscripting": { | |||
"label": "Tone superscripting", | |||
"description": "Whether to format tone numbers as superscripts on italicized lines", | |||
"type": "boolean" | |||
}, | |||
"glossing": { | |||
"label": "Glossing display behavior", | |||
"description": "Glossing behavior. \"link\" to create links to articles. \"no abbr\" to turn off attempts at translating of abbreviations. These parameters can also apply individually in glossing1/2/3.", | |||
"type": "string", | |||
"suggestedvalues": [ | |||
"link", | |||
"no abbr" | |||
] | |||
}, | |||
"small-caps": { | |||
"label": "Use small capitals for glossing abbreviations", | |||
"type": "boolean", | |||
"default": "yes" | |||
}, | |||
"underline": { | |||
"label": "Underline glossing abbreviations", | |||
"type": "boolean", | |||
"default": "yes" | |||
}, | |||
"display-messages": { | |||
"label": "Display glossing-related messages in preview", | |||
"type": "boolean", | |||
"default": "yes" | |||
}, | |||
"abbreviations": { | |||
"aliases": [ | |||
"ablist" | |||
], | |||
"label": "Custom abbreviations", | |||
"type": "content" | |||
} | |||
}, | |||
"description": "This template formats interlinear glossed text.\nOnly a few of the capabilities of this template are documented here. For all options, see its documentation. Alignment is automatic, so there is no need to add padding either inside or around the template.", | |||
"paramOrder": [ | |||
"1", | |||
"2", | |||
"3", | |||
"4", | |||
"5", | |||
"lang", | |||
"top", | |||
"number", | |||
"indent", | |||
"bottom", | |||
"spacing", | |||
"glossing-style", | |||
"box", | |||
"lang1", | |||
"lang2", | |||
"lang3", | |||
"italics1", | |||
"italics2", | |||
"italics3", | |||
"class1", | |||
"class2", | |||
"class3", | |||
"ipa1", | |||
"ipa2", | |||
"ipa3", | |||
"transl1", | |||
"transl2", | |||
"transl3", | |||
"glossing1", | |||
"glossing2", | |||
"glossing3", | |||
"c1", | |||
"c2", | |||
"c3", | |||
"tone-superscripting", | |||
"glossing", | |||
"small-caps", | |||
"underline", | |||
"display-messages", | |||
"abbreviations" | |||
], | |||
"format": "block" | |||
} | |||
</templatedata> | |||
}} | |||
<includeonly>{{Sandbox other|| | |||
[[Category:Linguistics templates]] | |||
[[Category:Language formatting and function templates]] | |||
[[Category:Layout templates]] | |||
[[Category:Translation templates]] | |||
}}</includeonly> | |||
</noinclude> | </noinclude> |
Latest revision as of 13:17, 5 April 2024
Basic usage
This template formats a linguistic interlinear glossed text:
Template:Red: On lines to be interlinearised, any wiki markup or templates should never span word boundaries. Мarkup or templates that apply to a sequence of words must be repeated for each word: (It is also possible to apply formatting to an entire line, see below)
The characters Template:Code, Template:Code and Template:Code should not be used directly. They can be substituted as follows:
Character | Substitute |
---|---|
< | < |
> | > |
= | {{=}} |
To let a multi-word expression be treated as a single word, surround it in {curly brackets}. Similarly, use Template:Code for an empty word:[1]
The template can be invoked with any number of unnamed parameters, which are interpreted as lines of text. If there is only one unnamed parameter, then it will be rendered in-line and treated as a gloss line: {{interlinear|house-ATTR master-ABS}}
gives: house-ATTR master-ABS. If there are more than one, then all will be interlinearised except the last one, which is assumed to be the free translation. To force the interlinearisation of all lines, supply an empty last unnamed parameter:
Layout
A line of text to be displayed above the interlinear block is given using Template:Para, one to be displayed immediately below the free translation is set using Template:Para. If any of these need to contain more than a singe line, then line breaks can be introduced using Template:Tl. Example numbering can be set using Template:Para. The parameter consists of one or more characters to be displayed in the left margin.
The indentation of the interlinear block (measured in ems) can be modified using Template:Para. Currently, the default value is 3 if Template:Para is set, and 0 otherwise. This behaviour is set to change: the next version of the template will apply indentation by default.
The spacing between consecutive word stacks can be adjusted using Template:Para; it is measured in ems and its default value is 1. To visually set off the interlinear display from surrounding text, the Template:Para parameter can be used. It surrounds the whole interlinear text in a box with a wikitable-like background colour.
To add a comment after a given line, use Template:Para (where N is the sequence of the line: the content of Template:Para will be appended at the end of first line, Template:Para – at the end of the second line etc.):
Line formatting
Formatting can be set for an entire line using the Template:Para parameter, which applies CSS style properties[2] to line N (Template:Para for the first line, Template:Para for the second one, etc):
Similarly, CSS classes[3] can be specified for line N using Template:Para. Classes should be given without any quotation marks.
Italics are by default applied to the first line, unless disabled by Template:Para. Any line can be italicised using Template:Para (where N is the number of the line). On italicised lines, tone numbers[4] will be formatted as superscripts, unless Template:Para is set to Template:Code. To turn off italics for a particular word within an italicised line, use Template:Tl.
To specify the language of a given line, you can use Template:Para (with N being 1 for the first line, 2 for the second one etc.).[5] The parameter should be the ISO code of the language, as in the familiar Template:Lang. If the unnumbered Template:Para is given, then it is applied to the first line. If line N employs IPA, then the effect of Template:IPA can be mimicked by setting Template:Para.[6] If transliteration has been used, then the transliteration scheme can be specified with the Template:Para parameter (similarly to Template:Transl).
Glossing abbreviations
Linguistic glosses typically abbreviate grammatical category labels, like this: Template:Gcl, instead of the full name 'accusative'. The line containing such glosses is specified using Template:Para (where N is the number of the line within the interlinear text). If no line is specified, then it is assumed such glosses are found in the second line (this can be bypassed with Template:Para). Within the lines so specified, any sequence of upper case letters will be interpreted as a grammar gloss and formatted in Template:Small caps.
Additionally, the template will attempt to recognise the meaning of each abbreviation by looking it up in several places (more details below), and if the abbreviation is found, it will be formatted with a dotted underline and the "label" of this abbreviation will be displayed in a tooltip, like this: Template:Gcl. Alternatively, the abbreviation can be turned into a link to the wikipedia article about the corresponding grammatical category, like this: Template:Gcl. To choose the latter behvaiour, use the following parameter: Template:Para. It is possible for separate lines to employ different styles, in this case the parameters used will be Template:Para, Template:Para, etc.
Template:Anchor If a particular glossing abbreviation is to be treated differently from the rest, then Template:Tl can be used:
{{interlinear|ngagun-yi nga-nanda-yi nung
|{{gcl|1sg}}.NOM-{{gcl|ERG||}} {{gcl|1sgA|1st-person singular "agent"}}.3sgO-see-{{gcl|'''P'''ST}} {{gcl|3sg}}.ACC
|'I saw him/her.'}}
In this example, Template:Tlc marks up acc as a glossing abbreviation (it wouldn't have otherwise been interpreted as such because it is lower-case). Template:Tlc is used to define the meaning of the unusual abbreviation 1sgA, which wouldn't be recognised even in upper case. Template:Tlc displays the abbreviation as a link to the Wikipedia article. Template:Tlc applies formatting to a part of a glossing abbreviation; if Template:Tlc weren't used here then the wikimarkup would have forced P to be treated as a separate abbreviation from ST.
If the grammatical category labels are not abbreviated but written out in full (like that: Template:Gcl) then Template:Para should be set to Template:Code, which will only apply small-caps formatting:
Additional style[2] parameters can be applied to all gloss abbreviations using Template:Para. The default formatting using small caps can be disabled with Template:Para, and the default underlining can be turned off using Template:Para. To exempt a particular abbreviation from being treated as a grammatical gloss, use Template:Tl.
The pesky boxes with glossing messages that are shown in preview mode can be turned off with Template:Para.
Custom abbreviations
The template recognises some of the most commonly used abbreviations. However, it is recommended to always specify the meaning of each abbreviation used. There are several ways to do that:
- Defining at the article level. If an article uses a number of interlinearised examples and they share a set of abbreviations, then these can be defined once for the whole article using the following format:
<section begin="list-of-glossing-abbreviations"/><div style="display:none;"> ABBR1:meaning1 ABBR2:meaning2</div><section end="list-of-glossing-abbreviations"/>
The list can contain any number of abbreviations; if a wikipedia article needs to be specified, it is added after a colon, for example: Template:Code. This whole code can be placed anywhere in the article, but it is customary to put it at the end, after the references but before any categories. It is visible only in edit mode, it is not displayed in the article.
- Defining at the level of a single instance of the template. This is done using Template:Para (or Template:Para). The list of custom abbreviations takes the same format as above: Template:Code... (specifying a Wikipedia article is optional and has no effect unless Template:Para):
- Defining a single instance of an abbreviation. This is done using Template:Tl, as seen above
- Defining an abbreviation globally. This is done by the addition of an entry to the module's data page. The abbreviation will be recognised by any use of the templates, anywhere on the English wikipedia. This should be done only for completely unambiguous abbreviations.
Troubleshooting
This is a list of problems that are likely to be encountered:
- One of the lines went missing.
- Does this line contain anywhere an equals sign? If yes, then all instances of the equals sign should be replaced with Template:Tlx.
- I've applied bolding/italics to a phrase and now the formatting is all over the place.
- Any formatting should be applied separately to each word.
- Template:Anchor I receive the error "Mismatch in the number of words".
- Interlinearised lines don't contain the same number of words. If this is intended, then consider filling the empty slots with Template:Code. If this is not intended, then the following points might help track down the cause:
- if formatting or a template is applied to a piece of text then this text is treated as a single word:
- non-breaking spaces are not treated as word separators;
- if a sequence of words is enclosed in {curly brackets} then it's treated as a single word.
- Interlinearised lines don't contain the same number of words. If this is intended, then consider filling the empty slots with Template:Code. If this is not intended, then the following points might help track down the cause:
- Template:Anchor I receive the error "Unknown glossing abbreviation(s)".
- See above for details, but in short:
- If this was not intended as a glossing abbreviation, enclose it in Template:Tl.
- To set the meaning of one instance of a glossing abbreviation, format that instance with Template:Tl, for example Template:Tlc.
- If the abbreviation occurs several times within the same example then it might be easier to use the Template:Para parameter, for example: Template:Para.
- See above for details, but in short:
Tracking categories
Notes
See also
- Template:Tl, a version of this template which makes it easier to set up glosses with separate lines for a foreign-script text and a transliteration
- Template:Tl, for formatting individual glossing abbreviations
TemplateData
- ↑ An alternative in each case is to use a non-breaking space: the example sentence would then be: This is a little example in Dutch.
- ↑ 2.0 2.1 See https://www.w3schools.com/html/html_styles.asp, with the caveat that not all html features are available in wikitext, see Help:HTML in wikitext.
- ↑ See WP:CLASS for a list of available classes. See also Help:User style for setting up customised display of classes.
- ↑ Any single digit following an alphabetical character is treated as a tone number.
- ↑ At this stage, the resulting behaviour does not necessarily match that of the Template:Tl template/s.
- ↑ This only applies the IPA CSS class.