1

I am writing a document in the memoir document class, using LyX.

The document main language is Hebrew (minority of the document is in English), and I use polyglossia and XeTeX to handle the languages, so that my doc preamble is

\documentclass[oneside,a4paper,10pt,twoside]{memoir} \usepackage{polyglossia} \setdefaultlanguage{hebrew} \setotherlanguage{english} 

When I insert an English index entry into my document, instead of creating the tex command

\index{Dirac, Paul} 

LyX creates something else.

With enter image description here I get

\index{Dirac, Paul@\textenglish[variant=american]{Dirac, Paul}} 

and with enter image description here I get

\textenglish[variant=american]{\index{Dirac, Paul}} 

(The blue understroke indicates foreign language)

Turns out that the more correct usage is the later, but the former is a bit more comfortable to use.

Can I change the former usage to be without this extra @ and stating the entry twice? A colleague of mine has told me that this behavior of LyX is not the same on his machine.

1
  • If you don't get an answer here, I suggest you send a minimal example .lyx file to the lyx-users mailing list. Commented Jan 9, 2022 at 14:03

1 Answer 1

1

After a discussion with the LyX team in the mailing list, it turns out that this is overall correct. The string before the @ is a sorting key. The second example shown in the question is the closest to the input a LaTeX user would have done.

You can bypass this behavior by inserting the following into a local layout of the document (or by creating a module file with this code and "installing" it in the layouts directory of LyX):

Format 60 InsetLayout Flex:index LyXType custom LabelString "Index" LatexType Command LatexName index Decoration classic End 

Then insert an index entry with Insert -> Custom Insets, then choose index.

The tex output with this method is

\index{\textenglish[variant=american]{Dirac, Paul}} 

For more information about custom insets, see the LyX customization manual.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.