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
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 3683 times

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


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

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


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:

  1. {\catcode`\^^M=12 \endlinechar=-1 % 12 = other
  2. \gdef\threesent#1^^M#2^^M#3^^M % #1 = first line, #2 = second line, #3 = third
  3. {\eachwordone#1\newline%
  4. \getwords(\linetwo,\eachwordtwo)#2 ^^M%
  5. \getwords(\linethree,\eachwordthree)#3 ^^M%
  6. \loop\lastword{\eachwordtwo}{\linetwo}{\wordtwo}%
  7. \lastword{\eachwordthree}{\linethree}{\wordthree}%
  8. \global\setbox\gline=\hbox{\unhbox\gline
  9. \hskip\glossglue
  10. \vtop{\box\lineone%\wordone % vtop was vbox
  11. \nointerlineskip
  12. \box\wordtwo
  13. \nointerlineskip
  14. \box\wordthree
  15. }%
  16. }%
  17. \testdone
  18. \ifnotdone
  19. \repeat
  20. \egroup % matches \bgroup in \gloss
  21. }
  22. }

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.
Gloss and Tri-glosse.lyx
Working example with preamble code
(3.32 KiB) Downloaded 258 times

Return to “LyX”

Who is online

Users browsing this forum: No registered users and 6 guests