0

I am looking for a way to discourage ending lines with a single character. I could manually type out, for example: a\penalty\hyphenpenalty\ cat or I\nolinebreak[1]\ am each time I write a single character, but I am looking for an automated solution. I am aware that regex workarounds exist.

I have read another discussion on this forum where ending a line with a single character is absolutely prohibited rather than simply discouraged. (Compare I~am with I\nolinebreak[1]\ am.)
one-letter word at the end of line
I have tested this in my other documents via \usepackage[nosingleletter]{impnattypo}. I have found that it is more likely than not typographically inferior to alternatively discouraging line breaks at single characters.

User23456234
  • 1,808
  • 1
    use the accepted answer that you link to but change p.penalty = 10000 to p.penalty = 100 or whatever penalty you want – David Carlisle Jan 25 '23 at 12:20
  • I ended up just slightly modifying the impnattypo package as you suggested. Not the most elegant method, but it achieves the intended result. – User23456234 Jan 25 '23 at 13:28

1 Answers1

2

Use the accepted answer that you link to but change

p.penalty = 10000

to

p.penalty = 100

or whatever penalty you want, so that breaking is discouraged rather than prevented. You could suggest to the author of impnattypo that the value is made available via a package option or command, defaulting to 10000.

David Carlisle
  • 757,742