Some helpful instructions on Stuart Colville’s blog explain how to do this.

To produce e.g. abc'def, you need to enter

$echo 'abc'\''def'

The '\'' first closes the single quotes, then puts a literal (escaped) ' and then opens single quotes again.