  We consider generalizations of nonlinear Schr\"odinger equations, which we
call "Karpman equations", that include additional linear higher-order
derivatives. Singularly-perturbed Karpman equations produce generalized
solitary waves (GSWs) in the form of solitary waves with exponentially small
oscillatory tails. Nanoptera are a special case of GSWs in which these
oscillatory tails do not decay. Previous research on continuous third-order and
fourth-order Karpman equations has shown that nanoptera occur in specific
settings. We use exponential asymptotic techniques to identify traveling
nanoptera in singularly-perturbed continuous Karpman equations. We then study
the effect of discretization on nanoptera by applying a finite-difference
discretization to continuous Karpman equations and studying traveling-wave
solutions. The finite-difference discretization turns a continuous Karpman
equation into an advance--delay equation, which we study using exponential
asymptotic analysis. By comparing nanoptera in these discrete Karpman equations
with nanoptera in their continuous counterparts, we show that the oscillation
amplitudes and periods in the nanoptera tails differ in the continuous and
discretized equations. We also show that the parameter values at which there is
a bifurcation between nanopteron and decaying oscillatory solutions depends on
the choice of discretization. Finally, by comparing different higher-order
discretizations of the fourth-order Karpman equation, we show that the
bifurcation value tends to a nonzero constant for large orders, rather than to
$0$ as in the associated continuous Karpman equation.
