<q> tag prevents ebook generation in PreTeXt-CLI (Windows only?)

27 views
Skip to first unread message

gedeoned...@gmail.com

unread,
Sep 7, 2022, 4:57:44 AM9/7/22
to PreTeXt development
Hello everybody,
I greatly appreciated the possibility to build epub introduced in recent versions of PreTeXt-CLI (or, to be more precise, the fact that now the conversion to epub is easier).

I think that I have found a bug (maybe Windows only, I have no other systems at hand to test with). More precisely, if you use somewhere the <q> tag, then you get a message like this

 While running pretext, the following errors occured:

critical: 'charmap' codec can't decode byte 0x9d in position 2492: character maps to <undefined>

Steps to reproduce.
1. Create a new project with the command 'pretext new'
2. Add an epub target to the project.ptx file
3. Try to build epub: it should work
4. Open a source file (e.g. sec_first-example.ptx) and enclose a word in <q> </q>
5. Try to build epub again: it should fail

If you use <sq> tag instead, no problem occurs. 

I could more tests, if needed.

Cheers,
Valerio

Rob Beezer

unread,
Sep 7, 2022, 7:25:08 AM9/7/22
to prete...@googlegroups.com
Thanks, Valerio.

Shooting in the dark for the CLI folks. Perhaps the ZIP file construction in core needs some help with encodings for Windows? The Unicode for curly double quotes is not too bizarre, I think.

Steven Clontz

unread,
Sep 7, 2022, 3:14:53 PM9/7/22
to PreTeXt development
It's unclear to me that this is CLI-specific - can anyone use the pretext/pretext script on Windows or call https://github.com/PreTeXtBook/pretext/blob/master/pretext/pretext.py#L2018 on a Windows machine to check?

gedeoned...@gmail.com

unread,
Sep 8, 2022, 7:18:31 AM9/8/22
to PreTeXt development
Unfortunately I was never able to build epub using the pretext script method (while I used pretext script and xstproc to converto both to html and latex)

Oscar Levin

unread,
Sep 8, 2022, 4:19:05 PM9/8/22
to PreTeXt development
I can confirm that this does indeed cause a problem on Windows, using both the CLI and the pretext/pretext script.  I'll play around with it some soon; google thinks it might be an encoding issue when python opens something.

I have had success building epub using Windows Subsystem for Linux.

Reply all
Reply to author
Forward
0 new messages