OK... I am curious about inserting a listing as a file/child document. I have 
got that part working. It seems to do the same as if I insert a TeX code:

\lstinputlisting[
language=Julia,
caption={Testing},
label={lst:test}
]{C:/Users/Be..._Test_Code.jl}

Your suggestion is more elegant than inserting a TeX code, though.

> Listings does not support utf8 in any engine, except for file listings
> UTF8 files are supported if you manually load

> \usepackage{listingsutf8}

> in the preamble and then put

> inputencoding=utf8/latin1

> to the "more parameters" widget in the file inclusion dialog.

OK — does this mean that I can use package "listingsutf8" when I add listings 
as a child document, and use the standard listings package otherwise?

How do I choose a font set that supports Unicode? (I have JuliaMono installed 
on my computer; that one supports Unicode). Do I have to specify the font also 
in the inclusion dialog, or do I have to use the same font as in the standard 
listing package?

[Sorry for detailed questions — the EmbeddedObjects document is not very 
detailed.]




________________________________
From: lyx-users <[email protected]> on behalf of Jürgen 
Spitzmüller <[email protected]>
Sent: Friday, January 30, 2026 1:49 PM
To: [email protected] <[email protected]>
Subject: Re: Insert listing -- from file?

Am Donnerstag, dem 29.01.2026 um 10:06 +0000 schrieb Bernt Lie via lyx-
users:
>    1. The default installation (MikTeX, pdflatex) does not support
> unicode in listings.
> a.. If I continue to use MikTeX, but change to another tool than
> pdflatex, will that make it possible to use Unicode?

Minted supports unicode both with pdflatex and modern engines. See the
UserGuide, sec. 8.

Listings does not support utf8 in any engine, except for file listings
(see below)

> Is it simpler to use Unicode in listings in other OS:s, e.g., on a
> Mac?

No.

>    2. I would like to link in a file with listing, instead of
> manually pasting in code into the listing inset. Is there a way to do
> that?

Yes, via Insert > File > Child Document (if you select "Program
Listing" as Include Type). Again, see sec. 8 of the UserGuide.

UTF8 files are supported if you manually load

\usepackage{listingsutf8}

in the preamble and then put

inputencoding=utf8/latin1

to the "more parameters" widget in the file inclusion dialog.

HTH,
--
Jürgen
--
lyx-users mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-users
-- 
lyx-users mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-users

Reply via email to