LyXNo interlinear on first line of gloss?

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

No interlinear on first line of gloss?

Post by Hiram »

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:
current example
current example
Gloss and Tri-glosse.jpg (34.93 KiB) Viewed 5945 times
What I want to get:
intended result
intended result
Gloss and Tri-glosse X.jpg (18.84 KiB) Viewed 5945 times
Attachments
Gloss and Tri-glosse.lyx
Minimal working example
(2.3 KiB) Downloaded 524 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
User avatar
Hiram
Posts: 15
Joined: Thu Nov 29, 2012 2:05 am

No interlinear on first line of gloss?

Post by Hiram »

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:

Code: Select all

{\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 493 times
Post Reply