Re: Insert listing -- from file?

2026-02-03 Thread Jürgen Spitzmüller
Am Dienstag, dem 03.02.2026 um 14:57 + schrieb Bernt Lie via lyx-
users:
>    1. Where on earth does LyX with the minted package read the color
> specifications? Where/how can I changed them? (I have also tried to
> specify them in Preamble, but no success).

Minted uses styles which you can set with the style option, in preamble

\AtBeginDocument{\setminted{style=name}}

Available styles are here:
https://pygments.org/styles/

> I have a second problem, and that is how to insert caption and labels
> for the minted package.

If you insert the listing from a file: In the settings dialog of the
file/programlisting insert inset.

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


Re: Insert listing -- from file?

2026-01-31 Thread Jürgen Spitzmüller
Am Freitag, dem 30.01.2026 um 17:18 + schrieb Bernt Lie:
> 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?

Yes. This package only works with child documents (which are also
supported by standard listings, but not for utf8).

Standard listings is loaded automatically by LyX (and also by
listingsutf8), so you only need to manually load listingsutf8 when
needed.

> 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? 

It uses whatever Typewriter font you set in Document settings.

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


Re: Insert listing -- from file?

2026-01-30 Thread Bernt Lie via lyx-users
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  on behalf of Jürgen 
Spitzmüller 
Sent: Friday, January 30, 2026 1:49 PM
To: [email protected] 
Subject: Re: Insert listing -- from file?

Am Donnerstag, dem 29.01.2026 um 10:06 + 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


Re: Insert listing -- from file?

2026-01-30 Thread Jürgen Spitzmüller
Am Donnerstag, dem 29.01.2026 um 10:06 + 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