bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: luatex disobeys `@allowcodebreaks false`


From: Werner LEMBERG
Subject: Re: luatex disobeys `@allowcodebreaks false`
Date: Mon, 19 Dec 2022 11:35:24 +0000 (UTC)

> More diagnostic [...]

The problem is that for LuaTeX it is not sufficient setting
`\hyphenchar` to -1 to disable hyphenation at explicitly inserted `-`
characters...

The simplest solution is probably to change in this code

```
\ifallowcodebreaks
 \let-\codedash
 \let_\codeunder
\else
 \let-\normaldash  <---
 \let_\realunder   <---
\fi
```

the two marked lines so that they use macros that decorate '-' with
`\penalty 10000` to really prevent a line break at this point.  See
below for something that works for me.

An alternative, more complicated solution would be to set LuaTeX's
'hyphenate' callback to empty at the beginning of @code, resetting it
afterwards.


    Werner


======================================================================


--- texinfo.tex.old     2022-12-17 19:04:47.000000000 +0100
+++ texinfo.tex 2022-12-19 12:33:57.864557116 +0100
@@ -2901,6 +2901,12 @@
   \null % reset spacefactor to 1000
 }
 
+% This is for LuaTeX: It is not sufficient to disable hyphenation at
+% explicit dashes by setting `\hyphenchar` to -1.
+\def\dashnobreak{%
+  \normaldash
+  \penalty 10000 }
+
 % We must turn on hyphenation at `-' and `_' in @code.
 % Otherwise, it is too hard to avoid overfull hboxes
 % in the Emacs manual, the Library manual, etc.
@@ -2921,7 +2927,7 @@
      \let-\codedash
      \let_\codeunder
     \else
-     \let-\normaldash
+     \let-\dashnobreak
      \let_\realunder
     \fi
     % Given -foo (with a single dash), we do not want to allow a break



reply via email to

[Prev in Thread] Current Thread [Next in Thread]