Wiki Lyx Org LyX LinguistLyX

25
pdfcrowd.com open in browser PRO version Are you a developer? Try out the HTML to PDF API Categories: Table, Symbol , Tree, Numbering, Footnotes, Humanities, Linguistics View Edit Upload History Print Navigation Welcome About uploading Page list for Site/ All pages in Site/ Groups LyX/ Tips/ FAQ/ Tools/ LaTeX/ BibTeX/ Layouts/ Mac/ Windows/ Examples/ Glossary/ Devel/ LyX documentation Documentation Manuals Tutorials Presentations LyX Functions Troubleshooting Suggested reading Official web site Edit LyX / Using LyX for Linguistic Papers << | Page list | >> Using LyX for Linguistic Papers Using LyX for Linguistic Papers by Maria Gouskova, Stacia Hartleben and Jürgen Spitzmüller Table of contents 1. LyX and Linguistics 2. The Linguistics Module 3. Phonology/Phonetics 3.1 Using LyX to Display Phonetic Characters (IPA) 3.2 Tables and Optimality-Theoretic Tableaux 3.3 Feature Matrices/Stuff in Brackets 3.4 Other Special Characters and Diacritics 4. Using LyX to Draw Trees 4.1 Packages 4.2 Structure Tree support as of LyX 2.2.0 4.3 Structure Trees in LyX < 2.2.0 5. Using LyX to display numbered examples with Covington 5.1 Covington environment support in LyX 5.2 Adjusting Covington Examples 6. Aligned Glosses (Covington) 7. Using covington (glosses and examples) in a beamer presentation 8. Semantics 8.1 Markup Go to page: AboutListPages Go Search: Search Help

description

lyxling

Transcript of Wiki Lyx Org LyX LinguistLyX

Page 1: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

Categories: Table, Symbol, Tree, Numbering, Footnotes, Humanities, Linguistics

View Edit Upload History PrintNavigationWelcomeAboutuploadingPage list forSite/All pages inSite/

GroupsLyX/Tips/FAQ/Tools/LaTeX/BibTeX/Layouts/Mac/Windows/Examples/Glossary/Devel/

LyX

documentation

DocumentationManualsTutorialsPresentationsLyX FunctionsTroubleshootingSuggestedreadingOfficial website

Edit

LyX /

Using LyX for Linguistic Papers<< | Page list | >>

Using LyX for Linguistic Papers

Using LyX for Linguistic Papers

by Maria Gouskova, Stacia Hartleben and Jürgen Spitzmüller

Table of contents1. LyX and Linguistics2. The Linguistics Module3. Phonology/Phonetics

3.1  Using LyX to Display Phonetic Characters (IPA)3.2  Tables and Optimality-Theoretic Tableaux3.3  Feature Matrices/Stuff in Brackets3.4  Other Special Characters and Diacritics

4. Using LyX to Draw Trees4.1  Packages4.2  Structure Tree support as of LyX 2.2.04.3  Structure Trees in LyX < 2.2.0

5. Using LyX to display numbered examples with Covington5.1  Covington environment support in LyX5.2  Adjusting Covington Examples

6. Aligned Glosses (Covington)7. Using covington (glosses and examples) in a beamer presentation8. Semantics

8.1  Markup

Go to page: AboutListPages Go

Search: Search Help

Page 2: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

EditCurrent pagePage listField sidebarSandboxGroup sidebar(new)

SharedgroupsSite/Test/Profiles/Playground/

LinksSite helpSite FAQCopyrightswww.lyx.orgPmWikidocumentation

8.2  Logical Semantics8.3  Other stuff

9. Conversation Analysis9.1  CA transcription with tabbing

9.2  CA transcription with listings

10. Switching languages11. Bibliographies12. List of Publications13. Acknowledgment footnote

LyX and LinguisticsLinguists, as opposed to, say mathematicians, have specific typographic needs, such as:

a numbered paragraph environment, in parentheses, with numbering sequential throughout the documenttable editing: double lines, dashed lines, shaded table cells (for Optimality Theory)various symbols, such as the pointy hand and the bomb, flower, etc. (for Optimality Theory)phonetic notation (IPA)trees, syntactic and autosegmental/prosodicaligned glossesspecifically aligned notation for transcripts in conversation analysismath symbols intermingled with phonetic symbolsswitching from one language's orthography or script to another in the same document/paragraph/line

