Hello,

I would like to report that inserting a list of listings creates errors with 
book document classes.

Environment:

I compiled LyX 2.4.2.1 on Ubuntu 22.04 with Qt6 enabled.

Steps to reproduce:

1. Create a new document: File > New
2. Set the document class to one of the book classes, for example Koma-Script 
Book
3. Insert a list of listings: Insert > List/Contents/References > List of 
Listings
4. Try to compile the PDF document: Document > View [PDF (pdflatex)]

Expected result: The document is compiled successfully.

Actual result: Various errors depending on the document class.

Additional information:

This is the LaTeX code typically generated by LyX when adding a list of 
listings:

    \documentclass{scrbook}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage{listings}
    \renewcommand{\lstlistlistingname}{\inputencoding{latin9}Listings}

    \begin{document}
    \lstlistoflistings{}
    \end{document}

Adding the following ERT at the beginnig of the document prevents errors :

    \renewcommand{\lstlistlistingname}{Listings}

I suspect the errors are happening because LyX automatically add a line in the 
preamble that contains \inputencoding{latin9}
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to