[texhax] Automatically preventing line breaks before citations

Trevor Harmon trevor at vocaro.com
Sun Jul 6 06:22:59 CEST 2008


To prevent a line break before a citation command, I can manually add  
a non-breaking space:


But I want to make this automatic. In other words, I want to leave out  
the tilde and still get the same output.

After hacking around, I discovered that I can make a copy of cite.sty,  
include the copy in my document as a package, and change its spacing  
adjustment command (line 168) so that "highpenalty" is replaced with  
"10000". This has the desired effect of preventing line breaks in  
front of \cite commands.

The only problem is that now I have to bundle a custom copy of  
cite.sty with all my documents. There must be some way of simplifying  
my solution, but all my attempts have failed. Ideally, I want to  
reduce my solution to a single command that I add to the top of my  
document. Any suggestions? Thanks,


More information about the texhax mailing list