LyX serves these needs pretty well, even if some of the tasks remain demanding. This site documents LyX's linguistic features,describes some workarounds and articulates feature requests for future LyX versions.

For general information about using LyX in the humanities, consult the site HumanitiesLyX, which covers a lot of linguists' needsas well.

For general information on LaTeX for linguists please refer to Doug Arnold's LaTeX for linguists page, the UPenn LaTeX page, andLing-TeX.

The Linguistics Module

Page 3: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

As of version 1.6., LyX features so-called modules that add specific features to your document. LyX also ships a Linguisticsmodule that adds some native support for numbered examples, glosses, OT tableaux and some semantic markup commonlyneeded by linguists. You can load the module in Document→Settings→Modules.

Instructions for this module can be found throughout this site. Additionally, LyX also includes a small manual that demonstrates thefeatures (cf. Help→Specific Manuals→Linguistics Manual).

If you have suggestions for features that could be added to this module, don't hesitate to contact the LyX developers list.

Phonology/Phonetics

Using LyX to Display Phonetic Characters (IPA)LyX internally uses Unicode. If you are used to working with Unicode fonts such as the SIL Doulos IPA font, you can principallycontinue entering International Phonetic Alphabet (IPA) symbols in the same way you usually do (for example, using a KeyboardLayout). You can also copy and paste Unicode IPA text from other sources into LyX or insert them via Insert→SpecialCharacters→Symbols.... Such "direct" Unicode input is particularly advised if you're using XeTeX or LuaTeX with "non-TeX fonts".With this specific setting, you can always enter IPA glyphs via unicode directly. You just have to take care to select a font thatincludes the IPA glyphs, and everything should just work. However, in all other settings (i.e., with "TeX fonts", be it withXeTeX/LuaTeX or traditional LaTeX), direct input has several drawbacks. Read the following section a.) if you are interested indetails and technical reasons. If you believe us and/or want to insert good-looking IPA without further ado, just hop to section b.)below.

a.) Drawbacks of direct Unicode input with "TeX fonts" and advantages of the dedicated IPA inset

1. If you enter Unicode symbols directly (again, with "TeX fonts"), LyX will take the "normal" (ASCII) characters from yourdocument's main font, the IPA characters from the IPA font. This will most likely look odd.

2. Until LyX 2.1, native insertion of Unicode glyphs resulted in sub-optimally kerned words (i.e., bad spacing between letters).This was due to the way LyX resolved these glyphs to LaTeX (see below for the technical explanation).

LyX's native IPA support via the dedicated IPA inset cures these issues. Here's why.

If "TeX fonts" are used, IPA symbols are produced by means of the TIPA package, LaTeX's standard package for IPA support.This package includes two font families. One has been designed to be used with LaTeX's computer modern family of fonts, the

Page 4: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

other with times (i.e. mathptmx.sty). Please refer to the voluminous TIPA manual for details.

So if you insert a Schwa glyph, LyX will automatically convert this glyph to the respective TIPA macro (\textschwa). LaTeX thentypesets the Schwa glyph from the TIPA font. If you insert a normal alphabet glyph (such as b), however, it will be passed toLaTeX literally, so LaTeX typesets the b not from the IPA font, but from the main text font, whatever that may be. LyX's dedicatedIPA inset assures that all text uses the IPA font. This cures the font mixing problem.

Also, with the dedicated inset, you can additionally use the handy "TIPA shortcut notation" (see below), which is in fact faster thanUnicode input, once you are used to it. Moreover, the kerning problems described above do not occur with the shortcut notation.Here's the technical explanation: Until version 2.0, when LyX exported the Unicode glyphs to TIPA macros (such as \textschwa), itterminated those macros by braces (i.e., \textschwa{}). LyX did this in order to prevent LaTeX errors. Think of a Schwa followed bya b. Without the braces, this would result in \textschwab (instead of \textschwa{}b), and this would confuse LaTeX, because thecommand \textschwab does not exist. These braces, however, disturb the kerning. The correct solution would be a blank, i.e.\textschwa b, but this requires a much more complex algorithm. In LyX 2.1, this algorithm finally has been implemented, so thekerning problem is a thing of the past. Nonetheless, the more visible problem 1 (mixing of different fonts) remains.

