Template:Interlinear
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.