Insert listing -- from file?
Bernt Lie
bernt.lie at usn.no
Tue Feb 3 14:57:06 UTC 2026
Using LyX v2.5 RC2, on Windows 11, latest update
I am still struggling with inserting computer code from files into LyX. Below, I show 3 listings from the PDF preview. The computer language I have used is Julia, and I use the JuliaMono font, which handles Unicode.
For code without Unicode, the plan is to use the listings package. I have tried to use syntax highlighting colors as they are in VSCode, but with slightly more saturated colors. See listing example 1.
For code with Unicode, the plan is to use the minted package. I then insert the file name in an ERT (Ctrl-L). As seen in listing 2 (which replicates listing 1, but without Unicode symbols), the colors are off. And I am not able to figure out how to change the colors for the minted package. Several AI tools suggest that the colors are picked from a "default.py" pygment, but changing colors there has zero effect.
Just to illustrate that Unicode import works, I have included listing 3. Same problem with colors there.
[cid:419521d1-fb5e-43ec-91b0-ca703c0388f8]
So — the first problem I am facing is:
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).
I have a second problem, and that is how to insert caption and labels for the minted package. But I need to solve the color problem first.
Any advice? If it helps, I can of course share my Preamble.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20260203/a155149b/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 166439 bytes
Desc: image.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20260203/a155149b/attachment-0001.png>
More information about the lyx-users
mailing list