So much for technical details. The following sections describe how to use LyX's dedicated IPA inset.

b.) Entering the IPA inset via the Menu

The easiest way to start IPA mode is to use the menu entry Insert→Special Characters→Phonetic Symbols, which will bring youto the IPA mode immediately (this menu entry was introduced in LyX 1.4.3).

As of LyX 2.1, there is an IPA toolbar which automatically opens when the cursor is inside the IPA inset. This toolbar is ordered byIPA categories and contains all supported glyphs and macros:

Page 5: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

This is probably the most convenient way to enter IPA symbols.

Alternatively, you can also enter text directly, using the shortcut characters that TIPA provides (see the appendix of the TIPAmanual for a list of all symbols and the corresponding shortcuts):

If the TIPA package has been installed correctly, this text will come out as phonetic notation in the DVI or PDF output. Moreover, aslong as LyX's Instant Preview feature is enabled, LyX will display the phonetic text inside LyX as soon as the cursor leaves themath inset. Voilà:

Page 6: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

As of LyX 2.0, you can also input or paste Unicode IPA glyphs into the IPA inset. LyX will automatically export them to the correctmacros in the output, and no font mixing will occur. Note though, that with LyX versions < 2.1, this has the kerning drawbacksdescribed above.

c.) If everything else fails: Using ERT

You can also use LyX's LaTeX mode (ERT) to enter any TIPA command. This should not be necessary, since LyX nowadayscovers the whole range of supported IPA glyphs (but see d)). Furthermore, you'll lose all the nice features of the native support,most notably Instant Preview, with the ERT approach.

d.) Missing symbols

In classic LaTeX, that is outside XeTeX/LuaTeX, the following IPA symbol is not supported yet (by the TIPA package, and hencenot by LyX):

The labiodental flap (ⱱ)

If you need this symbol, your best bet is to switch to XeTeX or LuaTeX. See this post on stackexchange.

Tables and Optimality-Theoretic TableauxUnlike some LaTeX editors, LyX allows you to edit tables visually, though its table formatting capabilities are somewhat limited.The most important OT-specific table formatting need is dashed vertical lines – the typical way of showing that two constraintscannot be ranked with respect to each other based on available evidence. Dashed lines are created using the package arydshln.Another need, which is formally somewhat superfluous, is table cell shading – the way to show the violations that are irrelevant to

Page 7: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

the fate of a candidate. See the LyX wiki page Tables or Help→Embedded Objects for more info about dashed lines and shading.

Here are some examples of tableaux:

Example file: comparative_tableau_example.lyx

Example file: data_tableau_example.lyx

Tableaux Floats and List of Tableaux:

The Linguistics Module provides a separate float for Tableaux as well as a List of Tableaux (with a separate counter). You can useboth the same way as table and figure floats, and find them at the same place (the float in Insert→Floats, the List of Tableaux inInsert→Lists & TOC). Note that the captions are always below the tableau by default, no matter where you put them in the LyXview. To get captions on top, put in preamble

Page 8: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

\floatstyle{plaintop}\restylefloat{tableau}

If your using a KOMA class and the option "tablecaptionsabove", use the following instead for better spacing:\floatstyle{komaabove}\restylefloat{tableau}

For LyX < 1.6, you have to create such a float yourself. The procedure is explained in this message to lyx-users.

Feature Matrices/Stuff in BracketsFor SPE-style feature representations in brackets, go to the Math Panel (Insert→Math→Math Panel) and click on the button toopen the delimiter and bracket dialog. Select square brackets from the many available options, and then click on the "insert matrix"button to insert a matrix (basically, a mini-table without grid marks) inside the brackets. You can specify the number of rows andcolumns inside the matrix in the emerging dialog box.

If you need to use the pound sign, #, inside math mode, you must type it in as \#, otherwise LyX will not recognize it as a validcharacter. If you want the text inside the matrix to not appear in italics, select the line and change it to text mode (see above).

