views:

450

answers:

1

The listings package supports line breaks inside lstlisting environment. But it doesn't produce automatic line breaks for lstinline environment. For example, in the following paragraph the first line flows out of the margins:

The parameters \lstinline|base_rmr_brain|, \lstinline|base_rmr_fat|, and \lstinline|baseline_basal_rmr_of_lean_tissues| are metabolic rates of brain, fat, and lean tissues in kcal/(kg*day). The parameter \lstinline|mass_brain| denotes the mass of the brain in gram.

Is there any solution for this problem?

+2  A: 

The literate feature of listings could be helpful, e.g. to introduce linebreaks at underscores:

\lstset{
  literate={\_}{}{0\discretionary{\_}{}{\_}}%
}
rcs
Thank you very much. This solved the problem.
Mert Nuhoglu
For me, this produces a shorter underscore than the original...
Frank