## LaTeX forum ⇒ LyX ⇒ How to prevent LyX from using natbib commands - Tufte Handout layout bug

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
juliendutant
Posts: 5
Joined: Sat Aug 27, 2016 1:46 pm

### How to prevent LyX from using natbib commands - Tufte Handout layout bug

LyX's new bibliography management is great, but it seems to have broken down the Tufte Handout layout. I think the solution would be to update the layout to tell LyX to use \cite instead of \citep and \citet commands, or at least to make available "Basic Numerical" variant in the Settings, or "[#ID]" citations in the citation dialog box. And to do so even though the tufte-handout class loads natbib. Does anyone know how to do this?

The bug with Tufte Handout

Create a new document with a BibTex bibliography that uses the Natbib (BibTex) engine. Put a citation in your document. Now change the document class to Tufte Handout. Compile. You will notice that the citation appears in your text, e.g. as [1] or (Author 2012). But Tufte Handout citations should appear in full as margin notes.

Now in the LyX file insert a raw LaTeX box with a cite command: \cite{AuthorXXX}, where AuthorXXX is a bibtex key from your bibliography. Compile. You will see that the citation appears as a margin note, as desired in this layout.

I also encounter a bug when I start with a document with a Bibtex bibliography using the Basic (BibTex) engine. When I convert it to Tufte Handout, in the Document Settings the biblio engine is locked to Natbib (BibTex), but the variant remains empty. In my case, this document doesn't compile: I get a LaTeX error of option clash on the package textcomp ("The package textcomp has already been loaded with options: [], There has now been an attempt to load it with options [full]). Selecting one of the natbib variants doesn't help.

The old Tufte Handout document that works

If you load the LyX example file for Tufte Handout, however, you'll see that it compiles well. The citations, in particular, appear in full in margin notes as they should. If you export the document as LaTeX (pdflatex), you will notice that it uses \cite commands, not natbib's \citet and \citep. This is how the tufte-handout class works: it loads natbib to typeset full citations, it leaves \citet and \citep as inline citations, but it uses \cite for its preferred way of citing: full citation in a margin note.

For LyX to handle that well, it must accept that natbib is loaded, but allow the "Basic numerical" citing style. This is what happens with that old lyx file works. If you look at its Document settings > Bibliography, you'll notice something strange: the citation format is locked on "Natbib (BibTex)" with the variant "Basic Numerical". Somehow this allows LyX to know that Natbib is loaded, but still use \cite commands.

The problem is that it's not possible to enter that set-up manually. If you start from a new file, as I explained above, you won't get the desired citations unless you enter them as raw latex code.

So as it stands the only way to use Tufte-Handout is to load the example file and modify it.

How to solve the bug?

Ideally we would want the tufte-handout.layout file to:

(a) lock Natbib (Bibtex) as the engine, but
(b) enforce, or at least make available, basic \cite commands in the citation dialog.

Does anyone know if that can be done? Tufte Handout is a great layout, it'd be great to make it work out of the box again.