Tipa the \Defaultfontfeatures Command Must Precede
Total Page:16
File Type:pdf, Size:1020Kb
TUGboat, Volume 34 (2013), No. 2 223 Representing linguistic pitch in (X )LE ATEX not be segmented — an alternative will be presented in Section 4. Kevin Donnelly Charis SIL [10] is selected as the main font. This is a Abstract normal text font, like Times, but includes a vast range of glyphs to meet a range of phonetic and orthographic re- Linguists, especially those working with tone languages, quirements. (This article is typeset in Charis SIL instead of may need to depict pitch levels in the language examples the normal TUGboat font in order to enable easier display they use. This article looks at some options in LAT X and E of text being discussed.) X T X for representing pitch and tone. The emphasis is E E \defaultfontfeatures{Mapping=tex-text, on Africanist linguistics, since that is the area with which Scale=MatchLowercase} I am most familiar. \setmainfont{Charis SIL} 1 Introduction The \defaultfontfeatures command must precede the actual font selection, and tells fontspec to use com- For extended linguistic work X TE EX is preferable, since it mon T X aliases (e.g. -- will produce – , and | will pro- uses UTF-8 natively, and allows fonts to be chosen that E duce | instead of —), and to scale all fonts to match the will represent all aspects of the language’s orthography main font’s lower-case size. This ensures that any ad- (whether that is already standardised, or is one of the ditional fonts selected (see next paragraph) will better things that you are working on). However, it is still pos- match the weight of the main font. sible to represent pitch and tone effectively even if you fontspec also allows fonts to be set up for particu- need to use LATEX, though a different set of tools is re- lar purposes. For instance, if we are annotating the syn- quired. Notes for both TEX flavours are given here, and tactic relationships of particular words, and wish to use a sample documents for each are attached — pitch_latex.tex separate font for that, in the preamble we could add and pitch_xetex.tex. Everything has been tested on Ubuntu \newfontfamily{\syntaxfont}{Liberation Sans} 12.04 running TEX Live 2012 (note that older TEX Live ver- \newcommand \syn[1]{{\syntaxfont #1}} sions may not produce the same output). Here, the first line specifies Liberation Sans as thefont 2 Setting up the document for syntax annotations in example glosses, and the second Both sample documents assume that you are writing a line sets up a new command so that book, and additional packages or code to enable pitch \syn{annotation} and tone to be represented are then added. can be used instead of the more cumbersome For LAT X, the package tipa [8] is used, with addi- E {\syntaxfont annotation} tional code to allow pitch marks to be printed without sidebars (this is common for East Asian languages, but For both files, the package expex [2] is optional, not for African languages): but recommended because it offers good typesetting of \makeatletter linguistic examples, and allows word-by-word glossing. \renewcommand\@tonestembar{% \setbox0\hbox{\tipaencoding\char'277}% 3 Tone-marking individual words \hbox{\vrule height \ht0 depth \dp0 The first priority in representing a tone-language isthe width 0pt}} availability of sufficient glyphs (mostly diacritics) for the \makeatother tone-marking. It is worth noting that the readability of Times is set as the default font: diacritics (or even whether they are displayed at all) de- pends crucially on the font — not all are capable of show- \usepackage{mathptmx} ing all diacritics, or placing them in the right location. For X TE EX, the package fontspec [9] is used. Most Diacritics commonly used in representing tone in- (but apparently not all) of the features in tipa are now clude: á à â ǎ ā a̋ ȁ a̍ ꜛa ꜜa ꜝa ꜞa. This list is not exhaus- part of xunicode, so there is no need to activate tipa tive — many other diacritics are available. (doing so produces warnings such as: Command \sups al- Many of these diacritics may already be available ready defined). Unfortunately, without tipa, commands via your keyboard (for instance, on the default UK key- like \textupstep in X TE EX do not work properly (they board in Ubuntu, á is produced using AltGr+; then a; à appear after the letter they refer to rather than before by AltGr+# then a, and â by AltGr+’ then a). If dia- it), so some workaround code is needed — see Section 3. critics are to be used frequently, it is worth setting up a Moreover, the LATEX code above to print pitch marks with- keyboard layout to allow this. out sidebars will not work (thanks to Alan Munn for point- In LATEX, commands can be used to access diacrit- ing this out), since the equivalent glyphs in Unicode can- ics — the Comprehensive LATEX Symbol List [6] and Appen- Representing linguistic pitch in (X )LE ATEX 224 TUGboat, Volume 34 (2013), No. 2 dix A.3 of the TIPA Manual [8] are valuable here. Most of clusions as to how these pitches should be represented in the other diacritics above can be accessed as follows: the tone-marking. ǎ \v{a} The \tone command can be used for this in LATEX: ā \={a} ibuuna [~\tone{11}\, \tone{5555}\, \tone{11}~] \H{a} a̋ Here, the individual pitches are represented by the num- \H*{a} ȁ ber of the tone letter (see A.2.1 of the TIPA Manual [8]) — \textvbaraccent{a}} a̍ five levels are available. Longer pitches can be depicted \textupstep{a} ꜛa by repeating the tone numbers, as in \tone{5555}. Glides \textdownstep{a} ꜛa can be represented by sequences of numbers, and some The exceptions are the superscript exclamation marks ꜝ variation is possible here; as shown in the accompany- and ꜞ (used in African-language linguistics to represent ing file pitch_latex.tex, a rising pitch on the last syllable of upstep and downstep respectively). a variant pre-pausal form of ibuuna can be represented X TE EX offers more scope for defining diacritics, since using any of \tone{13}, \tone{113}, \tone{1133} and UTF-8 allows diacritics to be combined (rather than hav- \tone{133}. ing to depend on precomposed glyphs). This means that The most reliable way of handling spacing between writing a\char"030D will produce a̍, because the num- the pitchmarks is to use \hspace{hdimeni}, giving mea- ber for the UTF-8 combining diacritic for the vertical dia- surements in em, mm or pt. For ease of use, this can be critic is 030D — the relevant numbers for each glyph can set up in a command such as: be found by using a utility like KCharSelect. [3] \newcommand \gap[1]{\hspace{#1mm}} However, since it is difficult to remember these char- so that a gap of 2mm length can then be inserted by using acter numbers, and they are tedious to type, it is best to \gap{2}, and so on. set up commands to produce them. Setting up the follow- In X TE EX, Charis SIL provides five tone letters similar ing commands in the preamble: to those in TIPA, in each of four variants: line or dot with \newcommand \aup[1]{\char"F19E#1} tonestembar on the right or the left (see section 1.4 of \newcommand \adown[1]{\char"F19F#1} Marking Tone [7]). Issuing the command will allow us to get the Africanist up/downstep characters \fontspec[Renderer=Graphite, RawFeature= by using \aup{a} and \adown{a}: ꜝa, ꜞa. {Special=Hide tone contour staves}] {Charis SIL} In those cases where the LATEX tipa commands do not produce the desired results in X TE EX, you can override after \begin{document} will remove the tonestembars on them — this may also be useful if you have an older text glides, but not on level pitches, so these glyphs are inap- which you are converting, where you wish to minimise propriate for African-language linguistics. the number of textual changes that need to be made: However, Charis SIL also provides a set of nine pitch \renewcommand \textupstep[1]{\char"A71B#1} marks (glyphs F1F1–F1F9) specifically aimed at address- \renewcommand \textdownstep[1]{\char"A71C#1} ing this issue (see section 2 of Marking Tone [7]); these allow pitches to be shown inline. To simplify usage, the This allows \textupstep{a} and \textdownstep{a} to glyph numbers can be replaced by a \pitch command: continue to be used to give ꜛa and ꜜa respectively. \newcommand \pitch[1]{\char"F1F#1} The greater flexibility offered by combining diacrit- ics can also be used to produce new diacritics. For in- and ibuuna [ ] can then be produced by writing: stance, adding an acute and then a macron: ibuuna [~\pitch1\gap{1}\pitch9\pitch9 \newcommand \hbend[1]{#1\char"0301\char"0304} \gap{1}\pitch1~] can yield a diacritic to represent the end of a high-tone repeating the glyph number if longer pitches need to be bridge: \hbend{a} gives á.̄ shown. Inserting the command: However, not all combining diacritics may be visible \fontspec[Renderer=Graphite]{Charis SIL} to X TE EX — in Charis SIL, for instance, glyphs in the ranges after \begin{document} will again allow glides to be rep- 07nn, 1Dnn and 20nn do not give the expected output. resented in a variety of ways: [ 엵 ] [ 엵] [ 엵] [ 엵]. 4 Pitch representation for individual words Since these pitch-glyphs are in the Private Use Area Inline pitch representation of individual words has been of the font (in other words, they are not yet official Uni- used in the past in African-language linguistics to draw at- code glyphs) Charis SIL is the only font that they can be tention to the pitch contours of individual words, so that, used with.