Debian Codegraph @

texmf-dist/source/latex/tipauni/tipauni.dtx

raw
1 % \iffalse meta-comment
2 %
3 % File: tipauni.dtx
4 % ---------------------------------------------------------------------------
5 % Package: tipauni
6 % Author: निरंजन
7 % Version: v0.7a (13 February, 2023)
8 % Description: For producing Unicode characters with TIPA commands.
9 % Repository: https://git.gnu.org.ua/tipauni.git
10 % Bug tracker: https://puszcza.gnu.org.ua/bugs/?group=tipauni
11 % License: GPL v3.0+, GFDL v1.3+
12 % ---------------------------------------------------------------------------
13 % LaTeX Package tipauni v0.7a
14 % Copyright © 2021, 2022, 2023 निरंजन
15 %
16 % This program is free software: you can redistribute it and/or modify
17 % it under the terms of the GNU General Public License as published by
18 % the Free Software Foundation, either version 3 of the License, or
19 % (at your option) any later version.
20 %
21 % This program is distributed in the hope that it will be useful,
22 % but WITHOUT ANY WARRANTY; without even the implied warranty of
23 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 % GNU General Public License for more details.
25 %
26 % You should have received a copy of the GNU General Public License
27 % along with this program. If not, see <https://www.gnu.org/licenses/>.
28 %
29 % The current maintainer of this work is निरंजन.
30 %
31 % This work consists of the files tipauni.dtx
32 % tipauni.ins
33 % and the derived file tipauni.sty.
34 % \fi
35 % \iffalse
36 %<*internal>
37 \iffalse
38 %</internal>
39 %<*readme>
40 --------------------------------------------------------------------------
41 Package: tipauni
42 Author: निरंजन
43 Version: v0.7a (13 February, 2023)
44 Description: For producing Unicode characters with TIPA commands.
45 Repository: https://git.gnu.org.ua/tipauni.git
46 Bug tracker: https://puszcza.gnu.org.ua/bugs/?group=tipauni
47 License: GPL v3.0+, GFDL v1.3+
48 --------------------------------------------------------------------------
49 %</readme>
50 %<*internal>
51 \fi
52 %</internal>
53 %<*driver|package>
54 \def\tipauniname{tipauni}
55 \def\tipauniversion{0.7a}
56 \def\tipaunidate{2023-02-13}
57 \def\tipaunidescription{For producing Unicode characters with TIPA commands}
58 %</driver|package>
59 %<*driver>
60 \documentclass{l3doc}
61 \usepackage{gfdl}
62 \usepackage{multicol}
63 \usepackage{graphicx}
64 \usepackage{array}
65 \usepackage{longtable}
66 \usepackage[referable]{threeparttablex}
67 \usepackage{booktabs}
68 \usepackage{float}
69 \usepackage{xcolor}
70 \usepackage{hologo}
71 \DeclareRobustCommand\XeLaTeX{\hologo{XeLaTeX}}
72 \usepackage{fontspec}
73 \newfontfamily{\ipa}[%
74 % Courtesy: https://topanswers.xyz/tex?q=3042#a3083
75 IgnoreFontspecFile,%
76 Color = {blue},%
77 StylisticSet = {5},%
78 Renderer = {Harfbuzz},%
79 ItalicFont = {NewCM10-Italic.otf},%
80 BoldFont = {NewCM10-Bold.otf},%
81 SmallCapsFeatures = {%
82 % Courtesy: https://tex.stackexchange.com/a/107246
83 Numbers = {Lining,Monospaced},%
84 Letters = {SmallCaps}%
85 }%
86 ]{NewCM10-Regular.otf}
87 \newfontfamily{\devtext}[%
88 Script=Devanagari,%
89 Renderer=Harfbuzz,%
90 Scale=0.8%
91 ]{Shobhika}
92 \setmonofont[%
93 IgnoreFontspecFile,%
94 Renderer = {Harfbuzz},%
95 StylisticSet = {5},%
96 ItalicFont = {NewCMMono10-Italic.otf},%
97 BoldFont = {NewCMMono10-Bold.otf}%
98 ]{NewCMMono10-Regular.otf}
99 \usepackage{fontawesome5}
100 \usepackage{hyperxmp}
101 \hypersetup{%
102 unicode,%
103 colorlinks,%
104 urlcolor=blue!60!black,%
105 linkcolor=red!60!black,%
106 citecolor=green!60!black,%
107 pdftitle={The tipauni package},%
108 pdfauthor={निरंजन},%
109 pdfsubject={For producing Unicode characters with TIPA commands.},%
110 pdfcreator={निरंजन},%
111 pdfkeywords={Linguistics, Phonetics, IPA, TIPA, LaTeX}%
112 }%
113 \renewcommand{\arraystretch}{1.2}
114 \gfdlcopyrightholders{%
115 \texorpdfstring
116 {{\devtext निरंजन}}%
117 {निरंजन}%
118 }%
119 \gfdlcopyrightableyears{2021, 2022, 2023}
120 \gfdlcopyrightdescription{%
121 \texorpdfstring
122 {The \LaTeX\ package tipauni}%
123 {The LaTeX package tipauni}%
124 }
125
126 \begin{document}
127 \DocInput{\tipauniname.dtx}
128 \end{document}
129 %</driver>
130 % \fi
131 % \title{The \pkg{\tipauniname} package}
132 % \author{^^A
133 % {\devtext निरंजन}^^A
134 % \thanks{^^A
135 % \faIcon{envelope}\quad
136 % \href{mailto:[email protected]}^^A
137 % {\ttfamily [email protected]}^^A
138 % }^^A
139 % }
140 % \date^^A
141 % {^^A
142 % Version \tipauniversion\ --- \tipaunidate\\[1ex]^^A
143 % {^^A
144 % \small\faIcon{link}\quad
145 % \url{https://ctan.org/pkg/tipauni}^^A
146 % }\\^^A
147 % {^^A
148 % \small\faIcon{bug}\quad
149 % \url{https://puszcza.gnu.org.ua/bugs/?group=tipauni}^^A
150 % }^^A
151 % }^^A
152 % \maketitle
153 %
154 % \tableofcontents
155 %
156 % \clearpage\pagebreak
157 %
158 % \begin{documentation}
159 % \begin{abstract}
160 % This package is the second step for \LaTeX-internally bridging the gap
161 % between the Unicode and the TIPA package. The first step was the package
162 % \href{https://www.ctan.org/pkg/unitipa}{\pkg{unitipa}}. Users can now use
163 % their beloved TIPA shortcuts with the benefits of Unicode i.e.\
164 % searchability, copy-pasting, changing the font and many more. As this
165 % package needs the package \pkg{fontspec} for loading an IPA font, it needs
166 % to be compiled with Lua/\XeLaTeX. This package can also be viewed as an
167 % ASCII-based input method for producing IPA characters in Unicode.
168 % \end{abstract}
169 %
170 % \section{Acknowledgements}
171 %
172 % This package is completed because of the rigorous help by Jairo A.\ del Rio,
173 % Jonathan P.\ Spratte, Phelype Oleinink \textit{\&} Ulrike Fischer. Their
174 % suggestions and contributions are extremely valuable for the development of
175 % this package.
176 %
177 % Jonathan P.\ Spratte has helped the package by building a parser based on
178 % \pkg{expl3}. Phelype Oleinik has helped the package by building a test-suit
179 % for regression-tests. The tests can be seen in the git-repository of the
180 % project.
181 %
182 % Lemures Lemniscati pointed a few bugs in the documentation \& the code.
183 % Their details are as follows.
184 % are as follows:
185 %
186 % \begin{description}
187 % \item[2022-01-03]
188 % A typo '\cs{textsh}' in tipauni.dtx.
189 % \href{https://puszcza.gnu.org.ua/bugs/index.php?538}{(link)}
190 % \item[2022-01-09]
191 % Avoid unconditional loading of CharisSIL.
192 % \href{https://puszcza.gnu.org.ua/bugs/index.php?539}{(link)}
193 % \item[2022-01-09]
194 % Fix typos in Input B of Raised and Lowered.
195 % \href{https://puszcza.gnu.org.ua/bugs/index.php?540}{(link)}
196 % \item[2022-01-09]
197 % \cs{textcorner} should be defined by \cs{DeclareTextSymbol}.
198 % \href{https://puszcza.gnu.org.ua/bugs/index.php?541}{(link)}
199 % \item[2022-01-09]
200 % Fix a typo in Input B of Near-close near-front rounded.
201 % \href{https://puszcza.gnu.org.ua/bugs/index.php?542}{(link)}
202 % \item[2023-02-13]
203 % Changed the default font to New Computer Modern instead of Charis SIL.
204 % \end{description}
205 %
206 % Anja Hasse pointed a bug in the package with an SE question\footnote{%
207 % URL: \url{https://tex.stackexchange.com/q/662466}%
208 % }. It got fixed in v0.6.1 of the package.
209 %
210 % All of these contributions are highly valuable for the development of this
211 % package.
212 %
213 % \section{Package options}
214 %
215 % \begin{function}{documentfont}
216 % \begin{syntax}
217 % documentfont=\meta{font-name}
218 % \end{syntax}
219 %
220 % The default font for the entire document set by this package used to be
221 % \href{https://ctan.org/pkg/charissil}{Charis SIL}. From |v0.7| the package
222 % has changed the default font to \href{https://ctan.org/pkg/newcm}{New
223 % Computer Modern}. The reason for this breaking change is that Charis SIL
224 % was just used because of it's good support for IPA which was absent with
225 % the default Latin Modern shape. New Computer Modern has developed all the
226 % support for IPA \& hence I am making this change. Users can easily change
227 % the default font with the package-option \verb|documentfont| as documented
228 % below.
229 %
230 % \begin{verbatim}
231 % \usepackage[documentfont=DoulosSIL]{tipauni}
232 % \end{verbatim}
233 %
234 % Please note that you must provide a value to this key. If you pass it an
235 % empty value; i.e.,
236 % \enquote{\verb|documentfont=\{\}|}/\enquote{\verb|documentfont=|} or no
237 % value, i.e., \enquote{\verb|documentfont|}, you will be prompted with
238 % errors from package \pkg{tipauni}. If an empty/no-value
239 % \verb|documentfont| is used \& no other non-empty \verb|documentfont| has
240 % been used so far; then the document is typeset with the default
241 % font-family of Lua/\XeLaTeX, i.e., the Latin Modern family. If another
242 % \verb|documentfont| has a non-empty value, the value of that option will
243 % be used as the font of the document.
244 % \end{function}
245 %
246 % \begin{function}{fontspecoptions}
247 % \begin{syntax}
248 % fontspecoptions=\meta{font-options}
249 % \end{syntax}
250 %
251 % This option can be used to set options to the font set with
252 % \verb|documentfont| package option. If the \verb|recommendedfont| option
253 % is used \& has the highest priority; the options set with
254 % \verb|fontspecoptions| will be used with the default font. If the
255 % \verb|preservefont| option has the highest priority, this parameter will
256 % be ineffective \& throw a warning. In the argument of this option write as
257 % if you are writing in the optional parameter of the \cs{setmainfont}
258 % command, e.g.:
259 %
260 % \begin{verbatim}
261 % \usepackage[fontspecoptions={Scale=1.5}]{tipauni}
262 % \end{verbatim}
263 %
264 % \noindent If this options is used with no value it will be ignored with a
265 % warning.
266 %
267 % \noindent E.g.\ Try \verb|\usepackage[fontspecoptions]{tipauni}|.
268 %
269 % \medskip
270 %
271 % \noindent If it is used with an empty value it will reset the fontspec-options so
272 % far you have set, e.g., Try:
273 %
274 % \begin{verbatim}
275 % \usepackage[%
276 % fontspecoptions={Scale=1.5},%
277 % fontspecfontspecoptions={}%
278 % ]{tipauni}
279 % \end{verbatim}
280 % \end{function}
281 %
282 % Please note that the keys so far documented are the only keys which take
283 % values. Other than these the following keys \emph{don't} take any value. You
284 % will be prompted with an error from package \pkg{expkv} if you use values
285 % for the following keys.
286 %
287 % \begin{function}{preservefont}
288 % This option will omit executing the \cs{setmainfont} command with New
289 % Computer Modern. The typeset document will use the default font of
290 % Lua/\XeLaTeX, i.e., the Latin Modern.
291 % \end{function}
292 %
293 % \begin{function}{recommendedfont}
294 % This option is used to override other font definitions made with option
295 % \verb|documentfont|. New Computer Modern will be used as the main font of
296 % the document when this option is used.
297 % \end{function}
298 %
299 % Please note that every option so far mentioned can potentially override each
300 % other, e.g., If a \verb|documentfont| is added after a \verb|preservefont|,
301 % the former will override the latter (\& vice versa). It is true for all
302 % these three package options.
303 %
304 % \begin{function}{resetfontspecoptions}
305 % This option resets all the \pkg{fontspec}-options set with package option
306 % \verb|fontspecoptions|. As noted for the font-options, these two options
307 % which deal with the options of the loaded fonts also can override each
308 % other. The last one loaded will be considered of the highest priority.
309 % \end{function}
310 %
311 % \begin{function}{incompatible}
312 % By default \pkg{\tipauniname} will throw a warning if symbols not
313 % contained in the \pkg{tipa} package were used. Using this option you can
314 % switch this check off if you don't have to stay compatible with
315 % \pkg{tipa} to silence this warning.
316 % \end{function}
317 %
318 % \section{List of available commands}
319 % TIPA has two alternative methods for inputting IPA characters. In the
320 % following tables, \textbf{Input A} column lists all the long TIPA commands
321 % (e.g., \verb|\textrtailt|) \textit{\&} \textbf{Input B} column lists the
322 % short ones (e.g., \verb|\textipa{\:t}|)\footnote{All of these commands must
323 % be enclosed in the \texttt{\textbackslash textipa}
324 % command. (e.g., \texttt{\textbackslash textipa\{\textbackslash :tP\}} for
325 % {\ipa [ʈʔ]})}. This documentation lists down all the commands necessary for
326 % typing symbols in the IPA chart.
327 %
328 % \subsection{Pulmonic consonants}
329 %
330 % \begin{ThreePartTable}
331 % \begin{TableNotes}
332 % \item[\textcolor{red}{§}] These commands are also available without
333 % package \pkg{tipa}.
334 % \item[1] \label{1} A symbol for this sound was introduced in 2005. The
335 % last update of the package \pkg{tipa} was in 2004, so this character
336 % is missing in it. A command for it is provided by this package. Such
337 % \pkg{tipauni}-exclusive commands are written with red color in this
338 % documentation.
339 % \end{TableNotes}
340 % \small
341 % \begin{longtable}{%
342 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
343 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
344 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
345 % >{\ipa[}l<{]}%
346 % }%
347 % \toprule
348 % \endfirsthead
349 % \toprule
350 % \endhead
351 % \bottomrule
352 % \endfoot
353 % Description & Input A & Input B &
354 % \multicolumn{1}{l}{\kern-1.25ex Symbol}\\
355 % \midrule
356 % Retroflex voiceless stop & \verb|\textrtailt| & \verb|\:t| & ʈ \\
357 % Retroflex voiced stop & \verb|\textrtaild| & \verb|\:d| & ɖ \\
358 % Palatal voiced stop & \verb|\textbardotlessj| & \verb|\*j| & ɟ \\
359 % Uvular voiced stop & \verb|\textscg| & \verb|\;G| & ɢ \\
360 % Glottal voiceless stop & \verb|\textglotstop| & \verb|P| & ʔ \\
361 % Labiodental nasal & \verb|\textltailm| & \verb|M| & ɱ \\
362 % Retroflex nasal & \verb|\textrtailn| & \verb|\:n| & ɳ \\
363 % Palatal nasal & \verb|\textltailn| & \verb|\*n| & ɲ \\
364 % Velar nasal & \verb|\ng|\tnote{\textcolor{red}{§}} & \verb|N| & ŋ \\
365 % Uvular nasal & \verb|\textscn| & \verb|\;N| & ɴ \\
366 % Bilabial trill & \verb|\textscb| & \verb|\;B| & ʙ \\
367 % Uvular trill & \verb|\textscr| & \verb|\;R| & ʀ \\
368 % \multicolumn{1}{>{\color{red}}l@{\hspace{0.3cm}-\hspace{0.3cm}}}{Labiodental flap\tnotex{1}} &
369 % \color{red}\verb|\labdentflap| & \color{red}\verb|\*v| & ⱱ\\
370 % Alveolar tap & \verb|\textfishhookr| & \verb|R| & ɾ \\
371 % Retroflex flap & \verb|\textrtailr| & \verb|\:r| & ɽ \\
372 % Bilabial voiceless fricative & \verb|\textphi| & \verb|F| & ɸ \\
373 % Bilabial voiced fricative & \verb|\textbeta| & \verb|B| & β \\
374 % Dental voiceless fricative & \verb|\texttheta| & \verb|T| & θ \\
375 % Dental voiced fricative & \verb|\dh|\tnote{\textcolor{red}{§}} &
376 % \verb|D| & ð \\
377 % Palatal voiceless fricative & \verb|\textesh| & \verb|S| & ʃ \\
378 % Palatal voiced fricative & \verb|\textyogh| & \verb|Z| & ʒ \\
379 % Retroflex voiceless fricative & \verb|\textrtails| & \verb|\:s| & ʂ \\
380 % Retroflex voiceless fricative & \verb|\textrtailz| & \verb|\:z| & ʐ \\
381 % Palatal voiced fricative & \verb|\textctj| & \verb|J| & ʝ \\
382 % Velar voiced fricative & \verb|\textgamma| & \verb|G| & ɣ \\
383 % Uvular voiceless fricative & \verb|\textchi| & \verb|X| & χ \\
384 % Uvular voiced fricative & \verb|\textinvscr| & \verb|K| & ʁ \\
385 % Pharyngeal voiceless fricative & \verb|\textcrh| & \verb|\*h| & ħ \\
386 % Pharyngeal voiced fricative & \verb|\textrevglotstop| & \verb|Q| & ʕ
387 % \\
388 % Glottal voiced fricative & \verb|\texthth| & \verb|H| & ɦ \\
389 % Alveolar voiceless lateral fricative & \verb|\textbeltl| & \verb|\*l|
390 % & ɬ \\
391 % Alveolar voiced lateral fricative & \verb|\textlyoghlig| & \verb|\*z|
392 % & ɮ \\
393 % Labiodental approximant & \color{red}{\verb|\labdentapp|} & \verb|V| &
394 % ʋ \\
395 % Alveolar approximant & \verb|\textturnr| & \verb|\*r| & ɹ \\
396 % Retroflex approximant & \verb|\textturnrrtail| & \verb|\:R| & ɻ \\
397 % Velar approximant & \verb|\textturnmrleg| & \color{red}{\verb|\*m|} &
398 % ɰ \\
399 % Retroflex lateral approximant & \verb|\textrtaill| & \verb|\:l| & ɭ \\
400 % Palatal lateral approximant & \verb|\textturny| & \verb|L| & ʎ \\
401 % Velar lateral approximant & \verb|\textscl| & \verb|\;L| & ʟ \\
402 % \midrule
403 % \insertTableNotes
404 % \end{longtable}
405 % \end{ThreePartTable}
406 %
407 % \subsection{Non-Pulmonic consonants}
408 %
409 % \begin{longtable}{%
410 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
411 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
412 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
413 % >{\ipa[}l<{]}%
414 % }%
415 % \toprule
416 % \endfirsthead
417 % \toprule
418 % \endhead
419 % \bottomrule
420 % \endfoot
421 % Description & Input A & Input B &\multicolumn{1}{l}{Symbol}\\
422 % \midrule
423 % Bilabial click & \verb|\textbullseye| & \verb|\!o| & ʘ \\
424 % Postalveolar click & \color{red}{\verb|\pstalvclick|} &
425 % \color{red}{\verb|!|} & ǃ \\
426 % Palatoalveolar click & \verb|\textdoublebarpipe| &
427 % \color{red}{\verb|\!c|} & ǂ \\
428 % Alveolar lateral click & \verb|\textdoublepipe| & \verb+||+ & ǁ \\
429 % Bilabial implosive & \verb|\texthtb| & \verb|\!b| & ɓ \\
430 % Dental implosive & \verb|\texthtd| & \verb|\!d| & ɗ \\
431 % Palatal implosive & \verb|\texthtbardotlessj| & \verb|\!j| & ʄ \\
432 % Velar implosive & \verb|\texthtg| & \verb|\!g| & ɠ \\
433 % Uvular implosive & \verb|\texthtscg| & \verb|\!G| & ʛ \\
434 % \end{longtable}
435 %
436 % \subsection{Other symbols}
437 % {%
438 % \small
439 % \begin{longtable}{%
440 % >{\footnotesize}l@{\hspace{0.3cm}-\hspace{0.3cm}}%
441 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
442 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
443 % >{\ipa[}l<{]}%
444 % }%
445 % \toprule
446 % \multicolumn{1}{l}{Description} & Input A & Input B
447 % &\multicolumn{1}{l}{Symbol}\\
448 % \midrule
449 % Labial-velar voiceless fricative & \verb|\textturnw| & \verb|\*w| & ʍ
450 % \\
451 % Labial-palatal voiced approximant & \verb|\textturnh| & \verb|4| & ɥ
452 % \\
453 % Epiglottal voiceless fricative & \verb|\textsch| & \verb|\;H| & ʜ \\
454 % Epiglottal voiced fricative/approximant & \verb|\textbarrevglotstop| &
455 % \color{red}{\verb|\*1|} & ʢ \\
456 % Alveolar voiced lateral flap & \verb|\textturnlonglegr| &
457 % \color{red}{\verb|\!r|} & ɺ \\
458 % Epiglottal plosive & \verb|\textbarglotstop| & \verb|\*2| & ʡ \\
459 % Alveolo-palatal voiceless fricative & \verb|\textctc| & \verb|C| & ɕ \\
460 % Alveolo-palatal voiced fricative & \verb|\textctz| &
461 % \color{red}{\verb|\*Z|} & ʑ \\
462 % Postalveolar-velar voiceless fricative & \verb|\texththeng| &
463 % \color{red}{\verb|\*3|} & ɧ \\
464 % \bottomrule
465 % \end{longtable}
466 % }
467 %
468 % \subsection{Vowels}
469 % {%
470 % \small
471 % \begin{longtable}{%
472 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
473 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
474 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
475 % >{\ipa[}l<{]}%
476 % }%
477 % \toprule
478 % \endfirsthead
479 % \toprule
480 % \endhead
481 % \bottomrule
482 % \endfoot
483 % Description & Input A & Input B &\multicolumn{1}{l}{Symbol}\\
484 % \midrule
485 % Near-close near-front unrounded & \verb|\textsci| & \verb|I| & ɪ \\
486 % Near-close near-front rounded & \verb|\textscy| & \verb|Y| & ʏ \\
487 % Open-mid front unrounded & \verb|\textepsilon| & \verb|E| & ɛ \\
488 % Close central unrounded & \verb|\textbari| & \verb|1| & ɨ \\
489 % Close central rounded & \verb|\textbaru| & \verb|0| & ʉ \\
490 % Near-close near-back rounded & \verb|\textupsilon| & \verb|U| & ʊ \\
491 % Close-mid central unrounded & \verb|\textreve| & \verb|9| & ɘ \\
492 % Close-mid central rounded & \verb|\textbaro| & \verb|8| & ɵ \\
493 % Mid central vowel & \verb|\textschwa| & \verb|@| & ə \\
494 % Open-mid central unrounded & \verb|\textrevepsilon| & \verb|3| & ɜ \\
495 % Open-mid central rounded & \verb|\textcloserevepsilon| &
496 % \textcolor{red}{\texttt{\&}} & ɞ \\
497 % Near-open central & \verb|\textturna| & \verb|5| & ɐ \\
498 % Close back unrounded & \verb|\textturnm| & \verb|W| & ɯ \\
499 % Close-mid back unrounded & \verb|\textramshorns| & \verb|7| & ɤ \\
500 % Open-mid back unrounded & \verb|\textturnv| & \verb|2| & ʌ \\
501 % Open-mid back rounded & \verb|\textopeno| & \verb|O| & ɔ \\
502 % Open back unrounded & \verb|\textscripta| & \verb|A| & ɑ \\
503 % Open back rounded & \verb|\textturnscripta| & \verb|6| & ɒ \\
504 % \end{longtable}
505 % }%
506 %
507 % \subsection{Independent diacritics}
508 %
509 % \begin{longtable}{%
510 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
511 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
512 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
513 % >{\ipa[}l<{]}%
514 % }%
515 % \toprule
516 % Description & Input A & Input B & \multicolumn{1}{l}{Symbol}\\
517 % \midrule
518 % Rhoticity & \verb|ə\textrhoticity|\tnotex{1} & \color{red}{\verb|ə\tr|}
519 % & ə˞\\
520 % No audible release & \verb|n\textcorner| & \color{red}{\verb|n\tc|} & n̚\,
521 % \\
522 % Tie bar (standalone) & \color{red}{\verb|\stdlnetiebar{əi}|} &
523 % \color{red}{\verb|\ts{əi}|} & ə‿i \\
524 % \bottomrule
525 % \end{longtable}
526 %
527 % \subsection{Dependent diacritics}
528 %
529 % \begin{TableNotes}
530 % \item[1] The documentation of package the \pkg{tipa} on p.\ 53
531 % describes a shorthand command
532 % i.e.~\texttt{\textbackslash\textbar\~{}{\meta{arg}}} which is not
533 % functional. I haven't investigated the reasons, but instead provided a new
534 % shorthand command for this character.
535 % \end{TableNotes}
536 %
537 % \begin{ThreePartTable}
538 % {%
539 % \small
540 % \begin{longtable}{%
541 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
542 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
543 % l@{\hspace{0.3cm}-\hspace{0.3cm}}%
544 % >{\ipa[}l<{]}%
545 % }%
546 % \toprule
547 % \endfirsthead
548 % \toprule
549 % \endhead
550 % \bottomrule
551 % \endfoot
552 % Description & Input A & Input B & \multicolumn{1}{l}{Symbol}\\
553 % \midrule
554 % Voiceless & \verb|\textsubring{m}| & \verb|\r*m| & m̥\\
555 % Voiced & \verb|\textsubwedge{s}| & \verb|\v*s| & s̬\\
556 % More rounded & \verb|\textsubrhalfring{w}| & \verb+\|)w+ & w̹\\
557 % Less rounded & \verb|\textsublhalfring{w}| & \verb+\|(w+ & w̜\\
558 % Advanced & \verb|\textsubplus{ə}| & \verb-\|+e- & ə̟\\
559 % Retracted & \verb|\textsubbar{l}| & \verb+\=*l+ & l̠\\
560 % Mid-centralized & \verb|\textovercross{e}| & \verb+\|x{e}+ & e̽\\
561 % Syllabic & \verb|\textsyllabic{n}| & \verb|\s{n}| & n̩\\
562 % Non-syllabic & \verb|\textsubarch{a}| & \color{red}{\verb|\ns{a}|} & a̯
563 % \\
564 % Breathy voiced & \verb|\textsubumlaut{b}| & \verb|\"*b| & b̤ \\
565 % Creaky voiced & \verb|\textsubtilde{ə}| & \verb|\~*@| & ə̰ \\
566 % Linguolabial & \verb|\textseagull{l}| & \verb+\|ml+ & l̼ \\
567 % Velarized & \verb|\textsuperimposetilde{i}| & \verb+\vl{i}+\tnote{1} & i̴
568 % \\
569 % Raised & \verb|\textraising{ə}| & \verb+\|'@+ & ə̝ \\
570 % Lowered & \verb|\textlowering{ə}| & \verb+\|`@+ & ə̞ \\
571 % Advanced tongue root & \verb|\textadvancing{ə}| & \verb+\|<@+ & ə̘ \\
572 % Retracted tongue root & \verb|\textretracting{ə}| & \verb+\|>@+ & ə̙ \\
573 % Dental & \verb|\textsubbridge{t}| & \verb+\|[t+ & t̪ \\
574 % Apical & \verb|\textinvsubbridge{t}| & \verb+\|]t+ & t̺ \\
575 % Laminal & \verb|\textsubsquare{s}| & \color{red}{\verb|\lmn{s}|} & s̻ \\
576 % Tie bar (top) & \verb|\texttoptiebar{əi}| & \verb|\t{əi}| & ə͡i\\
577 % Tie bar (bottom) & \verb|\textbottomtiebar{əi}| & \verb|\t*{əi}| & ə͜i\\
578 % \midrule
579 % \insertTableNotes
580 % \end{longtable}
581 % }%
582 % \end{ThreePartTable}
583 % \end{documentation}
584 %
585 % \begin{implementation}
586 % \section{Implementation}
587 % \begin{macrocode}
588 %<@@=tipauni>
589 %<*package>
590 % \end{macrocode}
591 % Provide the package with some description \textit{\&} version specifications.
592 % \begin{macrocode}
593 \ProvidesPackage{tipauni}[2023/02/13 v0.7a
594 Unicode characters with TIPA commands]
595 % \end{macrocode}
596 % Load necessary packages.
597 % \begin{macrocode}
598 \RequirePackage{xparse}
599 \RequirePackage{fontspec}
600 \RequirePackage{expkv-def,expkv-opt}
601 % \end{macrocode}
602 % Package options are provided using the package \pkg{expkv}.
603 % \begin{macrocode}
604 \newif\iftipauni@document@font
605 \def\tipauni@bookorregular{regular}
606 \def\tipauni@recommended@font{tipauni-newcm-\tipauni@bookorregular}
607 \tipauni@document@fonttrue
608 \let\tipauni@font@options\@empty
609 \ekvdefinekeys{tipauni}{%
610 bool incompatible = \iftipauni@nontipa@ignore,%
611 noval preservefont = {%
612 \let\tipauni@font\tipauni@undefined
613 \tipauni@document@fontfalse
614 },%
615 estore fontspecoptions = \tipauni@font@options,%
616 new noval fontspecoptions = {%
617 \PackageWarningNoLine{tipauni}{%
618 As you haven't given any value to package option\MessageBreak
619 `fontspecoptions'; it will be ignored. Please\MessageBreak
620 provide a valid (list of) fontspec option(s)%
621 }%
622 },%
623 noval resetfontspecoptions = {%
624 \let\tipauni@font@options\@empty
625 },%
626 noval documentfont = {%
627 \PackageError{tipauni}{No value for the `documentfont' option}{%
628 The `documentfont' option has no value. Please provide a valid
629 font-name,\MessageBreak otherwise it will be ignored or
630 (if given) the value of another non-empty\MessageBreak
631 `documentfont' will be used.%
632 }%
633 \ifdefined\tipauni@font
634 \tipauni@document@fonttrue
635 \else
636 \tipauni@document@fontfalse
637 \fi
638 },%
639 new code documentfont = {%
640 \edef\tipauni@temp{#1}%
641 \ifx\tipauni@temp\@empty
642 \PackageError{tipauni}{Empty `documentfont' option}{%
643 The `documentfont' option has an empty value. Please provide a valid%
644 \MessageBreak
645 font-name, otherwise it will be ignored or (if given) the value of%
646 \MessageBreak
647 another non-empty `documentfont' will be used.%
648 }%
649 \ifdefined\tipauni@font
650 \tipauni@document@fonttrue
651 \else
652 \tipauni@document@fontfalse
653 \fi
654 \else
655 \tipauni@document@fonttrue
656 \let\tipauni@font\tipauni@temp
657 \fi
658 },%
659 noval recommendedfont = {%
660 \tipauni@document@fonttrue
661 \let\tipauni@font\tipauni@recommended@font
662 },%
663 noval newcmbook = {%
664 \def\tipauni@bookorregular{book}%
665 }%
666 }
667 \ekvoProcessLocalOptions{tipauni}
668 % \end{macrocode}
669 % The following code executes the \verb|\setmainfont| command \& issues a
670 % warning in a special case.
671 % \begin{macrocode}
672 \iftipauni@document@font
673 \ifdefined\tipauni@font
674 \else
675 \let\tipauni@font\tipauni@recommended@font
676 \fi
677 \expandafter\setmainfont\expandafter
678 [\expandafter{\tipauni@font@options}]{\tipauni@font}
679 \else
680 \ifx\tipauni@font@options\@empty
681 \else
682 \PackageWarningNoLine{tipauni}{%
683 An active font loaded with package fontspec is\MessageBreak
684 necessary for `fontspecoptions' to take effect.\MessageBreak
685 Please use the `documentfont'/`recommendedfont'\MessageBreak
686 option or load a font outside package `tipauni'\MessageBreak
687 to make your options active. Currently ignoring:\MessageBreak
688 [\tipauni@font@options]%
689 }%
690 \fi
691 \fi
692 % \end{macrocode}
693 % The following commands were kindly suggested by Phelype Oleinik for developing
694 % a conditional which is always global.
695 % \begin{macrocode}
696 \newif\ifnontipa
697 \protected\def\nontipatrue{\global\let\ifnontipa\iftrue}
698 \protected\def\nontipafalse{\global\let\ifnontipa\iffalse}
699 \iftipauni@nontipa@ignore
700 \protected\def\nontipatrue{}
701 \fi
702 % \end{macrocode}
703 % The following commands provide the command \verb|\tipaunicmd| for printing
704 % characters that are missing in the \pkg{tipa} package.
705 % \begin{macrocode}
706 \NewDocumentCommand\tipaunicmd{ m m }{%
707 \NewDocumentCommand#1{ }{\nontipatrue #2}%
708 }%
709 % \end{macrocode}
710 % As can be seen above, everytime when a command that is absent in the
711 % \pkg{tipa} package is provided, it sets the conditional \verb|nontipa| to true
712 % value. At the end of the document this package checks if there is any instance
713 % of a non-TIPA command. If yes, it generates a warning in the .log file saying
714 % that this code is now incompatible with the TIPA package and some characters
715 % might be displayed with a different font. All of this is achieved with the
716 % help of following commands. The discussion on
717 % \href{https://topanswers.xyz/tex?q=1735}{this} question helped a lot for fine
718 % tuning the warning message.
719 % \begin{macrocode}
720 \AtEndDocument{%
721 \ifnontipa
722 \PackageWarningNoLine{tipauni}{%
723 You have used a command(s) that is (are) not\MessageBreak
724 supported by package TIPA. Thus your current code is\MessageBreak
725 incompatible with that package. These commands are\MessageBreak
726 printed with a different Unicode font. Refer to the\MessageBreak
727 documentation of package tipauni for a list of\MessageBreak
728 commands that are not supported in TIPA%
729 }%
730 \else
731 \fi
732 }%
733 % \end{macrocode}
734 % From here the code for obtaining Unicode characters with TIPA commands
735 % starts.
736 % \begin{macrocode}
737 \DeclareTextCommand{\tipaunistar}{TU}[1]{{#1}}
738 \DeclareTextAccentDefault{\tipaunistar}{TU}
739 \DeclareTextCommand{\tipaunisemicolon}{TU}[1]{{#1}}
740 \DeclareTextAccentDefault{\tipaunisemicolon}{TU}
741 \DeclareTextCommand{\tipaunicolon}{TU}[1]{{#1}}
742 \DeclareTextAccentDefault{\tipaunicolon}{TU}
743 \DeclareTextCommand{\tipaunibang}{TU}[1]{{#1}}
744 \DeclareTextAccentDefault{\tipaunibang}{TU}
745 \DeclareTextCommand{\tipaunipipe}{TU}[2]{\@pipeshorthands{#1}{#2}}
746 \DeclareTextAccentDefault{\tipaunipipe}{TU}
747 %% Pulmonic consonants
748 %%-- Stops
749 %%--** Retroflex
750 \DeclareTextSymbol{\textrtailt}{TU}{"0288}%% ʈ
751 \DeclareTextComposite{\tipaunicolon}{TU}{t}{"288}
752 \DeclareTextSymbol{\textrtaild}{TU}{"0256}%% ɖ
753 \DeclareTextComposite{\tipaunicolon}{TU}{d}{"256}
754 %%--** Palatal
755 \DeclareTextSymbol{\textbardotlessj}{TU}{"25F}%% ɟ
756 \DeclareTextComposite{\tipaunistar}{TU}{j}{"25F}
757 %%--** Uvular
758 \DeclareTextSymbol{\textscg}{TU}{"262}%% ɢ
759 \DeclareTextComposite{\tipaunisemicolon}{TU}{G}{"262}
760 %%--** Glottal
761 \DeclareTextSymbol{\textglotstop}{TU}{"294}%% ʔ
762 %%-- Nasals
763 %%--** Labiodental
764 \DeclareTextSymbol{\textltailm}{TU}{"271}%% ɱ
765 %%--** Retroflex
766 \DeclareTextSymbol{\textrtailn}{TU}{"273}%% ɳ
767 \DeclareTextComposite{\tipaunicolon}{TU}{n}{"273}
768 %%--** Palatal
769 \DeclareTextSymbol{\textltailn}{TU}{"272}%% ɲ
770 \DeclareTextComposite{\tipaunistar}{TU}{n}{"272}
771 %%--** Uvular
772 \DeclareTextSymbol{\textscn}{TU}{"274}%% ɴ
773 \DeclareTextComposite{\tipaunisemicolon}{TU}{N}{"274}
774 %%-- Affricates
775 \DeclareTextSymbol{\textdzlig}{TU}{"02A3}%% ʣ
776 \DeclareTextSymbol{\textdyoghlig}{TU}{"02A4}%% ʤ
777 \DeclareTextSymbol{\texttslig}{TU}{"02A6}%% ʦ
778 \DeclareTextSymbol{\textteshlig}{TU}{"02A7}%% ʧ
779 \DeclareTextSymbol{\textdblig}{TU}{"02A4}%% ȸ
780 \DeclareTextSymbol{\textqplig}{TU}{"00239}%% ȹ
781 \DeclareTextSymbol{\texthvlig}{TU}{"0195}%% ƕ
782 \DeclareTextSymbol{\texttctclig}{TU}{"02A8}%% ʨ
783 %%-- Trills
784 %%--** Bilabial
785 \DeclareTextSymbol{\textscb}{TU}{"299}%% ʙ
786 \DeclareTextComposite{\tipaunisemicolon}{TU}{B}{"299}
787 %%--** Uvular
788 \DeclareTextSymbol{\textscr}{TU}{"280}%% ʀ
789 \DeclareTextComposite{\tipaunisemicolon}{TU}{R}{"280}
790 %%-- Taps or flaps
791 %%-- Labiodental flap
792 \tipaunicmd{\labdentflap}{ⱱ}%% tipauni-exclusive
793 \DeclareTextComposite{\tipaunistar}{TU}{v}{"2C71}%% tipauni-exclusive
794 %%--** Alveolar
795 \DeclareTextSymbol{\textfishhookr}{TU}{"27E}%% ɾ
796 %%--** Retroflex
797 \DeclareTextSymbol{\textrtailr}{TU}{"27D}%% ɽ
798 \DeclareTextComposite{\tipaunicolon}{TU}{r}{"27D}
799 %%-- Fricatives
800 %%--** Bilabial
801 \DeclareTextSymbol{\textphi}{TU}{"278}%% ɸ
802 \DeclareTextSymbol{\textbeta}{TU}{"3B2}%% β
803 %%--** Dental
804 \DeclareTextSymbol{\texttheta}{TU}{"3B8}%% θ
805 %%--** Postalveolar
806 \DeclareTextSymbol{\textesh}{TU}{"283}%% ʃ
807 \DeclareTextSymbol{\textyogh}{TU}{"292}%% ʒ
808 %%--** Retroflex
809 \DeclareTextSymbol{\textrtails}{TU}{"282}%% ʂ
810 \DeclareTextComposite{\tipaunicolon}{TU}{s}{"282}
811 \DeclareTextSymbol{\textrtailz}{TU}{"290}%% ʐ
812 \DeclareTextComposite{\tipaunicolon}{TU}{z}{"290}
813 %%--** Palatal
814 \DeclareTextSymbol{\textctj}{TU}{"29D}%% ʝ
815 %%--** Velar
816 \DeclareTextSymbol{\textgamma}{TU}{"263}%% ɣ
817 %%--** Uvular
818 \DeclareTextSymbol{\textchi}{TU}{"3C7}%% χ
819 \DeclareTextSymbol{\textinvscr}{TU}{"281}%% ʁ
820 %%--** Pharyngeal
821 \DeclareTextSymbol{\textcrh}{TU}{"127}%% ħ
822 \DeclareTextComposite{\tipaunistar}{TU}{h}{"127}
823 \DeclareTextSymbol{\textrevglotstop}{TU}{"295}%% ʕ
824 %%--** Glottal
825 \DeclareTextSymbol{\texthth}{TU}{"266}%% ɦ
826 %%-- Lateral fricatives
827 %%--** Alveolar
828 \DeclareTextSymbol{\textbeltl}{TU}{"26C}%% ɬ
829 \DeclareTextComposite{\tipaunistar}{TU}{l}{"26C}
830 \DeclareTextSymbol{\textlyoghlig}{TU}{"26E}%% ɮ
831 \DeclareTextComposite{\tipaunistar}{TU}{z}{"26E}
832 %%-- Approximants
833 %%-- Labiodental approximant
834 \tipaunicmd{\labdentapp}{ʋ}%% tipauni-exclusive
835 %%--** Alveolar
836 \DeclareTextSymbol{\textturnr}{TU}{"279}%% ɹ
837 \DeclareTextComposite{\tipaunistar}{TU}{r}{"279}
838 %%--** Retroflex
839 \DeclareTextSymbol{\textturnrrtail}{TU}{"27B}%% ɻ
840 \DeclareTextComposite{\tipaunicolon}{TU}{R}{"27B}
841 %%--** Velar
842 \DeclareTextSymbol{\textturnmrleg}{TU}{"270}%% ɰ
843 \DeclareTextComposite{\tipaunistar}{TU}{m}{"270}
844 %%-- Lateral approximants
845 %%--** Retroflex
846 \DeclareTextSymbol{\textrtaill}{TU}{"26D}%% ɭ
847 \DeclareTextComposite{\tipaunicolon}{TU}{l}{"26D}
848 \DeclareTextSymbol{\textturny}{TU}{"28E}%% ʎ
849 \DeclareTextSymbol{\textscl}{TU}{"29F}%% ʟ
850 \DeclareTextComposite{\tipaunisemicolon}{TU}{L}{"29F}
851 %% Non-pulmonic consonants
852 %%-- Clicks
853 %%--** Bilabial
854 \DeclareTextSymbol{\textbullseye}{TU}{"298}%% ʘ
855 \DeclareTextComposite{\tipaunibang}{TU}{o}{"298}
856 %%-- Postalveolar click
857 \tipaunicmd{\pstalvclick}{ǃ}%% tipauni-exclusive
858 %%--** Palato-alveolar
859 \DeclareTextSymbol{\textdoublebarpipe}{TU}{"1C2}%% ǂ
860 \DeclareTextComposite{\tipaunibang}{TU}{c}{"1C2}%% tipauni-exclusive
861 %%--** Alveolar lateral
862 \DeclareTextSymbol{\textdoublepipe}{TU}{"1C1}% ǁ
863 %%-- Implosives
864 %%--** Bilabial
865 \DeclareTextSymbol{\texthtb}{TU}{"253}%% ɓ
866 \DeclareTextComposite{\tipaunibang}{TU}{b}{"253}
867 %%--** Dental
868 \DeclareTextSymbol{\texthtd}{TU}{"257}%% ɗ
869 \DeclareTextComposite{\tipaunibang}{TU}{d}{"257}
870 %%--** Palatal
871 \DeclareTextSymbol{\texthtbardotlessj}{TU}{"284}%% ʄ
872 \DeclareTextComposite{\tipaunibang}{TU}{j}{"284}
873 %%--** Velar
874 \DeclareTextSymbol{\texthtg}{TU}{"260}%% ɠ
875 \DeclareTextComposite{\tipaunibang}{TU}{g}{"260}
876 %%--** Uvular
877 \DeclareTextSymbol{\texthtscg}{TU}{"29B}%% ʛ
878 \DeclareTextComposite{\tipaunibang}{TU}{G}{"29B}
879 %% Other consonants
880 \DeclareTextSymbol{\textturnw}{TU}{"28D}%% ʍ
881 \DeclareTextSymbol{\textturnh}{TU}{"265}%% ɥ
882 \DeclareTextSymbol{\textsch}{TU}{"29C}%% ʜ
883 \DeclareTextSymbol{\textbarrevglotstop}{TU}{"2A2}%% ʢ
884 \DeclareTextComposite{\tipaunistar}{TU}{1}{"2A2}%% tipauni-exclusive
885 \DeclareTextSymbol{\textbarglotstop}{TU}{"2A1}%% ʡ
886 \DeclareTextComposite{\tipaunistar}{TU}{2}{"2A1}%% tipauni-exclusive
887 \DeclareTextSymbol{\textctc}{TU}{"255}%% ɕ
888 \DeclareTextSymbol{\textctz}{TU}{"291}%% ʑ
889 \DeclareTextComposite{\tipaunistar}{TU}{Z}{"291}%% tipauni-exclusive
890 \DeclareTextSymbol{\textturnlonglegr}{TU}{"27A}%% ɺ
891 \DeclareTextComposite{\tipaunibang}{TU}{r}{"27A}%% tipauni-exclusive
892 \DeclareTextSymbol{\texththeng}{TU}{"267}%% ɧ
893 \DeclareTextComposite{\tipaunistar}{TU}{3}{"267}%% tipauni-exclusive
894 \DeclareTextComposite{\tipaunistar}{TU}{k}{"029E}% ʞ
895 \DeclareTextComposite{\tipaunistar}{TU}{t}{"287}% ʇ
896 \DeclareTextComposite{\tipaunistar}{TU}{w}{"28D}% ʍ
897 \DeclareTextComposite{\tipaunisemicolon}{TU}{E}{"1D07}% ᴇ
898 \DeclareTextComposite{\tipaunisemicolon}{TU}{J}{"1D0A}% ᴊ
899 \DeclareTextComposite{\tipaunisemicolon}{TU}{A}{"1D00}% ᴀ
900 \DeclareTextComposite{\tipaunisemicolon}{TU}{H}{"29C}% ʜ
901 \DeclareTextComposite{\tipaunisemicolon}{TU}{U}{"1D1C}% ᴜ
902 %% Vowels
903 \DeclareTextSymbol{\textsci}{TU}{"26A}%% ɪ
904 \DeclareTextSymbol{\textscy}{TU}{"28F}%% ʏ
905 \DeclareTextSymbol{\textepsilon}{TU}{"25B}%% ɛ
906 \DeclareTextSymbol{\textbari}{TU}{"268}%% ɨ
907 \DeclareTextSymbol{\textbaru}{TU}{"289}%% ʉ
908 \DeclareTextSymbol{\textupsilon}{TU}{"28A}%% ʊ
909 \DeclareTextSymbol{\textreve}{TU}{"258}%% ɘ
910 \DeclareTextSymbol{\textbaro}{TU}{"275}%% ɵ
911 \DeclareTextSymbol{\textschwa}{TU}{"259}%% ə
912 \DeclareTextSymbol{\textrevepsilon}{TU}{"25C}%% ɜ
913 \DeclareTextSymbol{\textcloserevepsilon}{TU}{"25E}%% ɞ
914 \DeclareTextSymbol{\textturna}{TU}{"250}%% ɐ
915 \DeclareTextSymbol{\textturnm}{TU}{"26F}%% ɯ
916 \DeclareTextSymbol{\textramshorns}{TU}{"264}%% ɤ
917 \DeclareTextSymbol{\textturnv}{TU}{"28C}%% ʌ
918 \DeclareTextSymbol{\textopeno}{TU}{"254}%% ɔ
919 \DeclareTextSymbol{\textscripta}{TU}{"251}%% ɑ
920 \DeclareTextSymbol{\textturnscripta}{TU}{"252}%% ɒ
921 %% Independent diacritic marks
922 %%-- Rhoticity
923 \DeclareTextSymbol{\textrhoticity}{TU}{"2DE}%% ˞
924 \tipaunicmd{\tr}{˞}
925 %%-- Tie bar (below)
926 \DeclareTextCommand{\tipaunitextbottomtiebar}{TU}[2]{#1\symbol{"035C}#2}
927 \NewDocumentCommand\textbottomtiebar{ m }{\tipaunitextbottomtiebar#1}
928 %%-- Tie bar (below) - standalone character
929 \DeclareTextCommand{\tipaunits}{TU}[2]{#1\symbol{"203F}#2}
930 \NewDocumentCommand\stdlnetiebar{ m }{\tipaunits#1}
931 \NewDocumentCommand\ts{ m }{\tipaunits#1}
932 % \end{macrocode}
933 % The following commands redefine the TIPA shorthand input for dependent
934 % diacritics.
935 % \begin{macrocode}
936 %% No audible release
937 \DeclareTextSymbol{\textcorner}{TU}{"31A}%% ̚
938 \tipaunicmd{\tc}{̚}
939 %% Syllabic
940 \DeclareUnicodeAccent{\textsyllabic}{TU}{"0329}%% ̩
941 \NewDocumentCommand\s{ m }{\textsyllabic{\textipa{#1}}\nontipatrue}
942 %% Non-syllabic
943 \DeclareUnicodeAccent{\textsubarch}{TU}{"032F}%% ̯
944 \NewDocumentCommand\ns{ m }{\textsubarch{\textipa{#1}}}
945 %% Laminal
946 \DeclareUnicodeAccent{\textsubsquare}{TU}{"033B}%% ̻
947 \NewDocumentCommand\lmn{ m }{\textsubsquare{\textipa{#1}}\nontipatrue}
948 %% Other complex shorthand commands
949 \DeclareTextCommand{\@pipeshorthands}{TU}[2]{%
950 \if #1[\tipaunisubbridge{\textipa{#2}}\else
951 \if #1]\tipauniinvsubbridge{\textipa{#2}}\else
952 \if #1(\tipaunisublhalfring{\textipa{#2}}\else
953 \if #1)\tipaunisubrhalfring{\textipa{#2}}\else
954 \if #1+\tipaunisubplus{\textipa{#2}}\else
955 \if #1'\tipauniraising{\textipa{#2}}\else
956 \if #1`\tipaunilowering{\textipa{#2}}\else
957 \if #1<\tipauniadvancing{\textipa{#2}}\else
958 \if #1>\tipauniretracting{\textipa{#2}}\else
959 \if #1x\tipauniovercross{\textipa{#2}}\else
960 \if #1m\tipauniseagull{\textipa{#2}}\else #1#2%
961 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
962 }%
963 \DeclareTextAccentDefault{\@pipeshorthands}{TU}
964 \ExplSyntaxOn
965 \NewDocumentCommand \super { m }
966 {%
967 \str_case:nn {#1}
968 {
969 {h} {ʰ}
970 {w} {ʷ}
971 {j} {ʲ}
972 {ɣ} {ˠ}
973 {ʕ} {ˤ}
974 {n} {ⁿ}
975 {l} {ˡ}
976 }
977 }
978 % \end{macrocode}
979 % We need a few variables.
980 % \begin{macrocode}
981 \seq_new:N \l_@@_remove_from_accents_seq
982 \tl_new:N \l_@@_textipa_tl
983 % \end{macrocode}
984 % Since we have a non-standard syntax for some of the accent macros (having a
985 % starred variant) we have to exclude them from the list of accents which get
986 % special handling from \cs{text_expand:n} or else the stars will be surrounded
987 % by braces and not found by \cs{@ifstar}. This sequence stores the problematic
988 % accents which need to be excluded.
989 % \begin{macrocode}
990 \seq_set_split:Nnn \l_@@_remove_from_accents_seq { , }
991 { \~, \=, \", \r, \v, \t }
992 % \end{macrocode}
993 % We only search for the macros not contained in \pkg{tipa} if this is requested
994 % by the user.
995 % \begin{macrocode}
996 \iftipauni@nontipa@ignore
997 \cs_new_eq:NN \@@_nontipa_search: \prg_do_nothing:
998 \cs_new_eq:NN \@@_nontipa_search:n \use_none:n
999 \else
1000 \cs_new_protected:Npn \@@_nontipa_search:
1001 {
1002 \unless\ifnontipa
1003 \exp_args:No \@@_nontipa_search:n \l_@@_textipa_tl
1004 \fi
1005 }
1006 % \end{macrocode}
1007 % The warning thrown at the end of the run doesn't list which symbols were
1008 % incompatible, so we stop searching when we found one incompatible symbol. We
1009 % use \cs{str_if_in:nnT} so that groups don't affect the search. The alternative
1010 % would be the much slower \cs{regex_match:nnT}.
1011 % \begin{macrocode}
1012 \cs_new_protected:Npn \@@_nontipa_search:n #1
1013 {
1014 \str_if_in:nnT {#1} {ⱱ} { \nontipatrue \use_none_delimit_by_s_stop:w }
1015 \str_if_in:nnT {#1} {ɞ} { \nontipatrue \use_none_delimit_by_s_stop:w }
1016 \str_if_in:nnT {#1} {ɰ} { \nontipatrue \use_none_delimit_by_s_stop:w }
1017 \str_if_in:nnT {#1} {ǃ} { \nontipatrue \use_none_delimit_by_s_stop:w }
1018 \str_if_in:nnT {#1} {ǂ} { \nontipatrue \use_none_delimit_by_s_stop:w }
1019 \str_if_in:nnT {#1} {ʢ} { \nontipatrue \use_none_delimit_by_s_stop:w }
1020 \str_if_in:nnT {#1} {ɺ} { \nontipatrue \use_none_delimit_by_s_stop:w }
1021 \str_if_in:nnT {#1} {ʑ} { \nontipatrue \use_none_delimit_by_s_stop:w }
1022 \str_if_in:nnT {#1} {ɧ} { \nontipatrue \use_none_delimit_by_s_stop:w }
1023 \use_none:nnn \s_stop
1024 \use:n { \cs_gset_eq:NN \@@_nontipa_search: \prg_do_nothing: }
1025 }
1026 \fi
1027 % \end{macrocode}
1028 % The user facing macro needs to make some local settings.
1029 % \begin{macrocode}
1030 \NewDocumentCommand\textipa{ +m }%
1031 {
1032 \begingroup
1033 \let\*\tipaunistar
1034 \let\:\tipaunicolon
1035 \let\;\tipaunisemicolon
1036 \let\!\tipaunibang
1037 \let\|\tipaunipipe
1038 \let\t\tipaunit
1039 % \end{macrocode}
1040 % Here we locally remove the accents which have a starred variant from the
1041 % exclusion list of \cs{text_expand:n}.
1042 % \begin{macrocode}
1043 \seq_map_inline:Nn \l_@@_remove_from_accents_seq
1044 { \tl_remove_all:Nn \l_text_accents_tl {##1} }
1045 % \end{macrocode}
1046 % Here is the real replacement. First we carefully expand the input using
1047 % \cs{text_expand:n}, then we'll loop over the token list with a construct
1048 % similar to the \pkg{expl3} internal \cs{__tl_act:NNNn} (hence the name
1049 % \cs{@@_act:n}). Since the replacement code depends on the correct string
1050 % representation of things we explicitly set the \cs{escapechar} to a backslash
1051 % and reset it afterwards.
1052 % \begin{macrocode}
1053 \tl_set:Nx \l_@@_textipa_tl { \text_expand:n {#1} }
1054 \use:x
1055 {
1056 \exp_not:n
1057 {
1058 \escapechar = `\\
1059 \tl_set:Nx \l_@@_textipa_tl
1060 { \exp_args:No \@@_act:n \l_@@_textipa_tl }
1061 \escapechar =
1062 }
1063 \int_use:N \escapechar
1064 }
1065 \exp_stop_f:
1066 \l_@@_textipa_tl
1067 % \end{macrocode}
1068 % Finally test for \pkg{tipa}-incompatible symbols.
1069 % \begin{macrocode}
1070 \@@_nontipa_search:
1071 \endgroup
1072 }
1073 % \end{macrocode}
1074 % We'll need a scan mark for the |act| code, so we initialise it.
1075 % \begin{macrocode}
1076 \scan_new:N \s_@@_act_stop
1077 \cs_new:Npn
1078 \@@_use_none_delimit_by_act_stop:w
1079 #1
1080 \s_@@_act_stop
1081 {}
1082 % \end{macrocode}
1083 % The act macro uses a bit of low level coding to get good performance. It
1084 % implements a loop which does the replacement of single letters, bigraphs or
1085 % combinations of one macro and one letter (which might be separated from the
1086 % macro by multiple spaces, or contained in braces as an argument, or both).
1087 % \cs{_@@_act:n} should be used inside an |x|-expansion context. The only
1088 % token which is not allowed to be ever part of the argument for
1089 % \cs{_@@_act:n} is \cs{s_@@_act_stop}.
1090 % \begin{macrocode}
1091 \cs_new:Npn
1092 \@@_act:n
1093 #1
1094 { \@@_act_loop:w #1 {\s_@@_act_stop} . \s_@@_act_stop }
1095 % \end{macrocode}
1096 % Just to have an easier to spot output we use a private copy of \cs{exp_not:n},
1097 % meaning we leave the output in the input stream (but since the whole loop
1098 % should be used in an |x|-expansion context this is fine, anything expecting
1099 % arguments will get those later).
1100 % \begin{macrocode}
1101 \cs_new_eq:NN \@@_act_output:n \exp_not:n
1102 % \end{macrocode}
1103 % The current loop status is indicated by one macro -- \cs{use_none:nn} for the
1104 % initial state; \cs{@@_act_macro:nn} if a macro being the start of a
1105 % bigraph was encountered; or \cs{@@_act_char:nn} if a character being
1106 % the start of a bigraph or a monograph was encountered -- followed by one
1107 % |n|-type argument containing information depending on the state. So for
1108 % \cs{@@_act_loop:Nnw} the arguments are: |#1| is the status macro, |#2|
1109 % more status information, |#3| the remainder of the argument list. It'll branch
1110 % off depending on the first token in |#3| being either a space, a group
1111 % (anything started by a character of category 1, typically an opening brace)
1112 % and anything else (a valid |N|-type argument).
1113 % \begin{macrocode}
1114 \cs_new:Npn \@@_act_loop:w { \@@_act_loop:Nnw \use_none:nn {} }
1115 \cs_new:Npn \@@_act_loop:Nnw #1#2#3 \s_@@_act_stop
1116 {
1117 \@@_act_if_head_is_space:nTF {#3}
1118 { \@@_act_space:Nnw }
1119 {
1120 \tl_if_head_is_group:nTF {#3}
1121 \@@_act_group:Nnn
1122 \@@_act_normal:NnN
1123 }
1124 #1 {#2} #3 \s_@@_act_stop
1125 }
1126 % \end{macrocode}
1127 % We'll need a few explicit space tokens in the following definitions, so we use
1128 % a temporary macro to set this up.
1129 % \begin{macrocode}
1130 \group_begin:
1131 \cs_set:Npn \@@_tmp:n #1
1132 {
1133 % \end{macrocode}
1134 % Quick test for a leading space using the |stop|-marker.
1135 % \begin{macrocode}
1136 \cs_new:Npn \@@_act_if_head_is_space:nTF ##1
1137 {
1138 \@@_act_if_head_is_space:w
1139 \s_@@_act_stop ##1 \s_@@_act_stop
1140 \@@_act_if_head_is_space_true:w
1141 \s_@@_act_stop #1 \s_@@_act_stop
1142 \use_ii:nn
1143 }
1144 \cs_new:Npn \@@_act_if_head_is_space:w
1145 ##1 \s_@@_act_stop #1 ##2 \s_@@_act_stop
1146 {}
1147 \cs_new:Npn \@@_act_if_head_is_space_true:w
1148 \s_@@_act_stop #1 \s_@@_act_stop \use_ii:nn ##1 ##2
1149 {##1}
1150 % \end{macrocode}
1151 % The case with a space needs a bit of special treatment if the current state is
1152 % |macro|. In that case we defer the decision and save the space inside the
1153 % additional status |n|-type argument. That consists of two nested |n|-type
1154 % arguments, the first being the control sequence under test and the second
1155 % tokens which need to be reinserted should the replacement fail.
1156 % \begin{macrocode}
1157 \cs_new:Npn \@@_act_space:Nnw ##1 ##2 #1
1158 {
1159 \token_if_eq_meaning:NNTF ##1 \@@_act_macro:nn
1160 { \@@_act_space_macro:nn ##2 }
1161 {
1162 \cs_if_exist_use:cTF {
1163 @@_act_char_mono_
1164 \tl_to_str:n { ##2 } :
1165 }
1166 { \@@_act_output:n {~} }
1167 { \@@_act_output:n { ##2 ~ } }
1168 \@@_act_loop:w
1169 }
1170 }
1171 }
1172 \@@_tmp:n {~}
1173 \group_end:
1174 % \end{macrocode}
1175 % This macro just works as a helper to get the two separate arguments in the
1176 % status and append a space token to the deferred list.
1177 % \begin{macrocode}
1178 \cs_new:Npn \@@_act_space_macro:nn #1#2
1179 { \@@_act_loop:Nnw \@@_act_macro:nn { {#1} { #2 ~ } } }
1180 % \end{macrocode}
1181 % The end marker is a single \cs{s_@@_act_stop} in a group, hence we need to
1182 % test for that. If this isn't the end we need to handle two different cases, if
1183 % the current state is a macro the group might actually be the correct argument
1184 % to that macro, else a bigraph shouldn't contain a group, so we output what
1185 % ever the current status deferred information was (either as a |mono|
1186 % replacement or just as is) and act on the group.
1187 % \begin{macrocode}
1188 \cs_new:Npn \@@_act_group:Nnn #1#2#3
1189 {
1190 \@@_use_none_delimit_by_act_stop:w
1191 #3 \@@_act_final:Nnw #1 {#2} \s_@@_act_stop
1192 \token_if_eq_meaning:NNTF #1 \@@_act_macro:nn
1193 { \@@_act_group_macro:nn {#2} {#3} }
1194 {
1195 \cs_if_exist_use:cF
1196 { @@_act_char_mono_ \tl_to_str:n { #2 } : }
1197 { \@@_act_output:n {#2} }
1198 {
1199 \@@_act_loop:w
1200 #3
1201 {\s_@@_act_stop}
1202 .
1203 \s_@@_act_stop
1204 }
1205 }
1206 \@@_act_loop:w
1207 }
1208 % \end{macrocode}
1209 % The final code needs to remove the remainder of the loop and reinsert whatever
1210 % was deferred, unless that happens to be one of the single tokens to be
1211 % replaced in which case we do the replacement.
1212 % \begin{macrocode}
1213 \cs_new:Npn \@@_act_final:Nnw
1214 #1#2 \s_@@_act_stop #3 \@@_act_loop:w #4 \s_@@_act_stop
1215 {
1216 \cs_if_exist_use:cF { @@_act_char_mono_ \tl_to_str:n { #2 } : }
1217 {
1218 \token_if_eq_meaning:NNTF #1 \@@_act_macro:nn
1219 { \exp_args:No \@@_act_output:n { \use:nn #2 } }
1220 { \@@_act_output:n {#2} }
1221 }
1222 }
1223 % \end{macrocode}
1224 % The normal case is pretty straight forward, if the current state is the
1225 % initial state, check whether the token under test is the start of one of the
1226 % replacement sequences (this would be stored inside a macro), if it isn't
1227 % directly output it. If it is the code in that macro will do the right thing.
1228 % If the current state is something else the state macro will handle things, so
1229 % we just call it with the arguments it should get.
1230 % \begin{macrocode}
1231 \cs_new:Npn \@@_act_normal:NnN #1#2#3
1232 {
1233 \token_if_eq_meaning:NNTF #1 \use_none:nn
1234 {
1235 \cs_if_exist_use:cF { @@_act_normal_ \tl_to_str:n {#3} :nw }
1236 { \@@_act_output:n }
1237 {#3}
1238 }
1239 { #1 {#2} {#3} }
1240 \@@_act_loop:w
1241 }
1242 % \end{macrocode}
1243 % The code that should handle a macro will test whether a replacement occurs
1244 % (stored inside a macro), if it does calls that macro, else outputs the
1245 % deferred information. Since the |macro| state will have two groups in the
1246 % deferred state we need to handle that using \cs{use_i:nn} to get the macro
1247 % name, and \cs{use:nn} to just unbrace the macro and the other deferred tokens
1248 % (which might be any number of spaces).
1249 % \begin{macrocode}
1250 \cs_new:Npn \@@_act_macro:nn #1#2
1251 {
1252 \cs_if_exist_use:cF
1253 {
1254 @@_act_macro_
1255 \exp_args:No
1256 \tl_to_str:n {
1257 \use_i:nn #1 / #2
1258 }
1259 :
1260 }
1261 { \exp_args:No \@@_act_output:n { \use:nn #1 #2 } }
1262 }
1263 % \end{macrocode}
1264 % If the |macro| state was active when a group was encountered we need to check
1265 % whether that group was the correct argument for the replacement, if it was do
1266 % the replacement, else reinsert the macro and deferred tokens and loop through
1267 % the group.
1268 % \begin{macrocode}
1269 \cs_new:Npn \@@_act_group_macro:nn #1#2
1270 {
1271 \cs_if_exist_use:cF
1272 {
1273 @@_act_macro_
1274 \exp_args:No
1275 \tl_to_str:n {
1276 \use_i:nn #1 / #2
1277 }
1278 :
1279 }
1280 {
1281 \exp_args:No
1282 \@@_act_output:n {
1283 \use:nn #1
1284 }
1285 {
1286 \@@_act_loop:w
1287 #2
1288 {\s_@@_act_stop} . \s_@@_act_stop
1289 }
1290 }
1291 }
1292 % \end{macrocode}
1293 % If the |char| state is active we need to check whether a bigraph was found, if
1294 % so do that replacement, else test whether the single char is to be replaced
1295 % without being part of a bigraph, if not output it unchanged. If there was no
1296 % bigraph the newly found character might be the start of a mono- or bigraph so
1297 % we pass it back to the |N|-type act to evaluate that, in which case we need
1298 % to remove a trailing \cs{@@_act_loop:w} which would start the next loop which
1299 % we do using \cs{use_i:nn}.
1300 % \begin{macrocode}
1301 \cs_new:Npn \@@_act_char:nn #1#2
1302 {
1303 \cs_if_exist_use:cF {
1304 @@_act_char_bigraph_
1305 \tl_to_str:n
1306 { #1/#2 }
1307 :
1308 }
1309 {
1310 \cs_if_exist_use:cF {
1311 @@_act_char_mono_
1312 \tl_to_str:n { #1 }
1313 :
1314 }
1315 { \@@_act_output:n {#1} }
1316 \use_i:nn {
1317 \@@_act_normal:NnN
1318 \use_none:nn {} {#2}
1319 }
1320 }
1321 }
1322 % \end{macrocode}
1323 % To register new bigraphs we use the following functions. The information is
1324 % always stored inside two macros, the first is called
1325 % |@@_act_normal_|\meta{first token}|:nw| and will set the correct state, the
1326 % second is named dependent on the state it should be found in, either
1327 % |@@_act_macro_|\meta{first token}|/|\meta{second token}|:|,
1328 % |@@_act_char_bigraph_|\meta{first token}|/|\meta{second token}|:|, or
1329 % |@@_act_char_mono_|\meta{token}|:|. Those second macros contain the actual
1330 % replacement.
1331 %
1332 % \cs{@@_new_macro_bigraph:NNn} is input for the two macros in |#1| and |#2| by
1333 % the first macro which is a wrapper.
1334 % \begin{macrocode}
1335 \cs_new_protected:Npn \@@_new_macro_pair_bigraph:NNNn #1#2#3#4
1336 {
1337 \@@_new_macro_bigraph:NNn #1 #3 {#4}
1338 \@@_new_macro_bigraph:NNn #2 #3 {#4}
1339 }
1340 % \end{macrocode}
1341 % A macro bigraph should consist of a control sequence followed by another
1342 % token. It'll switch the state to |macro|.
1343 % \begin{macrocode}
1344 \cs_new_protected:Npn \@@_new_macro_bigraph:NNn #1#2#3
1345 {
1346 \cs_gset:cpn {
1347 @@_act_normal_
1348 \tl_to_str:n
1349 {#1}
1350 :nw
1351 }
1352 ##1##2
1353 \@@_act_loop:w
1354 {
1355 \@@_act_loop:Nnw
1356 \@@_act_macro:nn
1357 { {##1} {} }
1358 }
1359 \cs_gset:cpn
1360 { @@_act_macro_ \tl_to_str:n { #1/#2 } : }
1361 { \@@_act_output:n {#3} }
1362 }
1363 % \end{macrocode}
1364 % A character bigraph should consist of two characters. It'll switch the state
1365 % to |char|.
1366 % \begin{macrocode}
1367 \cs_new_protected:Npn \@@_new_char_bigraph:NNn #1#2#3
1368 {
1369 \cs_gset:cpn {
1370 @@_act_normal_
1371 \tl_to_str:n
1372 {#1}
1373 :nw
1374 } ##1##2
1375 \@@_act_loop:w
1376 {
1377 \@@_act_loop:Nnw
1378 \@@_act_char:nn {##1}
1379 }
1380 \cs_gset:cpn {
1381 @@_act_char_bigraph_
1382 \tl_to_str:n { #1/#2 } :
1383 }
1384 { \@@_act_output:n {#3} }
1385 }
1386 % \end{macrocode}
1387 % And lastly the single replacements which should just be a single character.
1388 % These will also switch the state to |char| (as they might be also a start of
1389 % a bigraph).
1390 % \begin{macrocode}
1391 \cs_new_protected:Npn \@@_new_char_mono:Nn #1#2
1392 {
1393 \cs_gset:cpn {
1394 @@_act_normal_
1395 \tl_to_str:n
1396 {#1}
1397 :nw
1398 } ##1##2
1399 \@@_act_loop:w
1400 { \@@_act_loop:Nnw
1401 \@@_act_char:nn
1402 {##1}
1403 }
1404 \cs_gset:cpn
1405 { @@_act_char_mono_
1406 \tl_to_str:n {#1} :
1407 }
1408 { \@@_act_output:n {#2} }
1409 }
1410 % \end{macrocode}
1411 % Everything that's now missing is defining the macros storing the replacements
1412 % as described above.
1413 % \begin{macrocode}
1414 \@@_new_macro_pair_bigraph:NNNn \! \tipaunibang G {ʛ}
1415 \@@_new_macro_pair_bigraph:NNNn \! \tipaunibang g {ɠ}
1416 \@@_new_macro_pair_bigraph:NNNn \* \tipaunistar 1 {ʢ}
1417 \@@_new_macro_pair_bigraph:NNNn \* \tipaunistar 2 {ʡ}
1418 \@@_new_macro_pair_bigraph:NNNn \* \tipaunistar 3 {ɧ}
1419 \@@_new_macro_pair_bigraph:NNNn \* \tipaunistar Z {ʑ}
1420 \@@_new_macro_pair_bigraph:NNNn \: \tipaunicolon R {ɻ}
1421 \@@_new_macro_pair_bigraph:NNNn \; \tipaunisemicolon A {ᴀ}
1422 \@@_new_macro_pair_bigraph:NNNn \; \tipaunisemicolon G {ɢ}
1423 \@@_new_macro_pair_bigraph:NNNn \; \tipaunisemicolon B {ʙ}
1424 \@@_new_macro_pair_bigraph:NNNn \; \tipaunisemicolon E {ᴇ}
1425 \@@_new_macro_pair_bigraph:NNNn \; \tipaunisemicolon H {ʜ}
1426 \@@_new_macro_pair_bigraph:NNNn \; \tipaunisemicolon J {ᴊ}
1427 \@@_new_macro_pair_bigraph:NNNn \; \tipaunisemicolon L {ʟ}
1428 \@@_new_macro_pair_bigraph:NNNn \; \tipaunisemicolon N {ɴ}
1429 \@@_new_macro_pair_bigraph:NNNn \; \tipaunisemicolon R {ʀ}
1430 \@@_new_macro_pair_bigraph:NNNn \; \tipaunisemicolon U {ᴜ}
1431 \@@_new_char_bigraph:NNn || {ǁ}
1432 \@@_new_char_bigraph:NNn "" {ˌ}
1433 \clist_map_inline:nn
1434 {
1435 {5}{ɐ}, {A}{ɑ}, {6}{ɒ}, {2}{ʌ}, {B}{β}, {C}{ɕ}, {D}{ð}, {9}{ɘ}, {E}{ɛ},
1436 {3}{ɜ}, {g}{ɡ}, {G}{ɣ}, {7}{ɤ}, {H}{ɦ}, {L}{ʎ}, {4}{ɥ}, {1}{ɨ}, {I}{ɪ},
1437 {J}{ʝ}, {M}{ɱ}, {W}{ɯ}, {N}{ŋ}, {8}{ɵ}, {O}{ɔ}, {F}{ɸ}, {R}{ɾ}, {K}{ʁ},
1438 {S}{ʃ}, {T}{θ}, {0}{ʉ}, {U}{ʊ}, {V}{ʋ}, {X}{χ}, {Y}{ʏ}, {Z}{ʒ},
1439 {P}{ʔ}, {Q}{ʕ},
1440 {:}{ː}, {;}{ˑ}, {!}{ǃ}, {&}{ɞ}, {@}{ə}, {|}{ǀ}, {"}{ˈ}
1441 }
1442 { \@@_new_char_mono:Nn #1 }
1443 \ExplSyntaxOff
1444 % \end{macrocode}
1445 % The following commands define the long commands for dependent diacritics.
1446 % \begin{macrocode}
1447 %%-- Dependent diacritic marks
1448 %%--** Voiceless
1449 \DeclareUnicodeAccent{\textsupring}{TU}{"030A}%% ̊
1450 \DeclareUnicodeAccent{\textsubring}{TU}{"0325}%% ̥
1451 \DeclareTextCommand{\r}{TU}{\tipauniring}
1452 \protected\def\tipauniring{\@ifstar{\TipaUniSubRing}{\TipaUniSupRing}}
1453 \NewDocumentCommand\TipaUniSupRing{ m }{\textsupring{\textipa{#1}}}
1454 \NewDocumentCommand\TipaUniSubRing{ m }{\textsubring{\textipa{#1}}}
1455 %%--** Voiced
1456 \DeclareUnicodeAccent{\textsupwedge}{TU}{"030C}%% ̌
1457 \DeclareUnicodeAccent{\textsubwedge}{TU}{"032C}%% ̬
1458 \DeclareTextCommand{\v}{TU}{\tipauniwedge}
1459 \protected\def\tipauniwedge{\@ifstar{\TipaUniSubWedge}{\TipaUniSupWedge}}
1460 \NewDocumentCommand\TipaUniSupWedge{ m }{\textsupwedge{\textipa{#1}}}
1461 \NewDocumentCommand\TipaUniSubWedge{ m }{\textsubwedge{\textipa{#1}}}
1462 %%--** More rounded
1463 \DeclareUnicodeAccent{\textsubrhalfring}{TU}{"0339}%% ̹
1464 \NewDocumentCommand\tipaunisubrhalfring{ m }{\textsubrhalfring{\textipa{#1}}}
1465 %%--** Less rounded
1466 \DeclareUnicodeAccent{\textsublhalfring}{TU}{"031C}%% ̜
1467 \NewDocumentCommand\tipaunisublhalfring{ m }{\textsublhalfring{\textipa{#1}}}
1468 %%--** Advanced
1469 \DeclareUnicodeAccent{\textsubplus}{TU}{"031F}%% ̟
1470 \NewDocumentCommand\tipaunisubplus{ m }{\textsubplus{\textipa{#1}}}
1471 %%--** Retracted
1472 \DeclareUnicodeAccent{\textsupbar}{TU}{"0304}%% ̄
1473 \DeclareUnicodeAccent{\textsubbar}{TU}{"0320}%% ̠
1474 \DeclareTextCommand{\=}{TU}{\tipaunibar}
1475 \protected\def\tipaunibar{\@ifstar{\TipaUniSubBar}{\TipaUniSupBar}}
1476 \NewDocumentCommand\TipaUniSupBar{ m }{\textsupbar{\textipa{#1}}}
1477 \NewDocumentCommand\TipaUniSubBar{ m }{\textsubbar{\textipa{#1}}}
1478 %%--** Mid-centralized
1479 \DeclareUnicodeAccent{\textovercross}{TU}{"033D}%% ̽
1480 \NewDocumentCommand\tipauniovercross{ m }{\textovercross{\textipa{#1}}}
1481 %%--** Breathy voiced
1482 \DeclareUnicodeAccent{\textsupumlaut}{TU}{"0308}%% ̈
1483 \DeclareUnicodeAccent{\textsubumlaut}{TU}{"0324}%% ̤
1484 \DeclareTextCommand{\"}{TU}{\tipauniumlaut}
1485 \protected\def\tipauniumlaut{\@ifstar{\TipaUniSubUmlaut}{\TipaUniSupUmlaut}}
1486 \NewDocumentCommand\TipaUniSupUmlaut{ m }{\textsupumlaut{\textipa{#1}}}
1487 \NewDocumentCommand\TipaUniSubUmlaut{ m }{\textsubumlaut{\textipa{#1}}}
1488 %%--** Creaky voiced
1489 \DeclareUnicodeAccent{\textsuptilde}{TU}{"0303}%% ̃
1490 \DeclareUnicodeAccent{\textsubtilde}{TU}{"0330}%% ̰
1491 \DeclareTextCommand{\~}{TU}{\tipaunitilde}
1492 \protected\def\tipaunitilde{\@ifstar{\TipaUniSubTilde}{\TipaUniSupTilde}}
1493 \NewDocumentCommand\TipaUniSupTilde{ m }{\textsuptilde{\textipa{#1}}}
1494 \NewDocumentCommand\TipaUniSubTilde{ m }{\textsubtilde{\textipa{#1}}}
1495 %%--** Linguo-labialized
1496 \DeclareUnicodeAccent{\textseagull}{TU}{"033C}%% ̼
1497 \NewDocumentCommand\tipauniseagull{ m }{\textseagull{#1}}
1498 %%--** Velarized
1499 \DeclareUnicodeAccent{\textsuperimposetilde}{TU}{"0334}%% ̴
1500 \NewDocumentCommand\tipaunisuperimposetilde{ m }{\textsuperimposetilde{#1}}
1501 \NewDocumentCommand\vl{ m }{\textsuperimposetilde{\textipa{#1}}}
1502 %%--** Raised
1503 \DeclareUnicodeAccent{\textraising}{TU}{"031D}%% ̝
1504 \NewDocumentCommand{\tipauniraising}{m}{\textraising{#1}}
1505 %%--** Lowered
1506 \DeclareUnicodeAccent{\textlowering}{TU}{"031E}%% ̞
1507 \NewDocumentCommand{\tipaunilowering}{m}{\textlowering{#1}}
1508 %%%--** Advanced tongue root
1509 \DeclareUnicodeAccent{\textadvancing}{TU}{"0318}%% ̘
1510 \NewDocumentCommand{\tipauniadvancing}{m}{\textadvancing{#1}}
1511 %%--** Retracted tongue root
1512 \DeclareUnicodeAccent{\textretracting}{TU}{"0319}%% ̙
1513 \NewDocumentCommand{\tipauniretracting}{m}{\textretracting{#1}}
1514 %%--** Dental
1515 \DeclareUnicodeAccent{\textsubbridge}{TU}{"032A}%% ̪
1516 \NewDocumentCommand\tipaunisubbridge{ m }{\textsubbridge{#1}}
1517 %%--** Apical
1518 \DeclareUnicodeAccent{\textinvsubbridge}{TU}{"033A}%% ̺
1519 \NewDocumentCommand\tipauniinvsubbridge{ m }{\textinvsubbridge{#1}}
1520 %%--** Tie bar (above)
1521 \DeclareTextCommand{\tipaunitexttoptiebar}{TU}[2]{#1\symbol{"0361}#2}
1522 \NewDocumentCommand\texttoptiebar{ m }{\tipaunitexttoptiebar#1}
1523 \DeclareTextCommand{\tipaunit}{TU}{%
1524 \@ifstar{\textbottomtiebar}{\texttoptiebar}%
1525 }
1526 % \end{macrocode}
1527 % Lastly the code for environment \texttt{IPA} is provided by the following.
1528 % \begin{macrocode}
1529 \NewDocumentEnvironment{IPA}{+b}{\textipa{#1}}{}
1530 % \end{macrocode}
1531 % \begin{macrocode}
1532 %</package>
1533 % \end{macrocode}
1534 % Since we want to add certain features to the |NewCM| font, we generate two
1535 % |.fontspec| files with this package. The following is the tag used for
1536 % generating the |.fontspec| file of the regular weight.
1537 % \begin{macrocode}
1538 %<*regularfontspec>
1539 \defaultfontfeatures[tipauni-newcm-regular]{%
1540 Renderer = {Harfbuzz},%
1541 Extension = {.otf},%
1542 UprightFont = {NewCM10-Regular},%
1543 ItalicFont = {NewCM10-Italic},%
1544 BoldFont = {NewCM10-Bold},%
1545 BoldItalicFont = {NewCM10-BoldItalic},%
1546 StylisticSet = {5}%
1547 }
1548 %</regularfontspec>
1549 % \end{macrocode}
1550 % With the following tag generates the |.fontspec| file for the book weight of
1551 % the font.
1552 % \begin{macrocode}
1553 %<*bookfontspec>
1554 \defaultfontfeatures[tipauni-newcm-book]{%
1555 Renderer = {Harfbuzz},%
1556 Extension = {.otf},%
1557 UprightFont = {NewCM10-Book},%
1558 ItalicFont = {NewCM10-BookItalic},%
1559 BoldFont = {NewCM10-Bold},%
1560 BoldItalicFont = {NewCM10-BoldItalic},%
1561 StylisticSet = {5}%
1562 }
1563 %</bookfontspec>
1564 % \end{macrocode}
1565 % \end{implementation}
1566 %
1567 % \Finale