LaTeX forum ⇒ LyXNo interlinear on first line of gloss? Topic is solved

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

No interlinear on first line of gloss?

Postby Hiram » Mon Jun 16, 2014 6:17 am

I'm trying to create linguistic examples with interlinear glosses where the first line is not interlinearized. This would be useful for adding a line of orthographic text in the local language, then having a line of IPA marked for clitics/affixes, and then appropriate glosses.

I'm attaching a minimal example as a LyX file, which should be pretty straightforward. I'm also attaching a couple PDFs. The first is what the LyX file outputs. The second is what I have been able to do through a variety of workaround solutions. I'm hoping someone on the list has a much simpler redefinition code that would allow me to adjust the Tri-glosse environment.

What I currently get:
Gloss and Tri-glosse.jpg
current example
Gloss and Tri-glosse.jpg (34.93 KiB) Viewed 3967 times


What I want to get:
Gloss and Tri-glosse X.jpg
intended result
Gloss and Tri-glosse X.jpg (18.84 KiB) Viewed 3967 times
Attachments
Gloss and Tri-glosse.lyx
Minimal working example
(2.3 KiB) Downloaded 295 times

User avatar
Hiram
Posts: 15
Joined: Thu Nov 29, 2012 2:05 am

Postby Hiram » Tue Jul 01, 2014 4:57 am

SOLVED!

So excited when I found this solution, after many headaches, trial and error. I was able to locally redefine the \threesent macro for covington.sty in my preamble.

Just paste the following code in your document's preamble:

{\catcode`\^^M=12 \endlinechar=-1 % 12 = other
\gdef\threesent#1^^M#2^^M#3^^M % #1 = first line, #2 = second line, #3 = third
   {\eachwordone#1\newline%
    \getwords(\linetwo,\eachwordtwo)#2 ^^M%
    \getwords(\linethree,\eachwordthree)#3 ^^M%
    \loop\lastword{\eachwordtwo}{\linetwo}{\wordtwo}%
         \lastword{\eachwordthree}{\linethree}{\wordthree}%
         \global\setbox\gline=\hbox{\unhbox\gline
                                    \hskip\glossglue
                                    \vtop{\box\lineone%\wordone   % vtop was vbox
                                          \nointerlineskip
                                          \box\wordtwo
                                          \nointerlineskip
                                          \box\wordthree
                                         }%
                                   }%
         \testdone
         \ifnotdone
    \repeat
    \egroup % matches \bgroup in \gloss
   }
}


This prints the first line of Tri-Glosse as an un-interlinearized line and then the following two lines are interlinearized.

I'm also attaching a .LyX file as a MWE.
Attachments
Gloss and Tri-glosse.lyx
Working example with preamble code
(3.32 KiB) Downloaded 272 times


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 11 guests