bug-texinfo
[Top][All Lists]
Advanced

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

Re: `@code` doesn't allow line break after first `-`


From: Werner LEMBERG
Subject: Re: `@code` doesn't allow line break after first `-`
Date: Sat, 14 Jan 2023 06:38:47 +0000 (UTC)

>> Mhmm, more tests show that for `@code{foo--bar}` there is no
>> `@discretionary` after the two hyphens.  Is this intentional?
> 
> Yes, it is.  This was to stop hyphenation in @option{--option}.

OK.  I guess it isn't easily possible to make TeX insert a
discretionary after two hyphens in the middle of a word while still
preventing a break after two leading dashes...

For LilyPond's documentation I've already written a LuaTeX filter to
improve `@code`, so it doesn't directly bother me :-)

  
https://gitlab.com/lilypond/lilypond/-/commit/33cd718fb0a3c844d0c20a99870fd6b4d4f91a9c

This filter needs `@allowcodebreaks false` and currently doesn't
handle the 'foo--bar' case (because it doesn't happen in LilyPond's
documentation), but adding it would be straightforward.

>> Additionally, I wonder whether the same logic should be applied to
>> `_`.  If you want to document, say, C prepocessor symbols, you will
>> have tokens like `_foo` or `__foo_bar`, and `texinfo.tex` happily
>> inserts `@discretionary` after all of those underline characters.
> 
> [...] it would make sense to do the same thing for _ as for -.

Yeah.  I currently don't see any negative side effects if the handling
would be made similar.


    Werner



reply via email to

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