[NTG-context] issue with scite module
Max Chernoff
mseven at telus.net
Fri Jun 3 00:52:38 CEST 2022
> For the sake of consistency (with buff-imp-xml.lua), I think the patch
> should read
> [...]
> +local alsoname = lpatterns.utf8two + lpatterns.utf8three +
> lpatterns.utf8four
I think that that pattern is a little too broad, since it will match any
non-ASCII Unicode character. Things like U+202E (xkcd.com/1137), U+00A0
(no-break space), etc are valid UTF-8 characters, but not valid XML tag
names. Neither of these two characters are matched by the TeX catcode
check. This doesn't make any real difference for a syntax highlighter
though.
> +local name = (R("az","AZ","09") + S("_-.") + + alsoname)^1
There's a doubled plus in the middle there. The patch works when I
remove it.
> But I’m afraid I cannot make it work on my computer (Linux64).
>
> On another Win64 computer, both patches worked perfectly fine.
Hmm, that's really weird. Both patches work for me on my main Win64
computer (after I fixed the extra plus). I also pulled the
"contextgarden/context:lmtx" Docker image (Debian sid), and both patches
worked there too. I get this from inside the container:
root at e8d29a32595c:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux bookworm/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root at e8d29a32595c:~# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
root at e8d29a32595c:~# xxd test.tex
00000000: 5c75 7365 6d6f 6475 6c65 5b73 6369 7465 \usemodule[scite
00000010: 5d0a 5c73 7461 7274 7465 7874 0a5c 7374 ].\starttext.\st
00000020: 6172 7454 4558 7061 6765 5b6f 6666 7365 artTEXpage[offse
00000030: 743d 3165 785d 0a5c 7479 7065 5b6f 7074 t=1ex].\type[opt
00000040: 696f 6e3d 786d 6c5d 7b3c 616e 732f 3e7d ion=xml]{<ans/>}
00000050: 0a5c 7479 7065 5b6f 7074 696f 6e3d 786d .\type[option=xm
00000060: 6c5d 7b3c c3a1 c3b1 c39f 2f3e 7d0a 5c73 l]{<....../>}.\s
00000070: 746f 7054 4558 7061 6765 0a5c 7374 6f70 topTEXpage.\stop
00000080: 7465 7874 0a text
root at e8d29a32595c:~# context --version
mtx-context | ConTeXt Process Management 1.04
mtx-context |
mtx-context | main context file: [snip]
mtx-context | current version: 2022.05.11 11:36
mtx-context | main context file: [snip]
mtx-context | current version: 2022.05.11 11:36
ldd "$(type -p luametatex)"
linux-vdso.so.1 (0x00007ffdbe9a5000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4b034d4000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f4b034b3000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4b0336f000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4b03196000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4b03a55000)
Is this perhaps a weird locale or encoding issue? Maybe try compiling with:
LC_ALL=C.UTF-8 LANG=C.UTF-8 context test.tex
or
LC_ALL=POSIX LANG=POSIX context test.tex
I'm surprised Linux is the one not working here, since it's usually
Windows that has text encoding issues with its weird hybrid of DOS
codepages and UTF-16+BOM.
The only other thing that I can think of is a weird library issue with
your distro, but LuaMetaTeX is statically linked. Not sure what else to
check here.
-- Max
More information about the ntg-context
mailing list