LyXIPA unicode input in Glosse and Tri-glosse

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
User avatar
Hiram
Posts: 15
Joined: Thu Nov 29, 2012 2:05 am

IPA unicode input in Glosse and Tri-glosse

Post by Hiram »

I'm trying to get unicode input to work in the Linguistic Glosse inset that comes with LyX.

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}
IPA input in Glosse inset.lyx
MWE LyX
(3.42 KiB) Downloaded 402 times
Attachments
What I see in the LyX editor
What I see in the LyX editor
Screen Shot 2014-07-02 at 4.58.08 PM.png (65.71 KiB) Viewed 4122 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: IPA unicode input in Glosse and Tri-glosse

Post by scottkosty »

You might want to email lyx-users@lists.lyx.org. The developer who implemented the IPA toolbar (a linguist himself) is on the list.

Good luck!
Post Reply