Background:
There is currently no way to directly input IPA characters into a linguistic glossed example (that I have found). If you try to key in a unicode character to a Glosse inset in LyX, the editor returns the line "Character is uncodable in verbatim paragraphs" and doesn't display anything.
After searching the web for why this could possibly be, I happened on a conversation between developers: http://lyx.475766.n2.nabble.com/Re-Cvsl ... 82223.html
Essentially, from what I can gather (correct me if I'm wrong) Glosse insets in LyX are forcibly encoded in Latin-1, which means that UTF8 characters cannot be inputted directly. This doesn't seem to need to be a requirement, and the developers seem to agree that direct Unicode input in ERT is conceivably useful for users, they just couldn't think of a good use. Well, I think I've found one. I was hoping that the direct support of Unicode and IPA in the newest LyX release (2.1) would solve this issue, but it doesn't, quite, as Unicode is still not supported within the Glosse and Tri-glosse environments.
My current workaround is to type the characters I need in the normal text field outside of the gloss inset, then View > Source and copy the LaTeX code, which I then paste into the gloss inset. This is rather cumbersome, as a simple 'ɛ' character is shown as \textepsilon{} within the gloss inset, allowing for many more potential typing mistakes than if I only had to type an individual character.
There does seem to be some work that has been done on allowing unicode in the Listings environment, which also uses ERT. Specifically, this thread: http://comments.gmane.org/gmane.editors ... eral/48445
Also, some suggestions on how to enable unicode characters in Verbatim paragraphs: http://tex.stackexchange.com/questions/ ... ar-u8?rq=1 - which unfortunately I haven't been able to get to work.
Specifically, I wonder if there's a way to adjust the Linguistics Module that ships with LyX to allow the 'linggloss' environment to contain unicode characters. Check this link (lines 66-122): http://fossies.org/linux/misc/lyx-2.1.0 ... ics.module
For experimentation purposes, try the following MWE, also attached as files.
Any help is greatly appreciated!
Code: Select all
\documentclass[12pt,oneside,english]{book}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{covington}
\usepackage{tipa}
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
{hyperref}
\hypersetup{
linkcolor=blue,citecolor=blue,filecolor=blue,urlcolor=blue}
\usepackage{breakurl}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{enumitem} % customizable list environments
\newlength{\lyxlabelwidth} % auxiliary length
\@ifundefined{lingglosss}{%
\newenvironment{lingglosss}[1]{%
\glll #1}
{\glend}}{}
\makeatother
\begin{document}
The following text inputs directly from my keyboard and shows up fine
in (1).
\begin{examples}
\item l\textepsilon \textglotstop{}
daw li-\textraiseglotstop e \textdyoghlig a ki \textteshlig a ju\ng{}
k\textsyllabic{n}t\textsuperscript{h}aj
\end{examples}
However, in order to get it to show up properly as the second line
of the Tri-Glosse inset in (2) I have to
manually type in the \TeX{} code for each IPA character.
\begin{examples}
\item
\begin{lingglosss}
laeh daw li-e ja ki cha yung kynthai
l\textepsilon \textglotstop{} daw li-\textraiseglotstop{}e \textdyoghlig{}a ki \textteshlig{}a \textbf{ju\ng{}} \textbf{k\textsyllabic{n}t\textsuperscript{h}aj}
also \textsc{irr} \textsc{cont}-give rice \textsc{3pl} \textsc{all} home woman
\glt `also they will give rice to the woman's home' [PP14MF\_0025]
\end{lingglosss}
\end{examples}
\end{document}