This has nothing to do with luatex/minted, but anyway please read "this workS" and "this may boil down to" below...
R. On Sun, Nov 08, 2020 at 10:59:18AM +0100, Robert Alessi wrote: > Thank you both. I didn't pay attention to Scott's previous post, > sorry about that. > > On Sat, Nov 07, 2020 at 11:47:39PM +0000, David Carlisle wrote: > > On Sat, 7 Nov 2020 at 23:10, luigi scarso <[email protected]> wrote: > > > > [...] > > > >> > > > It's the same problem as in > > > Assertion from texlang.c with reproducible example > > > <https://tug.org/pipermail/luatex/2020-November/007424.html> > > > > > > ( the hyphenation expects a simple word, but > > > the word doesn't start with a character.) > > > For the moment I will make a better error message. > > I now think it is clear enough ;) > > > > luigi > > > > > > ah so a workaround for the OP would be to hide the quote in a box so > > hyphenation is back in more normal territory > > > > \documentclass{article} > > > > \usepackage{minted} > > > > \begingroup > > \makeatletter > > \catcode`\'=\active > > \gdef\minted@patch@PYGZsq@i{\gdef\PYGZsq{\mbox{'}}} > > \endgroup > > > > \begin{document} > > > > \begin{minted}{latex} > > a-' > > \end{minted} > > > > \end{document} > > This works, thank you! Unfortunately, the following fails for the > same reason (namely ` instead of '): > > ---------------snip--------------- > \documentclass{article} > > \usepackage{minted} > > \begingroup > \makeatletter > \catcode`\'=\active > \gdef\minted@patch@PYGZsq@i{\gdef\PYGZsq{\mbox{'}}} > \endgroup > > \begin{document} > > \begin{minted}{latex} > a-` > \end{minted} > > \end{document} > ---------------snip--------------- > > Another way would be to have the hyphen itself inserted in a box, like > so: \def\PYGZhy{\mbox{\char`\-}} > > This work, but unfortunately \PYGZhy is only defined in the > 'default-pyg-prefix.pygstyle' file that is generated inside minted > output dir. However, as this file is untouched if it exists, one can > modify this file after the first run. > > Or this may boils down to inserting this in the preamble: > > ---------------snip--------------- > \usepackage{etoolbox} > \usepackage{minted} > \makeatletter > \patchcmd{\minted@checkstyle}{\minted@input{% > > \minted@outputdir\minted@cachedir/\ifstrempty{#1}{default-pyg-prefix}{#1}.pygstyle}% > }{\minted@input{% > > \minted@outputdir\minted@cachedir/\ifstrempty{#1}{default-pyg-prefix}{#1}.pygstyle}% > \def\PYGZhy{\mbox{\char`\-}}}{}{} > \makeatother > ---------------snip--------------- > > Thanks again! > > Robert > > > David