Other Special Characters and DiacriticsThe Comprehensive LaTeX symbol list by Scott Pakin covers many of the symbols that can be produced with LaTeX. You caninsert them in LyX by means of ERT or in math-text mode as described above. Furthermore, LyX supports the direct input ofunicode characters as of version 1.5.0 (via Insert→Special Characters→Symbols...) and automatically translates these glyphs tothe according LaTeX macro on output (almost the complete list of Pakin and more should be supported).

For example, an acute accent on an "a" can be entered

as character á (if the keyboard supports it, maybe via a dead key or a key combination),

via the Symbols dialog,

via cut and paste from external sources,

with the accent-acute lfun (M-x accent-acute a),

Page 9: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

via the lfun unicode-insert 0x00e1 (where 0x00e1 is the unicode code point of the glyph á),

as ERT (Ctrl-l \'a).

Symbols such as arrows, zero, relations of domination, relative harmony, and so on can be found in the Math Panel. If you need toplace a primary/secondary stress (grave/acute accent) or an unstressed/short mark on top of a Greek letter, the easiest way isthe Math Panel/Frame Decorations.

If you need a pointy hand to mark the winner in your OT tableau, there are several options available in various packages. Thebbding package has a nice pointy hand with a cuff, which in ERT is entered as \HandRight. See The Comprehensive LaTeXsymbol list for more. If you use math, the pointy hand can be displayed in the LyX workarea via Instant Preview.

Using LyX to Draw Trees

PackagesThere are many LaTeX packages available for drawing trees, some are specifically designed for linguistic structure trees. All thesecan be used with LyX, although the integration differs:

1. The forest package. A tree drawing package specifically for linguistics which draws on tiKZ/PGF. Probably the mostpowerful and intuitive package currently available. Supports bracket (i.e. "qtree-style", see below) input syntax.

2. The qTree package (location on CTAN), which has introduced the nifty bracket notation to LaTeX (explained below). Takecare that you have a recent version of qtree that supports the pict2e package.

3. The pst-qtree package is a frontend for the PS-Tricks tree package pst-tree. It uses a similar syntax as qTree. Comparedto qTree, the package can do more complex things (such as traces and dotted branches); however, it does not work withpdflatex out of the box (look here for details), and you need to have PS-Tricks installed.

4. Ralf Vogel's xyling package, which is based on xypic.5. Koaunghi Un's xytree package, based on xypic as well. This package is quite similar to xyling, but differs a bit in the

syntax and in what you can do in detail.6. For extra power, you may have to resort to xypic itself (which is however not specifically designed for linguistic trees).7. Till Tantau's tiKZ, a quite powerful vector drawing package (similar to PSTricks) included to the PGF bundle, can draw trees

as well (and is the base for the forest package mentioned above). It has a quite intuitive syntax, but is an overall complexbeast. You can use it as an extension to forest.

8. tikz-qtree adds a(nother) wrapper around tiKZ and allows the use of the qTree syntax for tiKZ trees. In a similar vein as pst-qtree (which was written by the same author, David Chiang), and like forest, it aims to combine the intuitiveness of qTree

Page 10: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

with the power of tiKZ.

The choice of the package depends on your needs and taste. Here are some pros and cons:

The Qtree approach (plain qtree):PRO: the user interface is much more intuitive as xyling's (unless you are already familiar with the xypic syntax).PRO: works with pdflatex out of the boxPRO: works with Instant Preview for a WYSIWYG experience (however, for more complicated trees it is advisable toput trees in an ERT snippet).CON: the nodes are not nicely aligned.CON: rather limited possibilitiesRECOMMENDED for drawing simple trees, and if the nodes of the tree (i.e., the phrases) do not need to be aligned

The XY approach (XYLing, XYTree):PRO: much more features for complex trees than plain qtree (traces and other nifty things)PRO: better control over the alignment of nodesCON: the interface is less intuitive (however, the packages come with an excellent step-by-step manual)CON (only XYLing): for pdflatex, the package must be modified (see comment in xyling.sty)CON: no Instant Preview.RECOMMENDED for drawing complex trees and if all nodes have to be aligned

The Qtree emulators (pst-qtree, tikz-qtree):PRO: intuitive syntax (same as qtree)PRO: much more features for complex trees than plain qtree (traces and other nifty things)CON (only pst-qtree): does not work with pdflatex out of the boxCON: the nodes are not nicely aligned.RECOMMENDED for drawing complex trees and if the nodes of the tree (i.e., the phrases) do not need to be aligned.

The TiKZ approach (plain tiKZ, not tikz-qtree):PRO: rather intuitive syntax (not as intuitive as qtree, but still much more intuitive than XY)Many possibilities for nifty graphic polishmentCON: not specifically aimed at linguistics, so maybe involves more digging.

Forest:

Page 11: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

PRO: combines the intuitiveness of the QTree syntax with the power of TiKZComes with "styles" for specific linguistic needs.Aligns nodes very nicelyExcellent support for arrows and stuffMany possibilities for nifty graphic polishmentGood documentationCONS: None known yet (but not yet extensively tested)

Structure Tree support as of LyX 2.2.0As of version 2.2, LyX will support the forest package out of the box (via the Linguistics Module). Insert a Structure Tree inset viaInsert→Custom Insets and enter the bracket notation (documented in the forest manual). If you use the Preview Inset, you will alsoget instant preview of the tree:

You can easily align the nodes of the tree vertically, via the "tier" option:

Generating roofs (via the "triangle" option) is easily possible as well:

Page 12: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

As mentioned above, the package also lets you easily generate movement arrows and other nifty things. It is also possible togenerate other kinds of trees (Prosodic Structure Trees, Autosegmental Trees, Right-side-up trees, lattices, OT Hasse trees oreven non-linguistic trees and taxonomies) with the forest package and the respective LyX inset. Please refer to the voluminousforest manual for details.

Structure Trees in LyX < 2.2.0Simple Trees with qTree

Install the qTree package and then put \usepackage{qtree} into your preamble. Make sure that Instant Preview is activated. Thenhit C-M twice to switch to math-text mode, and type for example the following text (the blanks are important):

\Tree[.S [.N This ] [.V is ] [.NP [.Det a ] [.N test ] ] ]

After the cursor has left the inset, the tree should be displayed inside LyX:

Page 13: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

Alternatively, you can write the text outside math mode, select it, and hit C-M to convert it to math (see here).

If the branches of the tree vanish in your preview, you are facing a bug in dvipng, the converter used by Instant Preview togenerate the preview images for LyX. The bug has been reported to the dvipng developer and he has fixed it for the upcomingversion 2.0 of dvipng. So watch out for dvipng >= 2.0 and upgrade to that.

Roofs (qTree)

Roofs (for complex phrases) can be inserted with the \qroof command. In LyX, you can insert this by typing \qroof{ at theappropriate place in the formula. As soon as you have typed the curly bracket, a new subinset is created:

There you can type the phrase inside this sub-inset, which is then marked as follows.

Page 14: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

Here's the Instant Preview display after the cursor left the inset:

Glosses (qTree)

To put glosses under the nodes of a tree, you have to fool the Math Editor. In qtree, this can be done with the linebreak command\\, but the math editor does not accept that. So put in the preamble:

\renewcommand{\breaknode}{\\}

Then you can do:

\Tree[.S [.N Das\breaknode This ] [.V ist\breaknode is ] [.NP [.Det ein\breaknode a ] [.N

Versuch\breaknode test ] ] ]

This also works inside qroofs.

Prosodic Structure Trees/Greek Symbols in Trees (qTree)

If you want to include Greek letters such as sigma for syllable nodes or mu for morae, you have to enter math-math mode(embraced in $...$) while keeping the tree in math-text mode. The greek symbols must then be entered in LaTeX code, whichrequires putting them between dollar signs, as in:

\Tree [.$\sigma$ $\mu$ $\mu$ ]

Page 15: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

Instead of manually inserting the dollar signs, you can also switch to math-math mode before entering the Greek letters bypressing again C-M. Then you can enter just, for instance, \sigma, which will be converted to the symbol (after you hit <space>).Don't forget to return to text mode again after the Greek letter by leaving the subinset (in math mode, spaces are impossible).

This will produce a simple syllable (sigma) branching into two morae (mu), viewable via Instant Preview inside LyX.

Autosegmental trees (qTree, xyLing)

For simple feature-sharing trees, qtree is again recommended, as it can handle multiply branching trees and does not requireyou to define the position of the nodes for the branches to connect them correctly. If, however, you need to write a spreading rulewith a dashed line, you need something more powerful, such as xyling. Unfortunately, as noted, the package does not seem tobe supported in Instant Preview, so you have to use ERT. Here are a couple of examples and the trees they produce:

[\Tree {\K{[back]} \B{d}\Bdash{dr} \\ \K{V} & \K{V}}]

[\Tree{\K{[back]} \D\Bdash{dr}\Bdash{drr} \\ \K{V} & \K{V} & \K{V}\B{d} \\ & & \K{[-low]}}]

To do autosegmental delinking, you need xypic (which is the basis for xyling). Here is an example, along with the code thatproduced it. See XY-pic for more.

Page 16: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

example file

"Right-side-up" trees, lattices, OT Hasse trees (ranking diagrams)

The package xyling can do upward-pointing and crossed branches. See its manual for details.

Using LyX to display numbered examples with CovingtonThe package Covington provides several useful features for linguistics. One of the most convenient one is a sequentiallynumbered environment that can span several sections. Your numbered examples will look as follows:

Page 17: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

The package provides the environments example (for single examples) and examples (for multiple, subsequent examples). Thesecan be used by means of ERT, but the Linguistics Module also provides native support for them. This is described in what follows.

Covington environment support in LyXLoad the Linguistics Module and you will find styles for Numbered Examples (multiline) (covington's example environment),Numbered Examples (consecutive) (covington's examples environment) and for Subexamples (additionally defined by LyX) inthe paragraph style combo box.

This will make every Covington-numbered example display in blue font but without a number; the document will typeset in anormal way and you can cross-reference Covington-numbered examples in the text as usual (by inserting a label and a crossreference). This is how your screen will look for the Covington example above:

Page 18: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

Adjusting Covington ExamplesCovington's example style is aimed at typical use, which means that it needs to be adjusted for specific uses. Here are someadvices how to do that in Q/A form.

How can I change the label of the subexamples?Up to LyX 2.1, place [(whatever)] in TeX mode at the very beginning of the subexample.As of LyX 2.2, use Insert→Custom Numbering.

How can I adjust the example(s) indentation?Covington has a fixed indentation that fits well if the example number is not too large. However, with more than 99 examples

Page 19: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

or if you use a book class, where covington numbers chapterwise [e.g. (1.10)], the indentation looks odd especially for multi-line examples.You can adjust the indendation with the following preamble code (adjust the values if needed):

\let\oldexamples\examples\let\endoldexamples\endexamples\renewenvironment{examples}{% \setlength\leftmargini{3.05em} \begin{oldexamples}% \settowidth{\labelwidth}(0.00)%}{\end{oldexamples}}

\renewenvironment{example}{% \setlength\leftmargini{3.05em} \begin{examples}% \settowidth{\labelwidth}(0.00)% \item%}{\end{examples}}

How can I make Covington number my examples consequently, not per chapter?Covington (mis)uses LaTeX's equation counter, so you need to adjust this counter in your preamble as follows:

% use package remreset to omit counter resetting on new chapter\usepackage{remreset}\@removefromreset{equation}{chapter}% redefine equation counter (do not prepend chapter number)\renewcommand{\theequation}{\arabic{equation}}

If you just want to omit the chapter prefix and still want to have the examples start from (1) at each chapter start, just use thelast two lines of the code.

How can I fix the vertical alignment of the example number if the example includes a table/tableau?

Page 20: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

If you are using a table (e.g. an OT tableau) as the content of an example, the default is for the example number to alignvertically with the center of the table if no title/comment is included before it within the example. To adjust this so that theexample number is by the top of the table, enter the "Table Settings" dialogue and, in the "Table-wide settings" box, changethe "Vertical alignment" setting to "Top".

Aligned Glosses (Covington)Often linguists need to have a list of examples which are glossed word by word. A great package for this is, again, Covington.

Up to LyX 2.1, the Linguistics Module only provides some basic support for covington glosses, that is, you still needed LaTeXsyntax, particularly for foreign languages and scripts (including IPA). LyX 2.2 will introduce a rewritten Glosse support that gets ridof the shortcomings of the original implementation. It lets you insert and format normal text just like outside the Glosseenvironments. The new implementation features a dedicated "translation" subinset (via Insert→Glosse Translation) and an insetfor grouping words (via Edit→Text Style→GroupGlossedWords):

Generally, glosses are inserted as follows (in all versions of LyX): After you have loaded the module, you will find two insets"Glosse" and "Tri-Glosse" in Insert→Custom Insets. As the screenshot above shows, a sentence and its glossed translation areinput into the inset, just as two consecutive lines (for Tri-Glosse, that are obviously three).

Up to LyX 2.1, the last line – the mandatory (grammatically well-formed) translation – must be preceded by \glt (not in ERT, justverbatim):

Page 21: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

As of LyX 2.2, this will no longer be necessary and not even possible (instead, use the sub-inset described above).

The last example also shows how you can number the glosses: Just put the Glosse inset into an "Examples" paragraph.

The PDF output, then, looks as follows:

Note: If you open old documents with LyX 2.2, they will be converted and the old Glosse insets will be automatically transformedto the new format. Within this process, however, all Glosse text will be wrapped into TeX mode insets. This is necessary since,in the old format, text was handled "verbatim", i.e. like in TeX mode. You can dissolve those insets, but you need to take careabout verbatim commands, which need to be replaced by normal text input manually (alternatively, you can simply proceed withthe TeX mode, which should work as expected).

Using covington (glosses and examples) in a beamer presentationThe covington package and the beamer class do not work together out of the box, since they both try to define the commands\example and \examples, which triggers a LaTeX error. This can be worked around by the following code in Document → Settings→ Local Layout:

Provides covington 1AddToPreamble \let\example\relax

Page 22: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

\let\endexample\relax \let\examples\relax \let\endexamples\relax \usepackage{covington}EndPreamble

This effectively defuncts beamer's example(s) environment in favour of covington's.

Furthermore, if you want to use glosses in beamer, you need to put it in a "fragile" frame.

See LyX's linguistics manual for further tips and tricks.

Semantics

MarkupThe Linguistics Module that ships with LyX provides some semantic markup for "expression" (emphasized by default), "concept"(small caps by default) and "meaning" (enquoted by single quotes by default). The definitions can be changed in the preamble.

Logical SemanticsFortunately, the logical semantics notation is pretty much covered by LyX's math mode. So if you want to insert logical semanticnotation, do as if you would want to insert a math formula. You'll find most of the required symbols in the Math Panel(Insert→Math→Math Panel). If you are a bit familiar with the LaTeX notation of that symbols, you can enter them directly into theformula. LyX will convert them for you. With Instant Preview enabled, you'll even get a WYSIWYG display in LyX.

Other stuffThere are packages available for other semantic needs:

Discourse Representation Structures (DRS) can be noted by means of Covington, the sdrt or the drs package.(please fill in...:-)

Conversation AnalysisIn Conversation Analysis, turns need to be aligned horizontally in order to mark overlaps, turn takings, etc. LyX does not allowmultiple blanks and does not have a tabulator, so this cannot be easily done in the normal text environment. However, the

Page 23: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

alignment can be managed quite well either with LaTeX's tabbing environment or with the listings package. Both approaches aredescribed briefly in what follows.

CA transcription with tabbingUnfortunately, LyX does not yet support tabbing natively, so we are stuck with TeX mode.

Consider the following simple example:

\begin{tabbing}1 \=Peter: \=Do you know [=LyX=] \=the the document\\2 \>Mary:\>\>yeah I know\end{tabbing}

With \= you save a position, at which \> will push the text. Note that <Return> does not work inside tabbing; you have to uselinebreaks (\\). To adjust the vertical space, you can also use the optional argument of the linebreak, e.g. \\[\baselineskip].

Caveats:Inside tabbing, the lines are not broken automatically. You have to do it manually to prevent the lines go into the margin.The tabbing environment redefines the LaTeX's accent commands. If you use accents, you'd better try the package Tabbingwhich does not touch the accent commands and provides another tabbing syntax instead.

If you need arrows and other symbols for your notation, you'll most likely find them in the Math Panel. If not, read this.

CA transcription with listingsA slightly more convenient (but also more limited) approach uses the listings package, which is normally used to typeset computercode. Listings are natively supported by LyX (Insert→Program Listing).

The following document explains how to (mis)use listings for CA trascription:

LyX documentPDF output

Switching languages

Page 24: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

To switch languages, e.g. between English and Greek, go to Edit→Text Style→Customized...→Language and select therespective language (e.g., "Greek"). This will apply to all following text (or the selected text). If you select "reset", the language willbe reset to the document's main language (as set in Document→Settings→Language).

Secondary languages (i.e. those differing from the document's main language) are marked by a blue underline.

If the respective spell checking dictionaries are installed, LyX will spellcheck all marked passages in the allocated language.

Once a language is used in the LyX document, you can switch to it more easily via the context menu (right-mouse-button press,then go to the "Language" submenu).

If you need to switch languages a lot, opening the text style dialog every time or even the context menu might be too clumsy. Tospeed up the workflow, you can define keyboard shortcuts for your common languages:

go to Tools→Preferences→Edit→ShortcutsHit the "New" button to add a new shortcutenter "language <language name>" to the function command, e.g. "language english" or "language ngerman" (see the filelanguages in the LyX system directory for a list of valid language names)press the grey shortcut fieldEnter the shortcut of your choice (e.g. Alt+l+e for English, Alt+l+g for German)Hit OKHit ApplyHit Save

Now you can switch to English by just pressing Alt+l+e (or whatever keyboard shortcut you have defined). Note that the languagefunction acts as a toggle. I.e., if you mark a foreign German passage of text and press Alt+l+g (for German), the language of thepassage will be reset to the document's main language.

Note that in older (< 1.5) versions, only one kind of writing system will be displayed inside LyX (i.e. Latin letters instead of Greekones if the main language is English). In the PDF output, however, the correct writing systems (Roman alphabet for English,Greek alphabet for Greek) are used. Since as of version 1.5, LyX uses the unicode encoding internally, it can to display severalscripts in parallel.

LyX also supports different keyboard mappings. So, to switch between English and Russian, for instance, switch to the Cyrillic

Page 25: Wiki Lyx Org LyX LinguistLyX

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

keyboard layout of your OS when you need to type in Russian, and switch back when you need English. Both Russian and Englishwill be displayed in LyX. Note, though, that you will need to set the language (Russian, in this case) yourself (as described above).

BibliographiesLyX has native BibTeX support for bibliographies. By default, LyX is configured to use the bibliography style plain, which is usedin other sciences and which cites references in text by number rather than by name and date. Most linguists will probably not find ituseful. If you need to use a bibliography style similar to that of Linguistic Inquiry or Language, you should use biblatex or thenatbib or the jurabib package (see this page for information on the differences of those packages). To find out more aboutusing BibTeX in LyX, see the BibTeX section on this wiki and LaTeX for Linguists/Bibliographies (the main page for LaTeX forLinguists at that page is wrong and should be http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/). A bare-bones guidewhich should suit linguists' basic needs is included in the LyX for Humanities page.

A bibliography style popular among linguists is linquiry2.bst. It's designed for natbib.

List of PublicationsYou can generate a list of your own publications semi-automatically, using BibTeX or Biblatex. See this page for details.

Acknowledgment footnoteIt is common in linguistics articles to label the acknowledgment footnote (usually the first footnote) with an asterisk rather than witha regular number. To accomplish this in LaTeX, put the following in ERT: \thanks{text of your acknowledgment footnote}. Note thatin the title environment, LyX automatically outputs footnote insets as \thanks, so you can just insert a footnote as usual.

Table Symbol Tree Numbering Footnotes Humanities Linguistics

Edit - History - Print - Recent Changes - All Recent Changes - SearchPage last modified on 2015-04-22 17:05 CEST