LyX v2.4.0 RC4 -> Unicode in Program Listing (again...)

Bernt Lie Bernt.Lie at usn.no
Mon Apr 22 13:41:42 UTC 2024


I’m still struggling with getting LyX (v2.4.0 RC4) to work with Unicode in Program Listing, although I have made *some* progress.

I have installed font family ”JuliaMono” on my computer; this font supports Unicode (at least a subset) – as illustrated for MS Word:
[cid:image005.png at 01DA94C6.D5B9A5C0]

I have done the following modifications to the set-up of LyX:

  *   In Document/Settings/Fonts:
[cid:image001.png at 01DA94C7.2927AE00]

[cid:image002.png at 01DA94C7.2927AE00]


  *   In Tools/Properties/File Handling/Converters:
[cid:image003.png at 01DA94C7.67C7EFD0]


  *   In LyX editor (Koma script):
[cid:image004.png at 01DA94C7.CC0A70D0]

  *   First line is ordinary text (Standard) – copes decently with Unicode (although JuliaMono in Word fares better).
  *   Second line is Program Listing – doesn’t look very nice in the LyX editor

When I try to do

  *   Documents/View/PDF (LuaTeX), I get:

[cid:image010.png at 01DA94C8.59809520]
[cid:image011.png at 01DA94C8.59809520]

My interpretation:

  *   The “missing glyphs! Errors message is due to the text in the body text (Standard)
  *   Program Listings appears to handle the Unicode, but there is a surprising line shift before the equality symbol

QUESTIONS:
Three remaining “problems” to solve:

  1.  Why is a line feed inserted in front of the equality symbol?? [Some line feed error occurs if there is nothing or space or tab in front of the symbol with dot on top; if I insert, say, a comma, etc. in front of the dotted symbol, then it works…]
  2.  How can I associate Ctrl+R with PDF (LuaTeX) instead of PDF (XeTeX)?
  3.  How can I specify the JuliaMono font in the *default* Settings for listing, so that I don’t have to go into the local listing settings every time I imsert a Program Listing? In other words…
[cid:image012.png at 01DA94C9.BCE7DBE0]

              Can I specify another font family for “basicstyle” than “pcr”? I.e., how to specify “JuliaMono” here?

-BL





From: lyx-users <lyx-users-bounces at lists.lyx.org> On Behalf Of Bernt Lie via lyx-users
Sent: Wednesday, April 17, 2024 3:17 PM
To: lyx-devel at lists.lyx.org; lyx-users <lyx-users at lists.lyx.org>
Subject: RE: LyX v2.4.0 RC4 -> Unicode in Program Listing (again...)

OK… I just found I had put the “-shell-escape” string in the wrong cell…

I have now changed the preferences, and inserted this string in both of the XeTeX and LuaTeX converters from LaTeX to PDF.

Now, I get the (expected) warning that using the “-shell-escape” string is *dangerous*.

Question 1:

  *   Dangerous, because LyX is more likely to *crash*, or
  *   Dangerous, because it opens up my computer to hacking??

Experience – here is some listing in LyX:
[cid:image006.png at 01DA94C6.D5B9A5C0]
This expression is taken from a Jupyter Notebook running in VSCode (language: Julia), where the symbols are created by “\frakm + TAB \dot + TAB = m\dot + TAB v”
…and here is what it looks like when I use XeTeX/LuaTeX:

[cid:image007.png at 01DA94C6.D5B9A5C0]

Questions 2:

  *   Could I expect a better response if I install a font that supports Unicode, and specifies this font in the fonts scheme of Listings?
  *   If I install such a font with Unicode support (e.g., JuliaMono), would that rule out using XeTeX so that I should use LuaTeX?

Question 3:

  *   If I should use LuaTeX, how can I change LyX so that issuing command Ctrl+r produces the PDF using LuaTeX?

-B

From: Bernt Lie <Bernt.Lie at usn.no<mailto:Bernt.Lie at usn.no>>
Sent: Tuesday, April 16, 2024 7:22 PM
To: Bernt Lie <Bernt.Lie at usn.no<mailto:Bernt.Lie at usn.no>>; lyx-devel at lists.lyx.org<mailto:lyx-devel at lists.lyx.org>; lyx-users <lyx-users at lists.lyx.org<mailto:lyx-users at lists.lyx.org>>
Subject: LyX v2.4.0 RC4 -> Unicode in Program Listing (again...)


OK -- this is the status on my on-going experimentation on Windows 11... (I hope I'm almost there):



1. I experiment with KOMA script Book

2. I have:

    * Upgraded all packages in MikTeX

    * Installed Pygments ("pip install Pygments" in Windows Prompt)

    * Figured out where the "pygmetize" script is located on my computer,

              and added location to PATH.

    * In the LyX document, Documents/Settings/Fonts, checked "use non-TeX fonts

    * In the Documents/Settings/Listings, changed "Syntax Highlighting Package" to "minted"

              [This didn't work until I set the PATH to "pygmetize"]

    * In Tools/Preferences/File Handling/Converters, added "-shell-escape" at the end

              of the Converter line:

[cid:image008.png at 01DA94C6.D5B9A5C0]

              [This line is slightly different from the Embedded document, since that assumed pdflatex as converter).



3. STATUS:

[cid:image009.png at 01DA94C6.D5B9A5C0]



QUESTION 1: What is wrong? I *did* envoke the “-shell-escape” flag, didn’t I?



QUESTION 2: By default, Ctrl+R is keyboard shortcut for generating PDF via pdflatex. After I chose “use non-TeX fonts”, Ctrl+R implies generating PDF via XeTeX. How can I change the set-up so that Ctrl+R implies using luatex?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 5490 bytes
Desc: image005.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0012.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 2920 bytes
Desc: image006.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0013.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.png
Type: image/png
Size: 1224 bytes
Desc: image007.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0014.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image008.png
Type: image/png
Size: 9676 bytes
Desc: image008.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0015.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image009.png
Type: image/png
Size: 24748 bytes
Desc: image009.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0016.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 5625 bytes
Desc: image001.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0017.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 4054 bytes
Desc: image002.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0018.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 13715 bytes
Desc: image003.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0019.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 4770 bytes
Desc: image004.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0020.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image010.png
Type: image/png
Size: 7622 bytes
Desc: image010.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0021.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image011.png
Type: image/png
Size: 3125 bytes
Desc: image011.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0022.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image012.png
Type: image/png
Size: 10848 bytes
Desc: image012.png
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20240422/3f71f03d/attachment-0023.png>


More information about the lyx-users mailing list